Skip to content

Bug: Atlantis v0.38 no longer does a new merge before plan when the branch commit hasn't changed #6023

@peikk0

Description

@peikk0

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 set ATLANTIS_CHECKOUT_STRATEGY=merge so that all Terraform plans include the latest changes from the main branch.

Since v0.38 Atlantis no longer does a new merge if the branch hasn't changed and new commits have been added to the main branch since the initial plan, resulting in a plan reverting the latest changes from the main branch.

I suspect this bug was introduced in #6005

Reproduction Steps

  • Open a PR/MR for a new branch
  • Run atlantis plan
  • Add commits to the main branch with new Terraform changes
  • Run atlantis plan again in the PR/MR without rebasing or adding commits
  • Observe the plan reverting the changes added to the main branch

Logs

Logs
{"level":"debug","ts":"2025-12-12T01:45:02.544Z","caller":"events/working_dir.go:111","msg":"clone directory '/atlantis-data/repos/foo/bar/123/default' already exists, checking if it's at the right commit","json":{"repo":"foo/bar","pull":"123"}
{"level":"debug","ts":"2025-12-12T01:45:02.547Z","caller":"events/working_dir.go:317","msg":"Comparing PR ref \"49a02aaa8ad79b8eef185ababe9aeab99c8f558b\" to local ref \"49a02aaa8ad79b8eef185ababe9aeab99c8f558b\"","json":{"repo":"foo/bar","pull":"123"}}
{"level":"info","ts":"2025-12-12T01:45:02.547Z","caller":"events/working_dir.go:119","msg":"repo is at correct commit \"49a02aaa8ad79b8eef185ababe9aeab99c8f558b\" so will not re-clone","json":{"repo":"foo/bar","pull":"123"}}

Environment details

Atlantis v0.38

ATLANTIS_CHECKOUT_STRATEGY=merge

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions