KennethWKZ opened a new pull request, #8916:
URL: https://github.com/apache/devlake/pull/8916

   <!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   -->
   ### ⚠️ Pre Checklist
   
   > Please complete _ALL_ items in this checklist, and remove before submitting
   
   - [x] I have read through the [Contributing 
Documentation](https://devlake.apache.org/community/).
   - [ ] I have added relevant tests.
   - [ ] I have added relevant documentation.
   - [x] I will add labels to the PR, such as `pr-type/bug-fix`, 
`pr-type/feature-development`, etc.
   
   <!--
   Thanks for submitting a pull request!
   
   We appreciate you spending the time to work on these changes.
   Please fill out as many sections below as possible.
   -->
   
   ### Summary
   What does this PR do?
   
   Bitbucket Cloud removed its cross-workspace REST APIs as part of 
[CHANGE-2770](https://developer.atlassian.com/cloud/bitbucket/changelog#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).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to