Repository navigation
Conversation
The pull_request trigger was filtered to branches: [main]. A stacked pull request targets another pull request's branch, so GitHub started no Tests run for it at all. The filter is removed. Pushes still run the workflow only for main. Nothing else in the workflow depends on the base branch. The concurrency group is keyed on the pull request number, and country selection reads the pull request's own changed files from the API. Pull requests from this repository's branches get the same token permissions and secrets whatever their base. New tests read the workflow's triggers. Pull requests into main, into another pull request's branch and into a nested branch name must all run it, and pushes must run it only for main. The agent guide and a changelog fragment say so. Fixes #1321 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
added this pull request to stack #1323
October 19, 2026 21:09
This was referenced Oct 19, 2026
The previous test checked three literal branch names against the trigger's branches and branches-ignore lists. GitHub matches those entries as glob patterns, so a membership check proves nothing about other bases: a filter listing exactly those three names passed it, although pull requests into any other base would get no run, and a filter of '**', which runs for every base, failed it. The intended design is no base-branch filter at all, so the test now asserts that the pull_request trigger has neither a branches nor a branches-ignore key. _workflow_triggers is typed as dict[str, Any]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every push to a pull request's branch now runs the full Tests workflow on the organization's shared runners, whatever the base, so merging one change up a stack of N pull requests starts N full runs. The agent guide says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
marked this pull request as draft
October 20, 2026 17:59
anth-volk
removed this pull request from stack #1323
October 20, 2026 18:01
anth-volk
pushed a commit
that referenced
this pull request
Oct 20, 2026
This branch carried #1322 through three merges of its branch (`ci-pull-requests-into-any-base`). #1322 removed the `branches: [main]` filter from the Tests workflow so stacked pull requests would get CI. That is not wanted: CI runs only for pull requests into `main` on purpose, to limit the number of simultaneous runs on the organization's shared runners. #1322 is being closed. This restores the four files #1322 changed to their versions on `main` (`a90eec3cb`), which is also this branch's merge base with `main`: - `.github/workflows/test.yml`: the `pull_request` trigger filters on `main` again; - `docs/agent-guide.md`: the CI paragraph no longer says any base runs; - `packages/microcosm-build/tests/engine_free/shared/test_ci_integration_job.py`: #1322's two trigger tests are removed; - `changelog.d/1321-ci-pull-requests-into-any-base.changed.md`: deleted. The branch's own commits are not rewritten, so `8d159a8`, which microcosm-collector#9 records as its source, stays in the history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
pushed a commit
that referenced
this pull request
Oct 20, 2026
…-schema Carries the restored main-only Tests workflow trigger (#1322 is not wanted) up the stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closing without merging. The Tests workflow runs only for pull requests into This pull request's changes were already in the branches stacked on it, so they are undone there without rewriting any commit:
|
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.
Fixes #1321
Summary
The Tests workflow (
.github/workflows/test.yml) ran forpull_requestevents only when the base branch wasmain. A stacked pull request targets another pull request's branch, so it got no CI at all. This PR removes thebranchesfilter from thepull_requesttrigger.main.This PR is the bottom of a stack:
main← this PR ← #1295 ← #1297 ← #1296 ← #1298 (GitHub stack #1323). CI started on every pull request above it after the stack was linked and pushed, which confirms the widened trigger works for stacked bases. It merges first. GitHub reads a pull request's workflow from that pull request's test merge commit, so each pull request above this one only runs CI because its branch includes this commit.Nothing else in the workflow depends on the base branch
${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}. It is keyed on the pull request number, so each pull request still cancels only its own outdated runs.tools/ci_test_plan.py select-countriesreads the pull request's own changed files (pulls/<number>/files), which GitHub computes against the pull request's base, whatever it is.github.base_reforgithub.head_ref, has nopathsfilters, and checks out the default ref, which is the pull request's test merge commit.setup-uvandsetup-nodecaches restore from the pull request's own ref or the default branch, so a non-mainbase changes nothing.Environment variables and secrets the workflow reads
I checked secret names only, read-only. Listing the repository, organization and
stagingenvironment secrets needs admin access, which this account has, so the listings are complete.mainbase?OMP_NUM_THREADS,OPENBLAS_NUM_THREADS,MKL_NUM_THREADSenv:)"1"in the workflowGITHUB_TOKENselect-countriesstepenv:(${{ github.token }}), passed totools/ci_test_plan.pyfor the pull-request files APIpermissions:(contents: read,pull-requests: read)GITHUB_EVENT_PATH,GITHUB_EVENT_NAME,GITHUB_REPOSITORY,GITHUB_OUTPUTtools/ci_test_plan.py select-countriespull_requestfor any base, and its payload has the samepull_request.number.GITHUB_STEP_SUMMARYtools/add_engine_us_timing_summary.shHF_STAGING_READ_TOKENintegration-ukstepenv:(${{ secrets.HF_STAGING_READ_TOKEN }}), read bytools/run_integration_tests.shstagingenvironment secret; the job declares noenvironment:anyway.mainpushes and every pull request, so the script always skips its optional private-repository access check. This predates this PR, which doesn't change it.Pull requests from branches in this repository get the same secrets whatever their base branch. GitHub withholds secrets only from pull requests opened from forks.
Commits
1.
50406fd59Run the Tests workflow for pull requests into any base branchtest_ci_integration_job.py:test_pull_requests_into_any_base_branch_run_the_tests_workflow, with three bases:main,orrery-projection-without-storeandstacked/parent-branch(replaced by commit 2);test_only_pushes_to_main_run_the_tests_workflow.onkey as the YAML 1.1 booleantrue, and the tests account for that.branches: [main]filter excluded the two non-mainbases. Themaincase and the push guard passed.tools/ci_test_plan.py verifyok;ruff checkandruff format --checkclean on the changed file; actionlint passed ontest.yml.changelog.d/1321-ci-pull-requests-into-any-base.changed.md.2.
b701a5e49Assert the pull_request trigger has no base-branch filterA review finding. Commit 1's test checked three literal branch names against the trigger's
branchesandbranches-ignorelists, but GitHub matches those entries as glob patterns, so a membership check says nothing about other bases. The intended design is no base-branch filter at all.test_pull_requests_into_any_base_branch_run_the_tests_workflownow asserts that thepull_requesttrigger has neither abranchesnor abranches-ignorekey._workflow_triggersis typeddict[str, Any], and thepytestimport, now unused, is removed.50406fd59^, withbranches: [main]):assert ['branches'] == [].branches: [main, orrery-projection-without-store, stacked/parent-branch], which gives pull requests into any other base no run, the old test passed (3 passed) and the new one fails;branches: ['**'], which runs for every base, the old test failed (3 failed). The new test fails too, because the design is no filter.ruff checkandruff format --checkclean on the changed file.3.
81650f002Note the runner cost of running CI for pull requests into any baseA review finding. The agent guide now says that every push to a pull request's branch runs the full workflow on the organization's shared runners, whatever its base, with the jobs and country selection a pull request into
maingets, so merging one change up a stack of N pull requests starts N full runs. Documentation only, so no red step.test_ci_integration_job.py, which reads the agent guide: 11 passed.4.
445823919Mergemainmainata90eec3cb(#1289, #1305), merged with a merge commit and no conflicts; none of its new commits touch this PR's files. No red step.test_ci_integration_job.pygave 11 passed andtools/ci_test_plan.py verifyreportedverification=ok.GitHub builds each stacked pull request's test merge on top of the test merge of the pull request below it, starting from
main: this PR'srefs/pull/1322/mergehasmainas its first parent, and each later one has the previous one's. Oncemaingained #1305, #1296's change torowwise_staging.pyconflicted with it, so GitHub could not build #1296's test merge, reported #1296 as conflicting although its branch contained its base, and started no CI for #1296 or #1298. Mergingmainhere, and each branch into the one above, resolved that.Locally I ran only the changed test file; CI runs the rest. On 2026-10-20 I re-checked the secret names, read-only:
test.ymlstill reads onlysecrets.HF_STAGING_READ_TOKEN, which is still neither a repository secret nor an organization secret available to this repository, so the table above holds. Commits 2 to 4 change no workflow file.Merge order
Each pull request above this one has its parent merged in, so with merge commits each one merges cleanly after its parent.
🤖 Generated with Claude Code