Repository navigation
fix(affected): keep a project's own files when its dependency also changed - #100
Merged
Merged
Conversation
…anged --only-affected-files ran a project in full whenever a project it depends on changed in the same diff, with or without --dependents. Without --dependents the run is about each project's own change: a project that only depends on the change is not selected at all, so one that also has a changed file of its own now runs on that file. A commit touching two related projects no longer turns the dependent's check into its whole suite. Under --dependents nothing changes: the project answers for the dependency's change, which its own file list does not describe, and runs in full. --related still runs the tests that reach the dependency. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
aster affected <target> --only-affected-files(no--dependents) ran a project in full whenever a project it depends on changed in the same diff. In a private polyglot monorepo that uses this command as a pre-commit check, a commit touching a service and a tool it depends on turned a three-file test run into the service's whole suite (about 10,000 tests, 20 minutes). Replaying one contributor's recent commits, about three in four of those that touched the service ran it in full for this reason.Change
--dependents, where the project answers for the dependency's change and its own file list does not describe it.--dependents, the run is about each project's own change. A project that only depends on the change is not selected at all, so one that also has a changed file runs on that file.--relatedis unchanged and remains the way to run the tests that reach a dependency's change.This reverses part of 9414575 ("run more, never skip"), which applied the full run with or without
--dependents.Trade-off
Without
--dependents, tests in the dependent that exercise the changed dependency no longer run unless they changed too. That matches what the flag combination already did for a dependent with no changed file of its own (not run at all).Tests
test_only_affected_files_keeps_its_own_files_when_a_dependency_also_changed(new, failed before the change)test_only_affected_files_with_dependents_runs_in_full_when_a_dependency_also_changed(the old behaviour, now pinned to--dependents)cargo test,cargo clippy --all-targets,cargo fmt --checkpass.README and the bundled skill text are updated.
🤖 Generated with Claude Code