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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rerunning a plan or running an apply should set atlantis/post_workflow_hook to pending #3007

Open
nitrocode opened this issue Jan 19, 2023 · 1 comment
Labels
bug Something isn't working hook

Comments

@nitrocode
Copy link
Member

nitrocode commented Jan 19, 2023

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.

Overview of the Issue

Rerunning a plan or running an apply should set atlantis/post_workflow_hook to pending

This issue may also affect atlantis/pre_workflow_run

Reproduction Steps

  1. Open a PR
  2. Run atlantis plan
  3. Rerun atlantis plan
  4. Notice that the atlantis/post_workflow_hook is stuck in "succeeded" instead of going to "pending"

Logs

N/A

Environment details

  • Atlantis version: 0.22.3

Atlantis server-side config file:

repos:
  - id: /.*/
    apply_requirements:
      - mergeable
      - approved
    workflow: terraform
    post_workflow_hooks:
      - run: |
          echo "Post workflow run completed successfully"

Additional Context

The only way to know it is a different run is due to the job id changing in the URL.

@nitrocode nitrocode added bug Something isn't working hook labels Jan 19, 2023
@Fabianoshz
Copy link
Contributor

Hi @nitrocode, I tried to reproduce this and I got this behaviour:

  • Rerun plan;
  • Post/pre workflow hooks initially stays at succeeded since it was the last update;
  • When reaching the pre workflow phase each workflow changes to pending, then to succeeded again;
  • Same for post workflow.

If your pre/post workflow hooks are being executed really fast (like when using an echo) you're not going to see the status being updated to pending because github (or other VCS client) will receive 2 updates in a very short time. You can test using a sleep command.

What we can do is to change the current implementation to reset every pre/post workflow even before running the received command, this would set every workflow to pending even before running the first command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hook
Projects
None yet
Development

No branches or pull requests

2 participants