ci(workflows): run CI and PR policy on every base branch - #1257
Closed
Harry19081 wants to merge 1 commit into
Closed
ci(workflows): run CI and PR policy on every base branch#1257Harry19081 wants to merge 1 commit into
Harry19081 wants to merge 1 commit into
Conversation
The `branches: [develop, release, master]` filter on ci.yml and pr-policy.yml meant a pull request targeting any other branch matched no trigger at all. Stacked pull requests -- #1220 into junyu/mobile-remote-control, #1222 into junyu/ios-remote-shared -- ran neither, so typecheck, lint, vitest, clippy and the PR contract were author-reported only; the sole check on them was Check AI attribution, which is base-branch-agnostic by accident rather than by design. Drop the filter from both. ci.yml's `changes` job already scopes cost to the diff, and a stacked pull request's base..head diff is the increment alone.
Collaborator
|
Closing as superseded by #1258, which implements the same all-base CI and PR-policy trigger change and has been merged. |
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.ymlandpr-policy.ymlboth filtered their triggers tobranches: [develop, release, master]. A pull request whose base is any otherbranch therefore matched no trigger at all — the workflows never queued, so
nothing was skipped, cancelled, or reported; they simply did not exist for that
pull request.
Stacked pull requests are exactly that case. #1220
targets
junyu/mobile-remote-controland #1222targets
junyu/ios-remote-shared, so both ran zero CI.gh pr checkson eachreturns a single entry:
That is
check-ai-attribution.yml, which is base-branch-agnostic by accident —it declares a bare
pull_request:because it was written as a history guard,not as a CI entry point. Neither CI nor the PR contract ran. Typecheck,
lint, vitest, clippy, and PR-policy compliance on those two pull requests are
author-reported only.
15 of the 51 currently open pull requests target a non-
developbase and are inthe same position.
Solution
Delete the
branches:filter from both workflows, sopull_request/pull_request_targetfire for every base branch. Each file carries a commentrecording why the filter must not come back.
Cost is already bounded per-diff rather than per-branch, and stacking makes that
bound tighter rather than looser:
ci.yml'schangesjob scopes onbase.sha...head.sha, which for a stacked pull request is the increment overits parent branch, not the whole feature. Measured against the two real diffs
with the repo's own detectors:
rust_requiredaudit_requiredfalsefalsefiles(32)falsefalseall(touchespackage.json)truefalseskipSo #1220 costs one Linux frontend job and allocates no macOS runner. The
existing per-PR
concurrencygroup withcancel-in-progress: truekeys ongithub.event.pull_request.number, so it already de-duplicates pushes on thesepull requests too.
Potential risks
push to any of the ~15 non-
develop-based pull requests now buys a frontendjob (~11m41s on Linux, per the 2026-08-28 measurements) and, whenever the
increment touches
src-tauri/, themacos-latestclippy + workspace-test jobthat is billed at 10× Linux. The per-diff scoping above limits the common
case; it does not cap the aggregate.
pull_request_target's trust anchor is now weaker.pr-policy.ymlchecks out
github.event.pull_request.base.shaas "trusted policy" andexecutes
scripts/ci/pr-policy.cjsfrom it. With the filter gone, that basecan be any branch, including one whose author edited that script — it is no
longer guaranteed to be a protected branch. Blast radius stays small: pushing
a branch to this repository requires write access, the job's token is
contents: read+pull-requests: read, and the checkout setspersist-credentials: false. If that is judged too loose, the follow-up is topin the checkout to the repository's default branch instead of
base.sha.the filter was hiding rather than on anything this change introduces. Branch
protection covers only
develop/release/master, so a failing check on apull request into a feature branch is informational and blocks no merge.
descriptions were never written against it, so some will fail
Enforce PR contractuntil updated.scripts/ci/detect-rust-changes.cjsscopes Rust on the
src-tauri/prefix, so feat(mobile-remote): add Tauri iOS shell #1222's newapps/remote-ios/src-tauri/crate and its
Cargo.lockreportrust_required=falseeven after this change— and the
rustjob'sworking-directory: src-tauriwithcargo clippy --workspacewould not cover a second Cargo workspace anyway. Making CI buildthe iOS crate is real work that belongs to that stack, not to a trigger fix.
Verification
Ran, on this branch's exact diff:
node --test scripts/ci/*.test.cjs— 28 pass, 0 fail (the CI policyhelpers this workflow invokes).
intended and nothing else moved:
ci.yml -> {"pull_request": null}(all activity types, all base branches);pr-policy.yml -> {"pull_request_target": {"types": [opened, edited, reopened, synchronize, ready_for_review, converted_to_draft]}};job lists unchanged (
changes, frontend, rust, cargo-auditandenforce).lists (
gh pr view --json files) throughdetect-rust-changes.cjs,detect-audit-changes.cjs, andselect-lint-targets.cjs.gh pr checks 1220/gh pr checks 1222before the change, which is theevidence for the Problem section above.
Did not run, and why:
actionlint— not installed on this machine. The YAML was parsed instead, asdescribed above.
source change. This pull request's own diff scores
rust_required=true(
.github/workflows/is a Rust-relevant prefix by design), so CI on this pullrequest will run the full frontend job and the macOS clippy + workspace-test
job, and that run is the real evidence.
(temporary index) because the shared checkout holds another session's
uncommitted work. No
Pre-commit hook ran.trailer, andlint-stageddid notformat anything — neither matters for a YAML-only diff, which
select-lint-targets.cjsreports aslint_mode=skip.The claim this change actually makes cannot be proved before merge, since a
workflow trigger is read from the base branch. Post-merge check: push to (or
reopen) #1220 and confirm
Frontend (typecheck · lint · test)andEnforce PR contractattach to it.🤖 Generated with Claude Code