fix(groom): default workflows_ref to github.job_workflow_sha so assets can't desync from the uses: pin (BE-4169)#69
Conversation
…s can't desync from the uses: pin (BE-4169)
The _groom_assets checkouts (finder/verifier briefs + dedup ledger) loaded from inputs.workflows_ref with default: main, so any caller that omitted workflows_ref ran the job logic at its uses: SHA while loading assets from moving main (silent drift), and a pin bump that edited uses: but not workflows_ref ran logic and assets at different commits.
Default the effective ref to ${{ inputs.workflows_ref || github.job_workflow_sha }} across all six asset checkouts and change the input default from main to '', so with workflows_ref unset the assets auto-pin to the exact commit the reusable workflow itself was resolved from. workflows_ref stays as an explicit override for testing briefs from a branch. Update the caller-pattern comment + input description accordingly.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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 (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @mattmillerai.
Found 1 finding(s).
| Severity | Count |
|---|---|
| 🟢 Low | 1 |
Panel: 7/8 reviewers contributed findings.
Reviewers that did not contribute: gpt-5.6-sol-max:adversarial (error)
ELI-5
The groom workflow reads its instruction files (the finder/verifier/builder briefs + the dedup ledger) out of this repo. Until now, callers had to hand-copy the same commit SHA into two places — the
uses:line and aworkflows_ref:input — to make the code and the instructions match. Nobody enforced that they stayed equal, so a caller that forgotworkflows_refran the pinned code but read instructions from movingmain, and a pin bump that touched only one line ran code and instructions at different commits. This change makes the workflow default to pulling its assets from the exact commit it was itself resolved from (github.job_workflow_sha), so callers don't have to mirror anything and the two can't drift.What changed
.github/workflows/groom.ymlonly:_groom_assetsstep from${{ inputs.workflows_ref }}to${{ inputs.workflows_ref || github.job_workflow_sha }}(all six asset checkouts: finder briefs, verifier briefs, both ledger checkouts, the builder brief, and the signature marker — leaving any one bare would reintroduce the desync).workflows_refinputdefaultfrommainto''(empty), so an unset input falls through togithub.job_workflow_sha— documented as "for jobs using a reusable workflow, the commit SHA for the reusable workflow file."workflows_refas an explicit override (e.g. testing briefs from a branch) and rewrote its description to say so.workflows_ref: <sha>line from the caller-pattern comment block and refreshed the adjacent security comment.Why this is safe
groom.ymlison: workflow_callonly, sogithub.job_workflow_shais always populated with the reusable workflow's own resolved commit when its jobs run. The||returns the first truthy operand: an explicitworkflows_refstill wins; an empty/unset one falls back to the auto-pin. The degenerate "both empty" case cannot occur for aworkflow_call-only reusable, and even if it did, an empty ref just checks out github-workflows' default branch — no worse than the olddefault: main.default: mainwas the naive initial default introduced with the workflow itself in #49 (BE-3872); this ticket is its intended correction (deferred from the review thread on comfy-cloud-mcp-server#786).Scope / follow-ups (deliberately not in this PR)
Both remaining caller cleanups must wait until each caller's
uses:pin is bumped to a SHA that includes this fix — droppingworkflows_reffrom a caller whoseuses:still points at the pre-fixgroom.ymlwould make that old workflow default tomain, i.e. the exact drift bug:ci-groom.ymlstill passesworkflows_ref: 07154fb…(itsuses:pins the old groom.yml). Left as-is; it becomes removable once the pin is bumped (bump-callers machinery).Verification
python3 -m unittest discover -s .github/groom/tests→ 48 tests pass.inputs.workflows_refrefs confirmed replaced.github.job_workflow_shais populated on a SHA-pinneduses:dispatch (a live dry-run ofci-groom.ymlagainst a SHA carrying this change). Not runnable from the coding loop (needs a live run + secrets).actionlint1.7.12 flagsgithub.job_workflow_shaas an unknown context property — that's a stale-schema false positive (the property is documented and quoted above); this repo's CI does not run actionlint on workflows.