Repository navigation
ci: make python-suite reportable on stacked PRs and in a merge queue (#14747, #14353) - #16098
Conversation
…14747, #14353) The backend Python suite gates nothing, and the same gap has now been filed five times over 71 days -- #10691, #13162, #14353, #14673, #16087 -- all open, only one pair cross-linked. Consolidated on #14353. Audited per context: no required check runs the backend suite. Four named test files and one marker-filtered migrations directory are reachable; a regression in autobot-backend/services/ is invisible to all ten. Making python-suite the eleventh is a branch-protection change. This is the code half, and it is two triggers on one file. STACKED PULL REQUESTS (#14747). ci.yml carried `pull_request: branches: [ main, Dev_new_gui ]`. A stacked PR -- base is another feature branch -- matches neither, so the workflow never triggered and python-suite never ran. Measured on #14641: zero CI/CD runs, while the page showed green from the workflows that do trigger. The complement shim cannot rescue it: on a stacked PR WITH Python changes the shim correctly skips, so neither side publishes. Harmless while the context is unrequired; a permanent hard block the moment it is required. MERGE QUEUE (#15937 / #14054). Ten of the required contexts' workflows already carry merge_group. ci.yml did not, so python-suite could never report inside a queue -- which is one reason the queue could not be enabled while this was outstanding. WHAT I GOT WRONG FIRST, because the tests nearly shipped as repo-wide rules. I wrote both invariants as parametrized rules over every workflow publishing a required context. A direct scan of all fourteen said no to both: pull_request.branches 13 workflows carry it -- it is the norm, not the defect merge_group missing the 4 complement shims, deliberately The second is worse than over-broad: I had already ADDED merge_group to python-required-context.yml on the reasoning that both publishers of a context should match. #15937 states as an acceptance criterion that shims stay pull_request-only, and this test file's own note says the shim "cannot see" merge_group because it is not one of its triggers. Inside a queue ci.yml always triggers and its python-suite job skips on a Python-free group, which reports the context; the shim is not needed and must not gain it. Reverted. So both tests are scoped to ci.yml, with the reason at the assertion, plus a counterpart pinning that no shim has gained the trigger -- because the fix is one edit away from breaking the rule it depends on, and the next person reasoning as I did should be stopped by a test rather than by review. Not in scope: making python-suite required, which is a settings change; and whether the other thirteen workflows should drop their branches filter, which is a much larger question than this issue.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 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 |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
|
Review: approved. The scoping you asked me to check hardest is correct, and the test guarding your own reverted mistake is the best thing here. The scoping checkThe tests are doc = yaml.safe_load((WORKFLOW_DIR / "ci.yml").read_text(encoding="utf-8"))Both assertions hang off that single document, and both failure messages name The counterpart test is the standoutdef test_the_shims_have_not_gained_a_merge_group_trigger():
"""The counterpart, because the fix above is one edit away from breaking it."""You added That is the strongest available outcome from an error: not a fix, and not a comment, but a test that fails for the reason you nearly shipped. It also means the two tests are genuinely complementary — one requires a trigger, the other forbids it on adjacent files, so neither can be satisfied by a blanket edit. Verification noteI am holding rather than merging, and the hold has a known end. My gate reports I verified it resolves rather than assuming: it is I checked those on each PR's VerdictApproved, merging as soon as the watchdog reports. Zero unresolved threads. |
Review — one finding, at
|
#14747) Review found the gap and it is real: required_context_complements_test.py checked conditions, job names, runners and the shared filter -- and NOT triggers. A complement only holds while both workflows run, so "which events run this" is half the property the file exists to protect, and it was exactly the half blind to the axis this PR changes. The reviewer's worry was that with the shim untriggered inside a merge queue, neither half covers a Python-free group. Working it through, ci.yml covers both cases on its own once it has merge_group: it always triggers in a queue, its python-suite job runs when the group touches Python and reports skipped when it does not, and a skipped job still publishes its check-run. The shim is not needed there and must not gain the trigger -- a second publisher of the same context would be a competing report, and #15937 records the pull_request-only scope as an acceptance criterion. So the conclusion did not move, but the reason it did not move was nowhere in the tests. Now it is. Asserted as an EXACT SET rather than as an absence. `"merge_group" not in on` would still pass if the shim quietly gained push or schedule, which is the same silent widening this file exists to prevent -- and the same shape as an allowance that names one advisory while admitting a whole package.
Closes #14747
Refs #14353, #10691, #13162, #14673, #16087, #15937, #14054
Thinking Path
The backend Python suite gates nothing, and the gap has been filed five times in 71 days — #10691 (29 Jun), #13162 (31 Jul), #14353 (16 Aug), #14673 (21 Aug), #16087 (8 Sep). All five open; only one pair was cross-linked. Consolidated on #14353.
Audited per context against live branch protection: no required check runs the backend suite.
Unit & Integration Testsis published byfrontend-test.yml:98and every one of itsrun:steps is npm withworking-directory: autobot-frontend. Four named test files (startup-import-smoke.yml:111,126,146) and one marker-filtered migrations directory (migration-gate.yml:138) are reachable — a documented carve-out, chosen as "smallest-blast-radius" rather than closing the gap. A regression inautobot-backend/services/is invisible to all ten.Making
python-suitethe eleventh is a branch-protection change and not a PR. This is the code half, and it is two triggers on one file.What Changed
Stacked pull requests (#14747).
ci.ymlcarriedpull_request: branches: [ main, Dev_new_gui ]. A stacked PR — base is another feature branch — matches neither, so the workflow never triggered andpython-suitenever ran. Measured on #14641: zero CI/CD runs, while the page showed green from the workflows that do trigger.The complement shim cannot rescue it. On a stacked PR with Python changes the shim correctly skips (
needs.changes.outputs.python != 'true'), so neither side publishes. Harmless while the context is unrequired; a permanent hard block the moment it is.Merge queue (#15937 / #14054). Ten of the required contexts' workflows already carry
merge_group:.ci.ymldid not, sopython-suitecould never report inside a queue.What I got wrong first, and how it was caught
Both tests were originally written as parametrized rules over every workflow publishing a required context. A direct scan of all fourteen refused both:
The second is worse than over-broad. I had already added
merge_group:topython-required-context.yml, reasoning that both publishers of a context should match. #15937 states as an acceptance criterion that shims staypull_request-only, and this very test file notes the shim "cannot see"merge_groupbecause it is not one of its triggers. Inside a queueci.ymlalways triggers and itspython-suitejob skips on a Python-free group, which reports the context. The shim is not needed and must not gain it. Reverted.So both assertions are scoped to
ci.yml, with the reason at the assertion — plus a counterpart pinning that no shim has gained the trigger, because the fix is one edit away from breaking the rule it depends on.Verification
Both workflow files parse under
yaml.safe_load, and the trigger sets are['merge_group','pull_request','push']and['pull_request']respectively.Model Used
Claude Opus 5 (1M context).
Single-issue rationale
Closes #14747 and delivers the code prerequisite for #14353; those are one change to one trigger block, not two. The remaining half of #14353 is a branch-protection setting, which no PR can carry. The other three duplicates (#10691, #13162, #14673) describe the same gap and close on the settings change, not on this.
Not in scope: requiring
python-suite, which needs the repository owner. And whether the other thirteen workflows should drop theirbranches:filter — a far larger question, and the measurement above is the argument for treating it separately rather than sweeping it in here.