Skip to content

breaking: Replace deprecated endpoints with the new ones CY-7670#148

Merged
machadoit merged 1 commit intomasterfrom
update-deprecated-apis-CY-7670
Feb 9, 2026
Merged

breaking: Replace deprecated endpoints with the new ones CY-7670#148
machadoit merged 1 commit intomasterfrom
update-deprecated-apis-CY-7670

Conversation

@machadoit
Copy link
Contributor

@machadoit machadoit commented Feb 6, 2026

@machadoit machadoit requested a review from zhamborova February 6, 2026 17:50
@machadoit machadoit requested a review from lolgab as a code owner February 6, 2026 17:50
Copilot AI review requested due to automatic review settings February 6, 2026 17:50
@codacy-production
Copy link

codacy-production bot commented Feb 6, 2026

Codacy's Analysis Summary

0 new issue (≤ 0 minor issue)
0 new security issue (≤ 0 issue)
-4 complexity
0 duplications

Review Pull Request in Codacy →

AI Reviewer available: add the codacy-review label to get contextual insights without leaving GitHub.

@codacy-production
Copy link

codacy-production bot commented Feb 6, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 9f5890f1 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (9f5890f) Report Missing Report Missing Report Missing
Head commit (0f8426c) 9 0 0.00%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#148) 1 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates this Bitbucket v2 client to use Atlassian’s replacement endpoints for workspace discovery and workspace permission lookup, addressing upcoming deprecations.

Changes:

  • Switch workspace listing from deprecated /workspaces to /user/workspaces and introduce WorkspaceAccess to model the new response.
  • Switch workspace permission lookup from deprecated /user/permissions/workspaces to /user/workspaces/{workspace}/permission.
  • Add userWorkspacesBaseUrl to the client base URLs and bump CircleCI cache prefix.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/scala/com/codacy/client/bitbucket/v2/service/WorkspaceServices.scala Uses /user/workspaces and changes list to return WorkspaceAccess wrappers.
src/main/scala/com/codacy/client/bitbucket/v2/service/UserServices.scala Uses /user/workspaces/{workspace}/permission for membership/permission lookup.
src/main/scala/com/codacy/client/bitbucket/v2/WorkspaceAccess.scala Adds a model/JSON reader for the new /user/workspaces response shape.
src/main/scala/com/codacy/client/bitbucket/v2/Workspace.scala Removes name from the Workspace model and reader.
src/main/scala/com/codacy/client/bitbucket/client/BitbucketClientBase.scala Adds userWorkspacesBaseUrl for the new endpoint.
.circleci/config.yml Updates sbt cache key prefix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@machadoit machadoit force-pushed the update-deprecated-apis-CY-7670 branch from fc26e1e to 0f8426c Compare February 6, 2026 18:00
implicit val reader: Reads[Workspace] = (
(__ \ "uuid").read[String] and
(__ \ "slug").read[String] and
(__ \ "name").read[String] and
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use this field. And since it does not come on the list of workspaces now, it is cleaner to just remove it. This way can be used on both the listing of workspaces and the getting of the workspace

*/
def getWorkspaceMembership(workspaceUUID: String): RequestResponse[WorkspacePermission] = {
val workspaceUUIDEncoded = URLEncoder.encode(s""""$workspaceUUID"""", "UTF-8")
val workspaceQuery = s"""workspace.uuid=$workspaceUUIDEncoded"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearly it was a nice change of endpoint. The fact that they now give the 'membership' information if we access the workspace via /user/workspaces

@machadoit machadoit merged commit 615538c into master Feb 9, 2026
4 checks passed
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.

2 participants