Stop pinning shared-actions commit SHAs in coverage contract tests - #33
Conversation
Dependabot owns the leynos/shared-actions commit SHA used by the shared coverage and CodeScene upload actions. Asserting the exact pinned SHA in assert_ci_coverage_action_contract and assert_coverage_main_workflow_contract meant every Dependabot bump PR failed CI until a human hand-edited the expected string. Replace the exact-match assertions with shape assertions that confirm the `uses:` ref targets the correct reusable action path and is pinned to a full 40-hex commit SHA, without pinning which SHA. Add regression coverage proving a differently-valued SHA is accepted while a mutable branch ref such as @main is still rejected, and document the policy in the developers' guide.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 9 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
leynos/shared-actionscommit SHA in the coveragecontract test helpers (
assert_ci_coverage_action_contract,assert_coverage_main_workflow_contract). Dependabot bumps that SHAroutinely; asserting the literal value meant every bump PR failed CI until
a human hand-edited the expected string to match.
reusable-action path (
generate-coverage,upload-codescene-coverage) anda full 40-hex commit SHA, guarding against repointing at a mutable branch
such as
main.docs/developers-guide.mdunder a new "Workflowpins and Dependabot" subsection.
Review walkthrough
tests/helpers/ci_contracts.py: replaces the two hard-coded...@927edd45ae77be4251a8a18ca9eb5613a2e32cbdequality checks with regexshape assertions (
_GENERATE_COVERAGE_USES_RE,_UPLOAD_CODESCENE_COVERAGE_USES_RE). All other assertions (checkoutcredential hygiene, guard conditions, coverage inputs, Rust manifest wiring)
are unchanged.
tests/test_helpers.py: adds regression coverage proving a workflow pinnedto a different 40-hex SHA is still accepted (simulating a Dependabot
bump), while a workflow pinned to
@mainis rejected, for both the CI andcoverage-main contracts.
docs/developers-guide.md: adds the canonical "Workflow pins andDependabot" policy subsection.
uses:pins intemplate/.github/workflows/*.yml.jinjaand.github/workflows/*.ymlareunchanged; Dependabot continues to own bumping them.
.github/dependabot.ymlalready has agithub-actionsecosystem entrywith
directory: "/"and a weekly schedule, so no change was needed there.Validation
make check-fmt— passmake lint— pass (Ruff + 100% docstring coverage)make typecheck— passmake test— 45 passed, 2 skipped (the 2 skips are theWITH_ACT=1-gatedact-integration tests, expected without Docker locally)
make spelling— pass,typos.tomlunchanged (no regeneration drift)any future 40-hex SHA Dependabot substitutes, while rejecting non-SHA refs
such as branch names — confirmed by the new negative-path tests.