feat: Add ignore path to autodiscover using glob #5267
Merged
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
Add ability to ignore paths in auto-discovery using filepath "glob" matching.
An alternative to #5254, which uses regexes instead of globs.
why
It's useful to allow certain directories to be auto discovered, but leave other areas of a repo for explicit configuration.
To the regex vs glob question, the glob implementation feels a little easier to read and work with. We can always additionally support regexes by surrounding them with
/
(I have this currently error in the code so we can make this backwards compatible change in the future).Also, I looked at a few other vendors: the first two support globs, the third doesn't support this kind of configuration at all, so it felt like globs was a better way to go.
https://docs.spacelift.io/concepts/stack/stack-settings#project-globs
https://docs.env0.com/docs/environment-discovery#configure-the-environment-mapping
https://docs.terrateam.io/advanced-workflows/modules-and-automatic-discovery/
tests
Added some unit tests
references