Skip to content

fix(affected): keep a project's own files when its dependency also changed - #100

Merged
calvin-archastro merged 1 commit into
mainfrom
fix/only-affected-files-own-files
Oct 9, 2026
Merged

calvin-archastro merged 1 commit into
mainfrom
fix/only-affected-files-own-files

Conversation

@calvin-archastro

Copy link
Copy Markdown
Contributor

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

  1. The full run now applies only under --dependents, where the project answers for the dependency's change and its own file list does not describe it.
  2. 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 runs on that file.
  3. --related is 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 --check pass.

README and the bundled skill text are updated.

🤖 Generated with Claude Code

…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>
@calvin-archastro
calvin-archastro requested a review from a team October 9, 2026 22:19
@calvin-archastro
calvin-archastro merged commit 2c24182 into main Oct 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant