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
Bitbucket Cloud: Fix bug when Danger updating inline comment with summary comment #1076
Bitbucket Cloud: Fix bug when Danger updating inline comment with summary comment #1076
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.
I don't use BitBucket myself, so I cannot test this, but it seems pretty straightforward.
I've provided some minor change requests above, but once those are addressed this seems reasonable to me.
@@ -214,11 +214,12 @@ export class BitBucketCloudAPI { | |||
return await res.text() | |||
} | |||
|
|||
getDangerComments = async (dangerID: string): Promise<BitBucketCloudPRComment[]> => { | |||
getDangerMainComments = async (dangerID: string): Promise<BitBucketCloudPRComment[]> => { |
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.
getDangerComments
is a part of the interface for all API providers, so you probably shouldn't modify this implementation & rename it.
Would you mind either putting a helper in the BitBucketCloud.ts file (since that's the only place that is calling this getDangerMainComments
method and/or duplicating the implementation (with your changes) into a new method?
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.
I don't think getDangerComments
is a part of the interface because we only have this function in BitBucketServerAPI
and BitBucketCloudAPI
.
I believe the name getDangerComments
would confused us, since we don't know if the result would be main comment or inline comment.
Moreover, we don't really have the usecase that we need both main comments, and inline comments at the same time, so I renamed it to getDangerMainComments
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 felt off to me also, but I think I see your reasoning 👍🏻
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.
Sounds good! Sorry that i didn't dive deeper to verify my comments!
Co-authored-by: Frederic Barthelemy <git@fbartho.com>
👍🏻 |
I'll make a release on the next PR |
1 similar comment
I'll make a release on the next PR |
When updating summary comment, Danger will call
getDangerComments
which will get all Danger's comments (including inline comment) for updating.We need to filter inline comments out, so Danger will only update the main comment.