Repository navigation
v1.92.62.0 fix(pregate): clear --run-url refuses a run of another workflow - #3832
Merged
Merged
Conversation
… lane with no profile (red, GSTA-203 PR 6) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…lane with no profile (GSTA-203 PR 6) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… null run read (GSTA-203 PR 6) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ofile (red, GSTA-203 PR 6 fix-check) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…step (GSTA-203 PR 6 fix-check) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… and only its run clears it; the ready conflict hint names each lane's own workflow (GSTA-203 PR 6) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Contributor
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A run of another workflow no longer clears a lane with no run profile.
Before/after as text: A run of another workflow no longer clears a lane with no run profile
Live on this PR's own runs: main's
gstack-pregate clear --remote free-tests.yml/macos-named-regressions --run-url <windows-smoke.yml run 41381957103>printedPREGATE_CLEARED; this branch'sbin/gstack-pregaterefuses it withworkflow_mismatchand the fix line, and clears the lane from the Free Tests run 41381957170 (also from its/job/1?pr=3832link).Why
"A run of a different workflow clears an obligation it never tested." Branches cut before #3806 still owe
windows-free-tests.yml/windows-free-shard, and lanes were clearing it withwindows-smoke.ymlrun URLs, becauseclear --run-urlon a lane with no run profile recorded any URL. Nowclearreads the run and refuses unless its workflow file is the lane's own.Blast radius
Only
gstack-pregate clear --run-urlon a platform lane with no run profile, when the base config and the GitHub origin can be read;test_backend/*,--bundle-lane,pregate.json/remote_gate, profiled lanes and non-GitHub origins take the same paths as before (lib/pregate/index.ts clearDecision, read and asserted in test/pregate-clear-runs.test.ts).ready --dispatch-cinever callsclearDecision: it already matches each lane to the dispatched workflow (lib/ship-queue-dispatch-ci.ts:81, read). A signed-out gh now refuses that clear (api_error) instead of recording it. Thereadyconflict hint (lib/ship-queue.ts) changes text only.Behavior changes
gstack-pregate clear --run-urlon a lane with no run profile: before, any URL was recorded; now a run of another workflow (workflow_mismatch), a run gh cannot read (api_error) or a URL that is not an Actions run on this repository (run_ref_invalid) refusesPREGATE_RECEIPT_INVALID, each with its own fix line.gstack-ship-queue readyconflictci-hint:: now says to clear each lane pregate names with a run of that lane's own workflow.Approvals
Source: gstack-approvals record for gsta203-pr6-clear-workflow-check (display only; not an approval citation).
Summary
Lanes cut before #3806 were clearing the old Windows lane with windows-smoke runs, and pregate let them because it never opened the run.
clearnow reads the run's workflow file, refuses a mismatch with a fix that names the right workflow, and still accepts the right run, including a job link copied from the checks page. A test on this repository's own workflows pins main's Windows obligation towindows-smoke.yml/windows-smoke(the six-shard job ismanual), and thereadyhint now points each lane at its own workflow.The
ci-reuse/windows-free-testsrun profile is unchanged, because no lane id matches it, its reuse job runs only on push to main (which windows-free-tests.yml no longer triggers on), and--from-runaccepts only a verified green run of the exact tree.Test Coverage
All new code paths have test coverage. Each regression test failed before its fix: the wrong-workflow test at 51efe02 on main's code (0 pass, 1 fail; received
cleared https://github.com/fx/fx/actions/runs/300), the copied-link test at a330d4d (0 pass, 1 fail).Tests ran: focused 54
Pre-Landing Review
No blocking issues. One informational finding was fixed in pass 1 (each refusal names its own fix). The round-2
?pr=/#stepstrip was fixed under GStack Minder's rule 23 grant, with one scoped fix-check. Then a scoped fix-check on Captain-ordered hunks, same grant (trail row 13): thereadyhint, the windows-smoke discovery test and the docs/pregate.md wording. Both fix-checks were clean apart from informational notes.REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=3 fixed=1 scope=frozen fix_checks=2 dispatches=4
Gate edits: none detected (GATE_SCAN tagged=0)
Outside review: gpt-6.1-sol, clean.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/pregate/index.ts:263run_ref_invalid refuses job links with ?pr= or #step anchors because parseRunRef ends with /?$; the fix line names the accepted form, so it costs one retry.lib/pregate/index.ts:263run URLs with ?pr= or #step suffixes refuse run_ref_invalid (parseRunRef ends /?$); loud, fix line names the accepted formlib/pregate/index.ts:268a failed, cancelled or old run of the right workflow still clears a no-profile lane; documented, run profiles add the restbin/gstack-pregate:237non-github.com origin skips the check with a warning (unchanged, documented)lib/ship-queue.ts:178conflict ci-hint says dispatch windows-smoke.yml; on a pre-v1.92.51.0 ci: windows-smoke is the required Windows check; the six-shard suite runs nightly (GSTA-203 PR 1) #3806 branch clearing the old lane with that run now refuses workflow_mismatch (refusal fix names the right workflow; TODOS tracks the hint)lib/run-evidence.ts:135(fix-check): profiled lanes and--runstill refuse?pr=job links throughverifyRun; unchanged and fails closed.docs/pregate.md:782(fix-check): main also hasfree-tests.yml/cso-windows-launcherandwindows-setup-e2e.yml/windows-setupas Windows lanes, so "the Windows obligation" means the free tier's smoke lane.Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Plan Completion
Plan: eng-only autoplan run autoplan-20261102021943, APPROVED as-is. Every item shipped: failing test first, the fix, the negative control, docs/pregate.md and the TODOS.md P2 note.
TODOS
No TODO items completed in this PR. The P2 "Branches cut before windows-smoke.yml still owe the old Windows lane" item now notes that this check blocks the wrong-workflow clear.
Documentation
Status: current — the branch's own docs/pregate.md update matches the shipped
clear --run-urlworkflow check; no further doc edits needed.Scope: candidate a563f47..2b3a798 (7 commits: lib/pregate/index.ts, lib/ship-queue.ts, docs/pregate.md, TODOS.md, a changelog.d fragment, two tests); no staged, unstaged or new files. Searched every tracked doc and authored template for
clear --remote,--run-url,PREGATE_RECEIPT_INVALID, the new reason codes,windows-free-shardand thereadyconflict hint.Documentation health:
clearDecisionand the tests: workflow_mismatch, api_error, run_ref_invalid, copied job links, windows-smoke obligation)Documentation debt:
gstack-pregate clear --run-urlrefusals (workflow_mismatch,api_error,run_ref_invalid): reference only (docs/pregate.md run evidence, the refusal's own fix line); thePREGATE_RECEIPT_INVALIDtroubleshooting entry lists--receiptand--runrefusals but not these (how-to gap).Diagram drift: none; no renamed or removed modules.
Test plan
bun test test/pregate-clear-runs.test.ts test/gstack-ship-queue.test.ts test/pregate-remote-stamp-only.test.ts test/pregate-from-run.test.ts test/ship-receipt-carry-pregate.test.ts: 54 pass, 0 fail (finish lane)bun run typecheck,bun run typecheck:test(none new), module-size ratchet, bun-entry isolation, harness-version, git-ref and spawnsync tripwires, changelog fragments: passPREGATE_REMOTE: tree=3c908c18e2b5 tests=10218 failed=0 spent=0.05test/pregate-remote.test.ts"a wrong tree, zero tests…" timed out at bun's 5 s default once in a combined run; it is flaky on main a563f47 too (fail 5222 ms, then pass 3638 ms) and this PR does not touch--remote