Repository navigation
ci: run only affected integration targets - #549
Merged
Merged
Conversation
Narrow integration target selection so shared files no longer fan out to every target: - .github/integration-tests.json: select only targets added or edited relative to the manifest at the PR merge base; removed targets need no job, and a manifest missing at the base selects every registered target. - packages/<member>/pubspec.yaml: select the member's package plus every workspace package with a member that depends on it, directly or transitively, through dependencies or dev_dependencies. - Root pubspec.yaml alone selects nothing; pubspec.lock, .github/workflows/ and tool/ci/ still select every target. The CI validate job now fails when dart pub get changes pubspec.lock, so a resolution change cannot skip targets through an uncommitted lockfile.
Pushes to main now diff github.event.before...github.sha with the same rules as pull requests instead of running every target. When the pushed base cannot be diffed (new branch with an all-zero SHA, or a force push whose previous tip is no longer in the history), the selector falls back to every target. A weekly schedule keeps a full regression run, and workflow_dispatch still runs every target. Only pull request runs share a concurrency group now: with narrowed push runs, a pending run on main that a later push replaced would leave its changes untested.
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.
Summary
pull_requestbase.sha...head.shapushto mainbefore...sha; all targets ifbeforeis all zeros or not in historyschedule(weekly, Sun 19:23 UTC)workflow_dispatchOnly PR runs share a concurrency group now (
pull_request.number || run_id), so a pending main run is never replaced and its pushed changes skipped.ci.ymlvalidate job now fails ifdart pub getchangespubspec.lock.Evidence
6e2b29c...11d9c44), origin/main script, run in a checkout of the word_segmenter: rename string_tokenizer and segment words on every platform #548 head — 10 targets:breakpad_clientwindows/linux,desktop_dropweb,desktop_webview_windowwindows/macos/linux,word_segmenterwindows/macos/linux/webAfter: same checkout with this script — 4 targets:
word_segmenterwindows/macos/linux/webb13faba..964c1c3(desktop_drop 0.9.2 release, onlypackages/desktop_drop/pubspec.yaml+CHANGELOG.md) — push events passed no base, so all 6 targets ran (run 39426159620); the origin/main script given that diff also selects all 6 (package pubspec rule)After:
--base b13faba --head 964c1c3— 1 target:desktop_dropweb6e2b29c..b13faba(fix(desktop_drop): stop Flutter's false KGP warning with built-in Kotlin #547 merge) — all 6 targets (push without base)After:
--base 6e2b29c --head b13faba— 1 target:desktop_dropweb--base 0000000000000000000000000000000000000000printsCannot diff from ...; selecting all targets.and selects all 6.python3 -B -m unittest discover -s tool/ci -p 'test_*.py' -v: 16 tests OK (manifest diff, missing manifest at base and merge-base comparison, package pubspec + transitive dependents, real workspacemixin_loggerdependents, pubspec parser, push fallback for all-zero/missing base, workflow arguments per event; rootpubspec.yamlselects nothing,pubspec.lock/workflow select all)dart pub geton clean origin/main (Flutter 3.47.7 stable) leavespubspec.lockunchanged.Merge Danger
Door: two-way
Blast Radius: ci
Main pushes no longer run the full suite: a target broken by something outside its package and the rules above (or a flaky target left failing) is only caught by the weekly
schedulerun, which is the safety net. A resolution change pushed without its updatedpubspec.lockwould skip unrelated targets; the new lockfile check inci.ymlcatches that. If a new Flutter stable changes SDK-pinned versions, that check fails on every PR untilpubspec.lockis refreshed. Thescheduletrigger only takes effect after merge to the default branch.