Skip to content
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

Allow pre-workflow hook failures to stop workflows executing #2648

Closed
1 task done
coderigo opened this issue Nov 8, 2022 · 0 comments · Fixed by #3729
Closed
1 task done

Allow pre-workflow hook failures to stop workflows executing #2648

coderigo opened this issue Nov 8, 2022 · 0 comments · Fixed by #3729
Labels
feature New functionality/enhancement

Comments

@coderigo
Copy link

coderigo commented Nov 8, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Describe the user story

A clear and concise description of what workflow is meant to be improved.
Pre-workflow hook scripts we run perform some custom inspection of PR state using the Gitlab API and we want to optionally halt atlantis locking and workflows kicking off if a pre-workflow hook returns a non-zero exit code.

Describe the solution you'd like

A clear and concise description of what you want to happen. Consider that atlantis is used
by many people, and your particular use case might not make sense to implement in the core.

Simply allow this:

repos:
  - id: xxx
    pre_workflow_hooks:
      - run: /some/script.sh 
        must_succeed: true # defaults to false if omitted

This sort of thing we hope prevents atlantis locking pull requests that we know ahead of time aren't fit for atlantis's attention.

Describe the drawbacks of your solution

must_succeed makes less sense in a post_workflow hook so in the code this distinction must be made clear.

Describe alternatives you've considered

Considered a workflow generator script, but adds a lot of complexity and not as flexible as addint a must_succeed arg to a given pre-workflow hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality/enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants