ci(workflows): run checks on stacked pull requests - #1258
Merged
Conversation
CI and the PR contract check only triggered for pull requests based on develop, release, or master. A stacked pull request targets another feature branch, so it received no typecheck, lint, unit-test, clippy, or contract signal until the whole stack landed on develop.
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.
Problem
CI and the PR contract check only trigger for pull requests whose base is
develop,release, ormaster:A stacked pull request targets another feature branch, so it matches no
trigger and runs no checks at all. Open stacks are affected today: on
#1220 and
#1222 the only check that ran was
Check AI attribution, which already uses an unfilteredpull_requesttrigger. Neither PR has a typecheck, lint, unit-test, clippy, or
Enforce PR contractresult, so the reported verification for both isauthor-run only and nothing enforces the PR contract on them.
The same gap applies to every other stack in the repository, including the
codex/issue-*agent-org chain, where a defect can only surface once thewhole stack has landed on
develop.Solution
Drop the base-branch filter from both workflows so they run on every pull
request, matching the trigger
check-ai-attribution.ymlalready uses.Cost stays proportional to the diff, because the existing controls key off the
pull request rather than its base:
Detect CI scopejob diffsbase.sha...head.sha, which for a stacked PRis exactly that PR's own change, and skips the macOS clippy runner when no
Rust file changed
concurrency: ci-pr-<number>withcancel-in-progressstill supersedesolder runs for the same PR
Potential risks
This is the intended effect, and scope detection means a frontend-only
stacked PR does not allocate a macOS runner. Rust-touching stacked PRs do
add a clippy run, which is the expensive job in this workflow.
Enforce PR contractnow applies to stacked PRs. Existing stacked PRswhose title or description does not meet
.github/PR_RULES.mdwill startfailing that check until their description is corrected. This is the point
of the change, but it will surface as new red checks on PRs that were
previously unchecked.
pr-policy.ymlkeepspull_request_target, so it still runs the workflowdefinition from the base branch. A stacked PR therefore only picks this up
once its base branch contains this commit; the same is true for
ci.ymlviathe merge commit. Landing this on
developfixes new stacks immediately andreaches the existing stacks when they next integrate
develop.one-line restore of each
branches:filter.Verification
python3 -c "import yaml; yaml.safe_load(...)"on both workflows — parsed,with
onresolving to{'pull_request': None}and{'pull_request_target': {'types': [...]}}pnpm exec prettier --check .github/workflows/ci.yml .github/workflows/pr-policy.yml— passedgh pr checks 1220andgh pr checks 1222each report onlycheck(the attribution guard), whilegh pr checks 1150, based ondevelop, reports the full setdevelop, so its own run exercises the changedci.ymltriggerwas performed locally for this diff
🤖 Generated with Claude Code