Skip to content

Conversation

@geoff-kruss
Copy link

what

Adds support for squash merging in GitLab merge requests when using Atlantis automerge functionality. Previously, GitLab automerge was limited to regular merge commits, causing failures in repositories that enforce squash-only commit policies.

why

Many organizations enforce squash commit policies on their main branches to maintain clean git history. When using Atlantis automerge with GitLab, the default merge behavior would fail with these policies, preventing automated merging of Terraform changes.

This implementation enables repositories with squash-only policies to benefit from Atlantis automerge functionality by supporting the merge_method: squash configuration option.

tests

  • Added comprehensive test coverage for GitLab squash merge functionality
  • Existing GitHub merge method tests continue to pass
  • All GitLab VCS client tests pass
  • Automerge integration tests pass
  • Tested locally with both squash and regular merge methods

references

@dosubot dosubot bot added feature New functionality/enhancement go Pull requests that update Go code provider/gitlab labels Nov 1, 2025
@github-actions github-actions bot added docs Documentation provider/azuredevops and removed feature New functionality/enhancement labels Nov 1, 2025
@geoff-kruss geoff-kruss force-pushed the feat-gitlab-squash-merge-support branch 2 times, most recently from a96a020 to e84d749 Compare November 1, 2025 23:25
@geoff-kruss geoff-kruss force-pushed the feat-gitlab-squash-merge-support branch from e84d749 to 30fd71e Compare November 1, 2025 23:32
- Add merge method support to GitLab client for squash merging
- Parse merge method from PullRequestOptions in DiscardReviews and MergePull
- Map 'squash' merge method to GitLab API squash parameter
- Add comprehensive test coverage for merge method handling
- Follow established GitLab client test patterns with json.NewDecoder
- Update documentation to reflect GitLab squash merge support

Fixes runatlantis#5415

Signed-off-by: geoff-kruss <[email protected]>
@geoff-kruss geoff-kruss force-pushed the feat-gitlab-squash-merge-support branch from 30fd71e to a2c43c0 Compare November 4, 2025 15:33
@chenrui333 chenrui333 requested a review from lukemassa November 12, 2025 13:04
@LeeDongon
Copy link

waiting for it

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 23, 2025
@jamengual
Copy link
Contributor

@geoff-kruss could you check the lint errors and the tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation go Pull requests that update Go code lgtm This PR has been approved by a maintainer provider/azuredevops provider/gitlab

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants