-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: Enable discard-approval-on-plan for gitlab #5388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @moritz31, thanks for raising this PR.
Can you update the documentation at https://github.com/runatlantis/atlantis/blob/main/runatlantis.io/docs/server-configuration.md#--discard-approval-on-plan also detailing the GitLab token requirements.
Please also update the PR title and description to say that this change is enabling the discard-approval-on-plan
feature for GitLab (The PR title is used for the Atlantis changelog entry)
Hope this now fits, need to make some bigger adjustments because of no logger passed to that method. |
Looking good @moritz31. The tests are failing if you could take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @moritz31
Can you test that this is working correctly for you using one of these dev container images: |
Thanks for your guidance! I have tested the alpine container in our live environment and it works like expected |
what
This pull request enables
discard-approval-on-plan
for gitlab.why
This enables a use case for me, which is already covered by atlantis but only for github.
tests
Adding a test with testcases in gitlab_client_test.go TestGithubClient_DiscardReviews.
Running the stack locally and testing from gitlab that the pull request approval is revoked.
references
Gitlab API Documentation https://docs.gitlab.com/api/merge_request_approvals/#reset-approvals-of-a-merge-request