pre_workflow_hooks scope only works on the default workspace #2538
Labels
feature
New functionality/enhancement
needs discussion
Large change that needs review from community/maintainers
Stale
Community Note
Describe the user story
Pre workflow hooks happen before any atlantis.yaml file is parsed and they are generally used to generate atlantis.yaml files dynamically which work in that case since the generated
atlantis.yaml
file is parsed on the default workspace, but if you generate an atlantis.yaml file that uses a different workspace any run command that tries to generate other files on the fly will work but save the files within the default workspace dir instead of the one that will be used in the generated atlantis.yaml file.atlantis/server/events/pre_workflow_hooks_command_runner.go
Line 50 in 485c4b5
a server side repo config like this :
will save all generated files on the repo dir structure inside the atlantis dir like so:
.atlantis/repos/jamengual/atlantmos/1/default\
and the DefaultWorkspace = `default.
Describe the solution you'd like
it will be ideal if the pre_workflow_hooks can allow for the selection of the $WORKSPACE dir instead of assume the default workspace will be used
for example:
or any other way that makes it easier to define and use.
Describe the drawbacks of your solution
This could potentially require changes to how the
atlantis.yaml
file could be parsed when generated dynamically or at the very least updated documentation explaining how this happens so the user is aware that the default workspace must be used for the parsing of the atlantis.yaml file.The text was updated successfully, but these errors were encountered: