Skip to content

Report Bitbucket issues as unsupported now that the tracker is gone - #237

Open
NopeCharon wants to merge 2 commits into
git-pkgs:mainfrom
NopeCharon:bitbucket-issues-removed
Open

NopeCharon wants to merge 2 commits into
git-pkgs:mainfrom
NopeCharon:bitbucket-issues-removed

Conversation

@NopeCharon

Copy link
Copy Markdown
Contributor

Summary

Fixes #236.

Stacked on #233. Both PRs touch the Bitbucket issue-comment test, so this branch starts from #233 to avoid a conflict. The first commit is #233's. Only 2d309f9 is new, and the diff will drop to that commit once #233 merges. I also checked that this branch and #235, which is stacked on #233 as well, merge together cleanly and pass go test ./bitbucket.

Bitbucket Cloud removed its native issue tracker in August 2026. The API changelog entry of 20 August 2026 (CHANGE-3071) says its endpoints "are now fully removed", and they answer 410 Gone. The Bitbucket backend still called them, so forge issue list/view/create/... on bitbucket.org failed with the raw HTTP 410 and its JSON body. Library callers got a *forges.HTTPError, so errors.Is(err, forges.ErrNotSupported) was false.

Changes

  • Issues() returns ErrNotSupported from every method without sending a request, as Labels() and Milestones() already do on Bitbucket. The issue types, converters and stateOpen/stateClosed constants are deleted, since nothing can reach them any more.
  • bbComment, bbCommentsResponse and convertBitbucketComment are still used by pull request comments. They move unchanged from issues.go to a new comments.go.
  • Issues().ListURL and Labels().ListURL pointed at <repo>/issues, which now 404s on bitbucket.org. They return the repository page instead, as the Gerrit backend does. That affects forge issue list --web, forge label list --web and forge browse --issues.
  • forge comment N already falls back to the pull request when commenting on an issue fails. It now skips the request that was answered with 410.
  • TestBitbucketReadOnlyHTTPClient used issue creation as its example write. It now uses pull request creation, which still sends a request for the read-only transport to refuse.
  • The README's Bitbucket paragraph says that issue operations aren't supported.

Repository.HasIssues still reflects the repository's has_issues flag, which the API keeps returning. I left it as the API reports it rather than override the field.

Testing

  • TestBitbucketIssuesNotSupported calls every IssueService method through bitbucket.New against a server that fails the test on any request. Each one returns ErrNotSupported.
  • A new test checks that both ListURLs return the repository page.
  • go test ./..., go test -race ./bitbucket, golangci-lint run ./bitbucket/... and the js/wasm build of ./bitbucket pass.

Bitbucket stopped returning username for users in 2019. User objects now
carry nickname, which Bitbucket recommends in its place, display_name and
uuid, and only team accounts still have a username. The backend read
nothing else, so pull request authors and reviewers, comment authors,
review authors and repository owners came back empty.

Users are now decoded into one shared bbUser type. convertBitbucketUser
uses the username where Bitbucket still returns one and the nickname
otherwise, and fills Name from display_name, which was never set before.
Pull requests, comments, review participants and GetAuthenticatedUser
all go through it.

RequestReviewers and RemoveReviewers sent the pull request's existing
reviewers back as {"username": ""}, the only identity they could read.
They now send them by uuid, which is how Bitbucket's API identifies
reviewers, and match names to add or remove against each reviewer's
nickname or UUID. A name written as a braced UUID is sent as uuid when
creating or updating a pull request or requesting reviewers; anything
else is still sent as a username.

Repository.Owner came from owner.username, which is empty for
repositories owned by users and, for teams, can differ from the
workspace slug that repository paths take (tutorials/markdowndemo
reported "tutorials-team"). It is now the workspace slug from full_name,
the same way convertBitbucketPR fills Head.Fork.Owner.

New replay tests recorded from api.bitbucket.org check pull request and
review logins against real responses, and TestReplayGetRepo now expects
the workspace slug. The README notes how Bitbucket logins, reviewers and
owners map.

Fixes git-pkgs#232

Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
Bitbucket Cloud removed its native issue tracker in August 2026, and the
API endpoints behind it now answer 410 Gone (CHANGE-3071). The backend
still called them for every IssueService method, so forge issue
commands on bitbucket.org failed with the raw HTTP 410 error and its
JSON body, and library callers got an HTTPError they couldn't tell
apart from a failed request.

The issue service now returns ErrNotSupported without sending a
request, as Labels() and Milestones() already do, and the issue types
and converters that nothing can reach any more are gone. The comment
types and converter that the pull request service shares move from
issues.go to comments.go unchanged.

Issues().ListURL and Labels().ListURL pointed at the repository's
/issues page, which went with the tracker and now 404s, so they return
the repository page instead, as the Gerrit backend does.

The read-only test uses pull request creation as its example write now
that issue creation sends nothing, and the README says that Bitbucket
issue operations aren't supported.

Fixes git-pkgs#236

Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Dec 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9757c1c3-52cf-4c28-ac29-3e786f1e5202
Commits

Reviewing files that changed from the base of the PR and between eb97902 and 2d309f9.

Files selected for processing: 17

  • README.md
  • bitbucket/bitbucket.go
  • bitbucket/bitbucket_test.go
  • bitbucket/comments.go
  • bitbucket/issues.go
  • bitbucket/issues_test.go
  • bitbucket/labels.go
  • bitbucket/prs.go
  • bitbucket/prs_test.go
  • bitbucket/readonly_test.go
  • bitbucket/replay_test.go
  • bitbucket/reviews.go
  • bitbucket/reviews_test.go
  • bitbucket/testdata/replay/TestReplayGetPR.json
  • bitbucket/testdata/replay/TestReplayListReviews.json
  • bitbucket/user.go
  • bitbucket/user_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bitbucket removed its issue tracker; issue operations fail with HTTP 410 instead of ErrNotSupported

1 participant