Skip to content

Atlantis merges the PR even when the "atlantis apply" fails. #4635

@snehalsn

Description

@snehalsn

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

We have noticed that there are instances where atlantis goes ahead with merging a PR in the event of an apply error which seems to be a bug in the system. Ideally, when the atlantis apply results in an error, it should not merge the PR.

Screenshot :
Screenshot 2024-06-06 at 2 43 41 PM

Reproduction Steps

  1. Raised the PR
  2. Ran atlantis plan which showed the expected changes.
  3. Ran atlantis apply . This resulted in the Apply Failed error stating "Pull request must be mergeable before running apply."
    It should have stopped at this stage on failure, however, atlantis went ahead and merged the PR.

Environment details

  • Atlantis version: v0.26.0
  • Atlantis flags:
Screenshot 2024-06-06 at 3 09 19 PM

Atlantis server-side config file: We use upstream server-side config

Repo atlantis.yaml file:

 - name: <project_name>
    dir: <directory_path>
    workspace: <workspace_name>
    terraform_version: "1.3.9"
    autoplan:
      when_modified: ["*.tf", "**/*.tf"]
      enabled: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions