Repository navigation
fix: select groups depending on changed shared files in --auto-scope - #104
Merged
Merged
Conversation
A change below the shared directory was dropped because it is outside every resource group. Map it to the groups whose manifest dependencies reference it, matching directory sources by prefix.
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?
--auto-scopenow selects every resource group whose manifestdependenciesreference a changed file undershared/. A dependencysourcethat is a directory matches any file inside it. The matches are merged with the existing path-ancestry matches, so a group changed both directly and through shared is selected once. Manifests are only read when at least one changed file is belowshared/.❓ Why is the change being made?
--auto-scopemapped each changed file to its nearest ancestor directory containing amanifest.yml. Files inshared/sit outside every resource group, so they were silently dropped: editing a shared provider file madeterranova plan -Aselect nothing, even though every group symlinking it was affected, and a CI job would pass without planning anything.✅ How has this been tested?
Added four integration tests in
tests/it/test_helpers.py(TestAutoScopeSharedDependencies) using real git repositories: a changed shared file selects all dependent groups, a directory source matches by prefix, an unreferenced shared file selects nothing, and a group changed directly and through shared is listed once. The fulltests/itsuite passes (371 tests), andruffandbasedpyrightare clean on the changed files.📚 How has this been documented?
Added a bullet to the "How to scope a run to what changed" section of the README describing the shared-directory behavior. The
auto_scope_resource_dirsdocstring was updated as well.🔗 Related Issues
Partially addresses #103 (shared-file case only). The
--base <ref>option and opt-in dependents expansion described there are not part of this PR, so the issue stays open.