Bitbucket cloud's workspaces are not recognized
See original GitHub issueI leave my original report, but i found that the plugin doesn’t recognize workspaces and treats them as ordinal users and so role
parameter is added.
Version report
Jenkins and plugins versions report:
Various. Plugin versions 2.7.0 and 2.9.8 were tested.
Reproduction steps
- Goto bitbucket cloud
- Create a workspace and several repositories in the workspace
- Create a new Bitbucket Team/Project in Jenkins
Results
Expected result:
All those repositories should be listed.
Actual result:
No repositories are listed.
According to official Bitbucket API documentation (https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/{workspace}):
Returns a paginated list of all repositories owned by the specified account or UUID.
The result can be narrowed down based on the authenticated user’s role.
E.g. with ?role=contributor, only those repositories that the authenticated user has write access to are returned (this includes any repo the user is an admin on, as that implies write access).
This endpoint also supports filtering and sorting of the results. See filtering and sorting for more details.
So, role=owner
makes sense only for a personal workspace. For organizations it should be omitted (in that case it’s implicitly role=member
) or made configurable (admin/contributor/member/owner).
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6
Top GitHub Comments
Well, in the end it depends on the role the user has on the repository. Out situation is the following: we are using bitbucket workspaces, and we have a user for jenkins tha is a member of the workspace. With this confguration and role=‘member’, everything works. If the #475 is merged with role=‘admin’ it will work as long as you make use jenkins bitbucket user admin in all repositories. It is less convenient that handling that with just workspace membership, but it’d work.
I see, maybe the member role is not enough for that