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

fix: dont set commit status for old commits to new pipelines #4784

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fitz7
Copy link
Contributor

@fitz7 fitz7 commented Jul 25, 2024

what

Stop Atlantis from updating the status of the wrong commit in GitLab

why

In Gitlab when a new commit was pushed while Atlantis was still running on a previous commit Atlantis would update the status of the wrong commit. This sometimes lead to merge requests not being mergeable by Atlantis as some of the statuses would be incorrect.

These changes prevent Atlantis from updating the status by returning early when mr.HeadPipeline.SHA != pull.HeadCommit

tests

We've been running our own Atlantis with these changes for about a month. Have also included a test to ensure that the update status request is never made

@fitz7 fitz7 requested review from a team as code owners July 25, 2024 10:30
@fitz7 fitz7 requested review from chenrui333, lukemassa and nitrocode and removed request for a team July 25, 2024 10:30
@github-actions github-actions bot added go Pull requests that update Go code provider/gitlab labels Jul 25, 2024
@chenrui333 chenrui333 added the bug Something isn't working label Jul 25, 2024
chenrui333
chenrui333 previously approved these changes Jul 25, 2024
Copy link
Member

@chenrui333 chenrui333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

lukemassa
lukemassa previously approved these changes Aug 8, 2024
@fitz7
Copy link
Contributor Author

fitz7 commented Aug 8, 2024

thanks @lukemassa @chenrui333 !

I had to fix a few conflicts, but all good now

@rgs1
Copy link

rgs1 commented Aug 21, 2024

Somewhat related:

#4865

@jamengual
Copy link
Contributor

Somewhat related:

#4865

isn't this the same as your PR @rgs1 ?

can we collaborate on this PR instead?

@rgs1
Copy link

rgs1 commented Aug 22, 2024

Ah yes, similar... hmm let me compare this to what my PR is doing.

@rgs1
Copy link

rgs1 commented Aug 22, 2024

Ok they are pretty much the same, except that this one will return earlier which is probably better than looping for longer and defaulting to setting refTarget (which should already be set).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue is a duplicate of an already reported issue go Pull requests that update Go code provider/gitlab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants