-
-
Notifications
You must be signed in to change notification settings - Fork 368
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: Add support to use threads instead of comments #1331
Conversation
Hey, this looks good to me from a read over it - I'm quite wary of this change being so substantial and only really having one test to ensure it doesn't break in the future. So, I'll give it a week to settle, if you can it'd be good to get some tests - if not, that's fine. |
Thanks, @orta, I've added some tests - there were none at all before for the GitLab.ts. I've also changed one key detail: danger will always delete its entire threads now, no matter the setting. Because I've noticed that you can simply turn danger's comments into threads by replying to them as another user. And that would leave the replies dangling if danger was then to remove its original comment. GitLab's discussions API doesn't distinguish between comments and threads. You will always get all comments wrapped in a discussion object from that API. |
Great, this looks good to me - I've given it a once over and will give it a second look and then merge soon! |
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.
Nice!
Thanks for the substantial PR! This has shipped as danger 11.2.0 |
|
This PR has broken thread reporting for us, using GitLab 15.3. Using danger 11.1.4 we still get both inline and global warnings. Using danger 11.2.0 or later, we only get global warnings, as they replace the body of the inline warnings. Full context available in #1351 |
Implementation
DANGER_GITLAB_USE_THREADS
is set to a value of1
ortrue
.GitLab API change
getMergeRequestDiscussions
fetches all the threads (discussions) of a merge requestcreateMergeRequestDiscussion
has had its second argument changed from being the position object to be the actual options object for that gitbreaker API call, which contains the position.Migration considerations