feat(scm): add bitbucket cloud scm and action support#2847
Conversation
|
@olblak if you want to set-up a repo in bitbucket that you control, I'm happy to update the e2e tests to use that instead. |
|
Ho nice
It's unfortunate because using HTML allows Updatecli to store information in so it can detect when a pullrequest body needs to be updated.
I think it would make sense to create a shared bitbucket instance as we can have up to 5 seats |
Yeah I've started using Bitbucket in my new role, its not my favourite user experience. It also doesn't support HTML comments so we couldn't get clever with hiding information in them either. |
6ff7c57 to
1d2248d
Compare
|
@mcwarman I just open a pullrequest on your fork, to update the e2e tests Apparently, I already created a Bitbucket account, and we can have up to 5 people on that workspace |
|
I just tested this pullrequest and it seems to work great 🎉 |
|
Could I ask to also add a documentation page to the website next to https://github.com/updatecli/website/tree/master/content/en/docs/plugins/scm |
Signed-off-by: Olblak <me@olblak.com>
|
I don't have access to see that repo on bitbucket (if you added I'll add the docs for using it. |
|
We either need to make the test repo public, or set BITBUCKET_TOKEN for the e2e generated from the repo: Ref: https://support.atlassian.com/bitbucket-cloud/docs/access-tokens/ |
Well I thought it already made it public, I'll check that later |
olblak
left a comment
There was a problem hiding this comment.
Thanks for the pull request, it looks great.
… action isRemoteBranchesExist() fetched all remote branches via a paginated list scan (Page: 1, Size: 30 with no follow-through) to check whether the source and target branches exist. On repositories with more than 30 branches this silently returned false, causing CreateAction to log "skipping pull request creation" at Debug level and exit with nil — the job appeared green with no PR and no visible explanation. Replace the list scan with two direct FindBranch calls (one per branch). This mirrors the approach used by GitHub's GraphQL implementation and is O(1) regardless of repository branch count. A 404 response from FindBranch is treated as a missing branch and logged at Warning level so the failure is visible without --debug. Also fix isPullRequestExist() which had the same Size: 30 truncation: it now paginates using resp.Page.Next until all open pull requests have been checked. Fixes the same class of bug as updatecli#1905 (GitLab) which was introduced when the Bitbucket Cloud plugin was added in updatecli#2847.
… action (#8584) isRemoteBranchesExist() fetched all remote branches via a paginated list scan (Page: 1, Size: 30 with no follow-through) to check whether the source and target branches exist. On repositories with more than 30 branches this silently returned false, causing CreateAction to log "skipping pull request creation" at Debug level and exit with nil — the job appeared green with no PR and no visible explanation. Replace the list scan with two direct FindBranch calls (one per branch). This mirrors the approach used by GitHub's GraphQL implementation and is O(1) regardless of repository branch count. A 404 response from FindBranch is treated as a missing branch and logged at Warning level so the failure is visible without --debug. Also fix isPullRequestExist() which had the same Size: 30 truncation: it now paginates using resp.Page.Next until all open pull requests have been checked. Fixes the same class of bug as #1905 (GitLab) which was introduced when the Bitbucket Cloud plugin was added in #2847. Co-authored-by: Olivier Vernin <olivier@vernin.me>
Add support for Bitbucket Cloud:
bitbucketbitbucket/pullrequestAlso updates documentation for stash to make it clearer its Bitbucket Server.
Test
To test this pull request, you can run the following commands:
Additional Information
Tradeoff
Bitbucket doesn't support any HTML in PR descriptions, so I had to add Markdown only views. There's a potential the format could be improved going forward
Potential improvement
Markdown format of PRs.