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

Gitlab lock error message refers to issue instead of MR #948

Closed
sarcasticadmin opened this issue Mar 17, 2020 · 3 comments · Fixed by #1059
Closed

Gitlab lock error message refers to issue instead of MR #948

sarcasticadmin opened this issue Mar 17, 2020 · 3 comments · Fixed by #1059
Labels
bug Something isn't working help wanted Good feature for contributors provider/gitlab

Comments

@sarcasticadmin
Copy link

Description

Gitlab has a separate identifier and counter for issues (represented by "#") vs merge requests (represented by "!") in comments. This is unlike Github were the issues and pull requests have the same identifier (represented by "#") and counter. Currently in Gitlab if one terraform root directory is locked by a plan and another MR comes in for the same root directory Atlantis response with the lock message but it points to an issue ("#") instead of the actual MR ("!"). As seen by the following screenshot:
Screen Shot 2020-03-17 at 4 08 45 PM

The good new is the MR number is correct but it appears that the string formatting in the error is just assuming #: https://github.com/runatlantis/atlantis/blob/master/server/events/project_locker.go#L66

Expected Behavior

  • Lock message would show !199 instead of #199 for Gitlab

System Info

$ atlantis version
atlantis 0.10.2
@lkysow lkysow added the bug Something isn't working label Mar 17, 2020
@lkysow
Copy link
Member

lkysow commented Mar 17, 2020

Nice find, want to create a fix?

You'll need to change the signature of TryLock to also accept a VCSHostType argument, then pass this in from where it gets called and then change the TryLock function to detect if it's GitLab and use a different reference string.

@lkysow lkysow added the help wanted Good feature for contributors label Mar 17, 2020
@sarcasticadmin
Copy link
Author

@lkysow sure Ill give it a go, thanks for providing info on the approach

@sarcasticadmin
Copy link
Author

@mcdafydd @EppO thanks for knocking this out! Hadnt had a chance to dive into it but looking forward to testing this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Good feature for contributors provider/gitlab
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants