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(gitlab_client): prevent duplicate pipelines in gitlab merge requests #2745

Merged
merged 6 commits into from
Dec 7, 2022

Conversation

michelmzs
Copy link
Contributor

What

Add instructions to SetCommitStatus to avoid duplicate pipelines in GitLab Merge Requests.

Why

GitLab pipeline can have multiple sources, the common usage for Atlantis are:

  • merge_request_event source
    When a gitlab-ci.yaml rule enforces its creation
  • external source
    When no job is defined in gitlab-ci.yaml.

References

closes #2743

@michelmzs michelmzs marked this pull request as ready for review December 5, 2022 01:59
@michelmzs michelmzs requested a review from a team as a code owner December 5, 2022 01:59
@michelmzs michelmzs marked this pull request as draft December 5, 2022 02:03
@michelmzs michelmzs marked this pull request as ready for review December 5, 2022 02:16
@nitrocode
Copy link
Member

@michelmzs were you able to build this and test this out in your setup?

Copy link
Member

@nitrocode nitrocode left a comment

Choose a reason for hiding this comment

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

I'm a fan of merging provided that this has been tested in the author's gitlab environment.

@michelmzs
Copy link
Contributor Author

michelmzs commented Dec 7, 2022

@michelmzs were you able to build this and test this out in your setup?

Yes, please take a look @nitrocode:

@nitrocode
Copy link
Member

Great thank you @michelmzs !

cc: @jamengual please review one last time

@nitrocode nitrocode requested a review from jamengual December 7, 2022 16:28
@jamengual
Copy link
Contributor

Thanks you @michelmzs

@jamengual jamengual merged commit c800f70 into runatlantis:main Dec 7, 2022
krrrr38 pushed a commit to krrrr38/atlantis that referenced this pull request Dec 16, 2022
…sts (runatlantis#2745)

* fix(gitlab_client): change CommitStatus update logic to prevent duplicated pipelines in MRs

* chore: refactor refTarget logic

* chore: fix tests

* chore: fix lint

* chore: remove nested if
@nitrocode nitrocode added this to the 0.22.0 milestone Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Atlantis 0.21.x cause duplicate pipelines in Gitlab
3 participants