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
Add thread support for GitLab #1140
Conversation
Any activities here? I could need that one :O |
this.repoMetadata.pullRequestID, | ||
discussionId, | ||
noteId, | ||
// @ts-ignore |
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.
Hello Shym
I got a question, Why you need this ts-ignore here?
There is any cast issue with body property?
const { id: dangerUserId } = await this.api.getUser() | ||
const threads = await this.api.getMergeRequestThreads(); |
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.
This could be resolved with Promise.all
const { id: dangerUserId } = await this.api.getUser() | |
const threads = await this.api.getMergeRequestThreads(); | |
const [{ id: dangerUserId }, threads] = await Promise.all([this.api.getUser(), this.api.getMergeRequestThreads()]) |
await this.api.updateMergeRequestDiscussion(threads[0].id, threads[0].notes[0].id, newComment); | ||
return `${this.api.mergeRequestURL}#note_${threads[0].notes[0].id}`; | ||
} else { | ||
const thread = await this.api.createMergeRequestDiscussion(newComment); | ||
|
||
return `${this.api.mergeRequestURL}#note_${thread.notes[0].id}`; |
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.
Maybe the zero could be a const with a description. Looks like a magic number without any type of context of why the code should the zero index and not any other
@@ -67,6 +67,14 @@ export class BitBucketCloud implements Platform { | |||
return true | |||
} | |||
|
|||
supportsThreads() { |
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.
the type is infered?
pinging @shyim I hope you dont abandon this PR, its good work and I think the review comments are valid |
As it took me too long to have it. I just built something similar of Danger for our company. Free free to create a new PR based on this :) |
That would be the way I would solve the thread problem.
After your Okay @orta I can implement also Github too :)