fix: filter unsupported cooldown options - #620
Conversation
Preserve general cooldown settings while omitting SemVer-specific fields from ecosystems that do not support them. Avoid emitting an empty cooldown block when every configured day field is unsupported. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 70c37dc1-7495-4c4f-a381-0614c40b3ec5 Signed-off-by: Zack Koppert <zkoppert@github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The change is narrowly scoped, behavior is covered by targeted regression tests, and the updated generation logic matches the PR’s stated acceptance criteria.
Review tier: Lite
Findings: None
What changed in this PR
This PR fixes invalid generated dependabot.yml output by filtering out unsupported SemVer-specific cooldown keys (semver-*-days) for ecosystems that don’t support them, while retaining supported cooldown fields (like default-days, plus include/exclude when applicable). It centralizes ecosystem capability checks so the same rules apply consistently across all detected ecosystems, including a regression fix for github-actions (Issue #605).
Changes:
- Introduces a
SEMVER_COOLDOWN_ECOSYSTEMSallowlist and filters SemVer cooldown keys per-ecosystem during config generation. - Omits the
cooldownblock entirely when filtering removes all supported day fields for an ecosystem. - Adds/updates unit tests covering mixed ecosystem output, GitHub Actions filtering, and SemVer-only cooldown inputs.
| File | Description |
|---|---|
| dependabot_file.py | Adds SemVer cooldown capability filtering and omits unsupported/empty cooldown blocks per ecosystem. |
| test_dependabot_file.py | Adds regression tests to ensure unsupported SemVer cooldown keys are filtered (and cooldown omitted when empty). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Pull Request
Proposed Changes
I found that Evergreen currently adds three unsupported SemVer cooldown fields to generated GitHub Actions configuration, which can make the Dependabot configuration invalid. I now filter
semver-major-days,semver-minor-days, andsemver-patch-daysbased on each ecosystem's documented capabilities. I preservedefault-days,include, andexcludewhen at least one supported day field remains.I also omit the
cooldownblock when filtering leaves no supported day field. This fixes #605 and applies the same capability check to all 29 ecosystems Evergreen currently detects.github-actionsdefault-daysplus three unsupportedsemver-*-daysfieldsdefault-daysremains and the three unsupported fields are omittednpmgithub-actionswith SemVer-only inputcooldownblock containing unsupported fields andexcludecooldownblock because no supported day field remainsI chose a centralized capability set instead of special-casing GitHub Actions so every generated ecosystem follows the same rule. The tradeoff is that newly supported ecosystems must be added to the set before Evergreen emits their SemVer-specific cooldown fields.
Testing
make testin the freshevergreen-605-validationCodespace at commit319a8e8, covering 182 tests with 100% line coverage.Rollout
No migration or feature flag is required because the fix only changes newly generated Dependabot YAML. After merge, I will watch for reports of invalid generated configuration and confirm GitHub Actions entries no longer contain unsupported SemVer cooldown fields.
Readiness Checklist
Author/Contributor
make lintand fixed all introduced issues.make testand added coverage for the new behavior.