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

Unable to apply MR after requirements failure #2135

Closed
michelmzs opened this issue Mar 12, 2022 · 0 comments
Closed

Unable to apply MR after requirements failure #2135

michelmzs opened this issue Mar 12, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@michelmzs
Copy link
Contributor

michelmzs commented Mar 12, 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.

Overview of the Issue

Atlantis cannot apply when a failure occurs due to lack of apply_requirements, even if the requirements have been met after.
In this case, the mergeable requirement always fails because one of the apply jobs in the pipeline failed (apply without approvers).

VCS Details

  • VCS: GitLab
  • Project Settings:
    • Protected branches -> Code owner approval (main)
    • Merge requests -> Pipelines must succeed

Reproduction Steps

  1. Run atlantis apply without approvers on the merge request
  2. Expected error: Apply Failed: Pull request must be approved by at least one person other than the author before running apply.
  3. Approve the merge request
  4. Run apply again
  5. Unexpected error: Apply Failed: Pull request must be mergeable before running apply.
  6. Run plan
  7. For any new apply on this MR: Apply Failed: Pull request must be mergeable before running apply.

Logs

There is no error in the logs

Environment details

  • Atlantis version: Problem started on v0.18.0, still occurs on latest

Atlantis server-side config file:

ATLANTIS_AUTOMERGE: true

Atlantis repo-side config file:

---
repos:
  - id: /.*/
    apply_requirements:
      - approved
      - mergeable
    delete_source_branch_on_merge: true

Additional Context

@michelmzs michelmzs added the bug Something isn't working label Mar 12, 2022
@michelmzs michelmzs changed the title Deadlock condition - Unable to apply MR after apply requirements failure Unable to apply MR after requirements failure Mar 12, 2022
jamengual pushed a commit that referenced this issue May 16, 2022
* fix: update commit status check logic to match the commit status name

* Update server/events/vcs/gitlab_client.go

chore: simplify ignored statuses logic

Co-authored-by: Emil 'Skeen' Madsen <sovende@gmail.com>

* feat(gitlab_client_test): add PullIsMergeable test case

Co-authored-by: Emil 'Skeen' Madsen <sovende@gmail.com>
krrrr38 pushed a commit to krrrr38/atlantis that referenced this issue Dec 16, 2022
…ntis#2137)

* fix: update commit status check logic to match the commit status name

* Update server/events/vcs/gitlab_client.go

chore: simplify ignored statuses logic

Co-authored-by: Emil 'Skeen' Madsen <sovende@gmail.com>

* feat(gitlab_client_test): add PullIsMergeable test case

Co-authored-by: Emil 'Skeen' Madsen <sovende@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant