breaking: Replace deprecated endpoints with the new ones CY-7670#148
breaking: Replace deprecated endpoints with the new ones CY-7670#148
Conversation
Codacy's Analysis Summary0 new issue (≤ 0 minor issue) Review Pull Request in Codacy →
|
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
There was a problem hiding this comment.
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
/workspacesto/user/workspacesand introduceWorkspaceAccessto model the new response. - Switch workspace permission lookup from deprecated
/user/permissions/workspacesto/user/workspaces/{workspace}/permission. - Add
userWorkspacesBaseUrlto 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.
src/main/scala/com/codacy/client/bitbucket/v2/service/WorkspaceServices.scala
Show resolved
Hide resolved
src/main/scala/com/codacy/client/bitbucket/v2/service/UserServices.scala
Show resolved
Hide resolved
fc26e1e to
0f8426c
Compare
| implicit val reader: Reads[Workspace] = ( | ||
| (__ \ "uuid").read[String] and | ||
| (__ \ "slug").read[String] and | ||
| (__ \ "name").read[String] and |
There was a problem hiding this comment.
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""" |
There was a problem hiding this comment.
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
Deprecation post:
https://developer.atlassian.com/cloud/bitbucket/changelog/#CHANGE-2770
New endpoints:
https://developer.atlassian.com/cloud/bitbucket/changelog/#CHANGE-3022