Stop pinning the exact CodeScene action SHA in the coverage contract - #271
Conversation
Assert that the upload-codescene-coverage caller pins a full 40-hex commit SHA instead of one specific value, matching the policy adopted for the mutation workflow contract in #245. The exact-value assertion made every dependabot bump of the shared action fail the Formatting gate until a human edited the constant, as happened on #254. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe CodeScene workflow contract test now extracts the action reference after ChangesCodeScene pin validation
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 18 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (18 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/workflow_contracts/codescene_coverage_test.py`:
- Around line 176-180: Update the SHA validation in the coverage-check assertion
to use SHA_RE.fullmatch() instead of SHA_RE.match(), ensuring codescene_ref
contains exactly the required 40-hex commit SHA with no trailing characters.
- Line 18: Annotate the SHA_RE regular-expression constant with the
re.Pattern[str] type while preserving its existing compiled pattern and matching
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b905c2ba-ca2b-4d73-b4c2-b6a779e23d80
📒 Files selected for processing (1)
tests/workflow_contracts/codescene_coverage_test.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
leynos/ironclaw(auto-detected)leynos/memoryd(auto-detected)
Use fullmatch for both shared-action pin checks so a trailing newline cannot slip past the anchored match, and annotate the compiled patterns as re.Pattern[str] per the typing rules. Applies to the CodeScene coverage contract and, for the same reason, the mutation workflow contract. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Both findings addressed in the follow-up commit: |
|
@coderabbitai resolve |
✅ Action performedComments resolved and changes approved. |
Unblocks #254.
The CodeScene coverage contract test asserted the exact commit SHA of the
upload-codescene-coverageshared action, so every dependabot bump of that action (currently #254) failedmake test-workflow-contractsuntil a human edited the constant. #245 already established the policy for the mutation workflow contract: contract tests verify that the caller pins a full 40-hex commit SHA — the shape — while dependabot owns the value.This applies the same pattern to
tests/workflow_contracts/codescene_coverage_test.py. All nine workflow contract tests pass locally.🤖 Generated with Claude Code