Repository navigation
feat: add --include-dependents to auto-scope - #108
Merged
Merged
Conversation
Add an opt-in `--include-dependents` flag to `plan` and `apply` that expands the `--auto-scope` selection with every group that imports, directly or transitively, from a selected group. Without it, a change to a producer group left its consumers out of the run, so stale inputs could go unnoticed. The flag requires `-A`, and is not offered on `destroy`, `docs` or `migrate`.
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.
🧑💻 What is the change being made?
Adds an opt-in
--include-dependentsflag toterranova planandterranova apply. After--auto-scoperesolves the changed groups, the selection is expanded with every group that imports from them, directly or transitively. The closure is a pure function ingraph.py(with_dependents), exposed to commands throughexpand_with_dependentsincommands/helpers.py. The flag requires-Aand fails with a usage error otherwise.destroy,docsandmigratedon't get it.❓ Why is the change being made?
When a producer group changed, groups consuming its outputs through
importswere left out of the run. Their plans could be stale without anyone noticing. This was the last gap listed in #103, after the shared-file mapping (#104) and--base(#105).✅ How has this been tested?
TestWithDependents): transitive importers, sources not included, empty roots.expand_with_dependents, parametrized over a changed producer, consumer, chained group and unrelated group, plus an empty selection.plan -A --include-dependentsadds the importing group and orders producer before consumer. Bothplanandapplyreject the flag without-A.ruffandbasedpyrightpass.📚 How has this been documented?
Updated the "How to scope a run to what changed" section of the README with the flag, its plan/apply-only scope, and an example:
terranova plan -A --base origin/main --include-dependents.🔗 Related Issues
Closes #103.