fix(governance): provide lock verifier to consumers - #684
Conversation
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
|
Warning Review limit reachedNext included review available in 55 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (1)
|
| Layer / File(s) | Summary |
|---|---|
Preserve and invoke the verification helper .github/workflows/governance-reusable.yml |
The sparse checkout fetches update-actions-lock.sh. The workflow copies it to $RUNNER_TEMP before checkout removal and runs the preserved copy for verification. |
Estimated code review effort: 2 (Simple) | ~5 minutes
Merge Risk: ⚪ Minimal · up to 9c11f
This change makes the lock-verification helper available to reusable-workflow consumers without changing governance policy, and no actionable merge-blocking risk remains beyond normal checks and review.
Suggested reviewers: joshuajewell
Poem
A rabbit checks the workflow gate
The helper hops before it’s late
Into temp storage, safe and sound
Then verifies pins without checkout ground
Green ears mark the passing state
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly summarises the main change: providing the lock verifier to consumer repositories through the reusable governance workflow. |
| Description check | ✅ Passed | The description directly explains the workflow correction, root cause, scope, and verification steps. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0… |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
- Create stacked PR
- Commit on current branch
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
The PR introduces the lock verifier to consumer repositories as intended. However, the current implementation of the script preservation step is brittle. While the sparse-checkout is configured to continue on error, the subsequent file copy operation at line 1092 lacks a fallback mechanism and will cause the job to fail immediately if the script is missing (e.g., during self-linting in the standards repository or due to checkout failures). This prevents both the lock verification and the downstream duplicate-key checks from executing, contradicting the resilience patterns established elsewhere in the workflow.
About this PR
- The workflow lacks a fallback mechanism for the lock verifier script. If the standards checkout fails, the workflow will fail at the copy step even if a local copy of the script exists in the repository, breaking self-linting capability and overall robustness.
Test suggestions
- Verify that the sparse-checkout fetches the update-actions-lock.sh script.
- Verify that the script is successfully copied to the temporary directory before directory cleanup.
- Verify that the Check SHA-pinned actions step executes the script from the correct temporary path.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that the sparse-checkout fetches the update-actions-lock.sh script.
2. Verify that the script is successfully copied to the temporary directory before directory cleanup.
3. Verify that the Check SHA-pinned actions step executes the script from the correct temporary path.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| cp .standards-dupkey/scripts/update-actions-lock.sh \ | ||
| "$RUNNER_TEMP/update-actions-lock.sh" |
There was a problem hiding this comment.
🟡 MEDIUM RISK
The current implementation for preserving update-actions-lock.sh lacks a fallback and error handling. Unlike the dupkeys.sh logic at line 1079, this cp command will fail the entire step if the file is missing from the .standards-dupkey checkout (e.g., if the checkout failed or if the repo is linting itself). This prevents the subsequent duplicate-key check at line 1095 from running. Update the logic to check if .standards-dupkey/scripts/update-actions-lock.sh exists, and if not, fallback to scripts/update-actions-lock.sh. Only attempt the copy if the script is found, ensuring a missing script doesn't prevent the duplicate-key check from running.
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
|



Summary
Root cause
The reusable workflow ran
scripts/update-actions-lock.sh --verify-localfrom the caller checkout. Consumer repositories with anactions.lockdo not carry that standards implementation script, so their otherwise-correct governance job failed with exit 127.Verification
bash scripts/check-workflow-duplicate-keys.sh .github/workflowsbash scripts/tests/actions-lock-update-test.shgit diff --checkThis is an infrastructure correction; it does not change governance policy or weaken lockfile verification.