-
Notifications
You must be signed in to change notification settings - Fork 343
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 implementation + webhook events / integration with Studio #817
Comments
I'd prefer (4)-ish: document caveats of |
@duijf sorry to hear... if have also found some quirks with the api like intermittent failures |
Update: turns out GitLab has even more limitations than BitBucket around webhook events about comments. GL only provides webhook events for comment creation (either PR or commit comments). Editing and deletion events are not exposed, so the Since option 3) wouldn't work for GitLab, I guess we can shelve it to avoid a bunch of special cases for different SCM providers. For now, documentation for this behavior is probably good enough until a customer runs into these limitations and wants us to do something about them. If we ever want to fix this, these options are left:
|
That would have some security implications and would be non-trivial to implement properly imo |
Yup, it would definitely be a bit involved. Just left it as an idea that we can get to if it turns out that people really need it :) |
@duijf a webhook or a rest api call? The later its very doable |
Closing in favor of https://github.com/iterative/studio/issues/3753 |
reopening since https://github.com/iterative/studio/issues/3753 isn't a thing :) |
Hey CML team! As you've probably noticed, I'm working on the integration between Studio + CML PR comments on BitBucket.
I'm running into a limitation with BitBucket webhooks and wanted to check if you are open to changing the CML BitBucket implementation to make the integration work more reliably.
Problem:
pullrequest:comment_updated
is very unreliableBitBucket does not send webhook events for
pullrequest:comment_updated
in a lot of scenario's.From the BB docs:
From my experimentation, "not much time in between" can mean "not even after 20 minutes" (!). I have as-of-yet not been able to make BitBucket send me a single comment updated event1. (Not when editing a PR comment with CML, but also not when editing manually).
Update: I've edited a comment I've posted after 3 days, and BitBucket still did not send any update payload. Seems like this is just plain broken.
How CML performs edits
When
cml send-comment
is invoked with the--pr
and--update
flags, CML checks if a PR comment exists and updates it if this is the case. The update contains the new contents of the report.This update happens by sending a PUT request to BitBucket:
cml/src/drivers/bitbucket_cloud.js
Lines 154 to 166 in 0a674fe
Why Studio needs to know about updates
When CML updates a PR comment, the new comment may contain a new SHA. In these cases, Studio needs to associate the CML report with a different commit and display it accordingly. We are therefore interested in knowing when things change.
Options to resolve this
--pr
and--update
.--delete
/--delete-old
) and tell users to use this if they want smooth integration with Studio.--update
if they want to use CML with StudioOut of all these options, I'm inclined to lean towards
--delete
/--delete-old
(name up for discussion ofc.):--edit
.What do you think about the options I posted? Anything I missed?
Footnotes
I triple checked that I'm not doing anything weird. The webhook I have is configured to send updates when PR comments are edited. The created+deleted events work fine. ↩
The text was updated successfully, but these errors were encountered: