-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add pre and post workflow hook status #2441
feat: Add pre and post workflow hook status #2441
Conversation
Still need to work on tests for this 😅 |
Nice job @Fabianoshz ! I'd love tests and I'd love to see the stdout output via the details link like we can for the terraform plan/applies. |
Hi @nitrocode, I'll start writing tests for this, about the stdout output maybe on a separated PR? I'm still familiarizing myself with Atlantis code base. |
A separate pr would be okay i suppose but in the mean time it would break consistency with what we currently have for the atlantis plan and apply workflows which do expose a details link. If you go the separate pr route, please do not forget to add and test that functionality or we may have to revert the pr. Thoughts? @runatlantis/maintainers |
maybe keep it in the same PR since they will be related? |
It would be nice too if the status of the pre and post workflows is modifiable like @albertorm95 is attempting in pr #2699. that pr will parae the output because the output is standard but in the case of pre and post workflows, there can be any script run, so it would be nice if we could set it to be a custom regex in the yaml to parse the output to bubble it up as the status. But of course this is just a bonus. |
I'll look how to add stdout to the status link in this PR, I've messed around with the code base enough to fell confident about trying this. @nitrocode I will try to add a way of setting the status too, I'm unsure about the regex though, what do you think about passing an environment variable to the command, expecting the user to push the output it wants to the variable and then we expose it later? Regex might break in ways user might not expect, also it would be harder for them to test things. |
@nitrocode Didn't managed to use a environment variable, instead I've passed an env with a filepath to the command so it can send the status to it. I just need to check the string size limit for this before sending it to the VCS client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR, just some nitpicks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fabianoshz when you have some time, resolve the discussions/feedback
otherwise it looks good to me
@runatlantis/maintainers ready for a second review 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@Fabianoshz nice job! This will be very helpful in the next release. Thanks for the additional set of eyes @krrrr38 and @GenPage ! |
Hey, this is a great feature. Thanks! |
Currently when a pre or post workflow hook is running there's no indication to the user. When running a lengthy task like using terragrunt-atlantis-config on a big repository a PR may stay a long time without any return.
This tries to help users (especially those with low experience) to identity the current status of the operation.