Skip to content

fix(bitbucket): migrate off cross-workspace APIs removed by CHANGE-2770#8916

Open
KennethWKZ wants to merge 1 commit into
apache:mainfrom
KennethWKZ:feature/fix-bitbucket-change-2770
Open

fix(bitbucket): migrate off cross-workspace APIs removed by CHANGE-2770#8916
KennethWKZ wants to merge 1 commit into
apache:mainfrom
KennethWKZ:feature/fix-bitbucket-change-2770

Conversation

@KennethWKZ

@KennethWKZ KennethWKZ commented Jun 10, 2026

Copy link
Copy Markdown

⚠️ Pre Checklist

Please complete ALL items in this checklist, and remove before submitting

  • I have read through the Contributing Documentation.
  • I have added relevant tests.
  • I have added relevant documentation.
  • I will add labels to the PR, such as pr-type/bug-fix, pr-type/feature-development, etc.

Summary

What does this PR do?

Bitbucket Cloud removed its cross-workspace REST APIs as part of CHANGE-2770. The Bitbucket plugin still called these endpoints, so listing/searching remote scopes failed with HTTP 410 CHANGE-2770 - Functionality has been deprecated:

(410) {"type":"error","error":{"message":"CHANGE-2770 - Functionality has been deprecated"}}
github.com/apache/incubator-devlake/plugins/bitbucket/api.listBitbucketWorkspaces
/app/plugins/bitbucket/api/remote_api.go:89

This PR migrates the plugin onto the supported workspace-scoped endpoints:

  • listBitbucketWorkspaces: replace GET /user/permissions/workspaces with the supported GET /workspaces (lists the current user's workspaces). Workspace slug/name now parsed from the top level of each value instead of a nested "workspace" object.
  • searchBitbucketRepos: replace cross-workspace GET /repositories?role=member with per-workspace GET /repositories/{workspace}, enumerating the user's workspaces first and aggregating up to PageSize matches.
  • models: flatten GroupResponse to match the /workspaces response shape.

The public remote-scopes / search-remote-scopes API contract is unchanged, so config-ui and Grafana need no changes.

Does this close any open issues?

N/A

Screenshots

N/A, no UI changes.

Other Information

Atlassian will not ship a cross-workspace /repositories replacement, so search now issues one request per workspace and collapses pagination to the first PageSize matches — the only path the new API surface allows.

Verified: go build ./plugins/bitbucket/... passes; manual smoke test against a Bitbucket Cloud connection (browse workspaces → repos, search remote scopes).

- listBitbucketWorkspaces: replace GET /user/permissions/workspaces with the supported GET /workspaces (lists the current user's workspaces). Workspace slug/name now parsed from the top level of each value instead of a nested "workspace" object.
- searchBitbucketRepos: replace cross-workspace GET /repositories?role=member with per-workspace GET /repositories/{workspace}, enumerating the user's workspaces first and aggregating up to PageSize matches.
- models: flatten GroupResponse to match the /workspaces response shape.
@KennethWKZ KennethWKZ marked this pull request as draft June 10, 2026 08:31
@KennethWKZ KennethWKZ marked this pull request as ready for review June 10, 2026 08:32
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.

1 participant