runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.68k stars 1.05k forks source link

Azure DevOps: Autoplan changes and PR screen changes can be different #1046

Open jpreese opened 4 years ago

jpreese commented 4 years ago

When using Atlantis with Azure DevOps, Atlantis uses a different approach to calculate the diff than what the user sees in the portal. Currently the GetModifiedFiles implementation does the following: https://github.com/runatlantis/atlantis/blob/master/server/events/vcs/azuredevops_client.go#L56

This can cause unexpected results when viewing the changes in the "Files" tab on the PR screen, and what atlantis plan outputs. Especially when a merge commit is the HEAD commit.

After some investigation, it looks like the diffs/commits endpoint closely mimics the actual changes to be expected when opening a PR (https://docs.microsoft.com/en-us/rest/api/azure/devops/git/diffs/get?view=azure-devops-rest-5.1)

lkysow commented 4 years ago

Cc @mcdafydd