Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Add ignore path to autodiscover using glob #5267

Merged

Conversation

lukemassa
Copy link
Contributor

@lukemassa lukemassa commented Jan 23, 2025

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

@lukemassa lukemassa requested review from a team as code owners January 23, 2025 21:55
@lukemassa lukemassa requested review from chenrui333, nitrocode and X-Guardian and removed request for a team January 23, 2025 21:55
@dosubot dosubot bot added feature New functionality/enhancement go Pull requests that update Go code labels Jan 23, 2025
@github-actions github-actions bot added docs Documentation dependencies PRs that update a dependency file labels Jan 23, 2025
Signed-off-by: Luke Massa <lukefrederickmassa@gmail.com>
@lukemassa lukemassa force-pushed the add_ignore_path_to_autodiscover_glob branch from c69a3c2 to 684f766 Compare January 23, 2025 22:00
@lukemassa lukemassa changed the title Add ignore path to autodiscover using glob feat: Add ignore path to autodiscover using glob Jan 23, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 23, 2025
@lukemassa
Copy link
Contributor Author

@chenrui333 you had approved #5254, @nitrocode and I prefer this alternative, any concerns?

@nitrocode
Copy link
Member

No concerns from me. I also prefer this alternative.

@lukemassa lukemassa merged commit 7bc3337 into runatlantis:main Jan 23, 2025
41 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
dependencies PRs that update a dependency file docs Documentation feature New functionality/enhancement go Pull requests that update Go code lgtm This PR has been approved by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants