feat: allow autodiscover workspace override#6378
Open
kshcherban wants to merge 2 commits into
Open
Conversation
fixes runatlantis#6375 Signed-off-by: kshcherban <kostyantyn.shcherban@auto1.com>
Signed-off-by: kshcherban <kostyantyn.shcherban@auto1.com>
e8bf5d6 to
049fb25
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an optional workspace field to the autodiscover configuration (both repo-level atlantis.yaml and server-side repos.yaml) that allows users to specify a non-default Terraform workspace for all autodiscovered projects. This enables scenarios where separate Atlantis instances per workspace operate on a shared repository. The PR also fixes a pre-existing bug where repo-level ignore_paths in the autodiscover section was silently ignored.
Changes:
- Added
Workspacefield to autodiscover config with precedence: global config > repo-level config - Fixed bug where repo-level
ignore_pathswas bypassed when global config'sIgnorePathswas nil - Added comprehensive unit tests for workspace field and integration test demonstrating workspace + ignore_paths composition
- Updated documentation for both server-side and repo-level configurations
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| server/events/project_command_builder.go | Added workspace determination logic with proper precedence, fixed ignore_paths check to fall through to repo-level config |
| server/events/project_command_builder_test.go | Added integration test verifying workspace and ignore_paths work together |
| server/core/config/valid/autodiscover.go | Added Workspace field to the valid AutoDiscover struct |
| server/core/config/raw/autodiscover.go | Added Workspace field with YAML unmarshalling and passed through in ToValid() |
| server/core/config/raw/autodiscover_test.go | Added unit tests for Workspace field round-trip through YAML and ToValid() |
| runatlantis.io/docs/server-side-repo-config.md | Added documentation for workspace field |
| runatlantis.io/docs/repo-level-atlantis-yaml.md | Added documentation with examples showing workspace field |
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
repo-level config
why
tests
references
autodiscover#5324 (feature request for include_paths)