GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(scm): add bitbucket cloud scm and action support by mcwarman · Pull Request #2847 · updatecli/updatecli

Conversation

@mcwarman

@mcwarman mcwarman commented Oct 18, 2024

Copy link
Copy Markdown
Member

Add support for Bitbucket Cloud:

  • a new scm bitbucket
  • a new action bitbucket/pullrequest

Also updates documentation for stash to make it clearer its Bitbucket Server.

Test

To test this pull request, you can run the following commands:

go build -o bin/updatecli
./bin/updatecli diff --config ./e2e/updatecli.d/success.d/bitbucket/scm.yaml

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

loispostula and olblak reacted with heart emoji
All reactions
  • ❤️ 2 reactions
@mcwarman
mcwarman requested a review from olblak October 18, 2024 15:35
@mcwarman

mcwarman commented Oct 18, 2024

Copy link
Copy Markdown
Member Author

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcwarman mcwarman changed the title feat: add bitbucket cloud scm and action support feat(scm): add bitbucket cloud scm and action support Oct 18, 2024
@olblak

olblak commented Oct 19, 2024

Copy link
Copy Markdown
Member

Ho nice

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

It's unfortunate because using HTML allows Updatecli to store information in

so it can detect when a pullrequest body needs to be updated.

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.

I think it would make sense to create a shared bitbucket instance as we can have up to 5 seats
https://www.atlassian.com/software/bitbucket/pricing

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcwarman

mcwarman commented Oct 19, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

It's unfortunate because using HTML allows Updatecli to store information in
so it can detect when a pullrequest body needs to be updated.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcwarman added 2 commits October 21, 2024 21:45
@mcwarman
docs: update stash docs to refer to bitbucket server
7539d3e
@mcwarman
feat: add bitbucket cloud scm and action support
1d2248d
@mcwarman
mcwarman force-pushed the feat/bitbucket branch from 6ff7c57 to 1d2248d Compare October 21, 2024 20:46
olblak added 2 commits October 22, 2024 02:33
@olblak
Merge branch 'main' into feat/bitbucket
8169b36
@olblak
Merge branch 'main' into feat/bitbucket
b21e32c
@olblak

olblak commented Oct 22, 2024

Copy link
Copy Markdown
Member

@mcwarman I just open a pullrequest on your fork, to update the e2e tests
mcwarman#1

Apparently, I already created a Bitbucket account, and we can have up to 5 people on that workspace

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@olblak

olblak commented Oct 22, 2024

Copy link
Copy Markdown
Member

I just tested this pullrequest and it seems to work great 🎉

https://bitbucket.org/updatecli/updatecli/pull-requests/2

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@olblak

olblak commented Oct 22, 2024

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

olblak added 3 commits October 22, 2024 15:24
@olblak
Merge branch 'main' into feat/bitbucket
379fd34
@olblak
Merge branch 'main' into feat/bitbucket
181356e
@olblak
chore: update bitbucket e2e test to use Updatecli workspace (#1)
435da8a
Signed-off-by: Olblak <[email protected]>
@mcwarman

mcwarman commented Oct 22, 2024

Copy link
Copy Markdown
Member Author

I don't have access to see that repo on bitbucket (if you added mcwarman that's an old work account I can't get back the username for mcwarman1 is now me).

I'll add the docs for using it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcwarman mcwarman mentioned this pull request Oct 22, 2024
docs: add bitbucket scm and action docs updatecli/website#1607
Merged
@mcwarman
remove comment on password.
8506caa
@mcwarman

mcwarman commented Oct 22, 2024

Copy link
Copy Markdown
Member Author

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/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@olblak

olblak commented Oct 22, 2024

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcwarman
docs: fix docs typo
f07e26a
olblak
olblak approved these changes Oct 23, 2024
View reviewed changes

@olblak olblak left a comment

Copy link
Copy Markdown
Member

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.

Thanks for the pull request, it looks great.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@olblak
olblak merged commit 5886ce7 into updatecli:main Oct 23, 2024
@olblak olblak added enhancement New feature or request scm-bitbucket All things related to the bitbucket integration labels Oct 23, 2024
@olblak olblak added this to the 0.86.0 milestone Oct 23, 2024
@mcwarman
mcwarman deleted the feat/bitbucket branch October 23, 2024 07:54
roulettedares added a commit to roulettedares/updatecli that referenced this pull request Apr 24, 2026
@roulettedares
fix(bitbucket): use FindBranch and paginate PR listing in pullrequest…
8c65cf6
… 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.
@roulettedares roulettedares mentioned this pull request Apr 24, 2026
fix(bitbucket): use FindBranch and paginate PR listing in pullrequest… #8584
Merged
1 task
olblak added a commit that referenced this pull request Apr 25, 2026
@roulettedares @olblak
fix(bitbucket): use FindBranch and paginate PR listing in pullrequest…
7b197e1
… 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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@olblak olblak olblak approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

enhancement New feature or request scm-bitbucket All things related to the bitbucket integration

Projects

None yet

Milestone

0.86.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mcwarman @olblak
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.