-
Bug
-
Resolution: Fixed
-
High
-
None
-
3
-
Severity 3 - Minor
-
247
-
This bug was closed and the impact for this issue should be tracked on: https://jira.atlassian.com/browse/BCLOUD-23439
Issue Summary
- When a user is removed from a workspace, if the user was listed as a default reviewer for any repository, the default-reviewers endpoint still returns that user, even though they no longer have access to the workspace;
Steps to Reproduce
- Add a user to your workspace;
- Add the user as default reviewer for any repository;
- Remove the user through the workspace's settings > User directory
- Use the default-reviewers API endpoint for that repository;
Expected Results
- The user should not be listed as a default reviewer anymore;
Actual Results
- The user appears in the list of repository default reviewers through the API;
- Furthermore, if you try to edit a file and commit it through the UI, creating a Pull Request, the user will be added as a reviewer, causing an issue while trying to create the PR.
The below exception is thrown in the network tab of the Developer Panel:
{ "type": "error", "error": { "message": "reviewers: John Doe is not a member of this workspace and cannot be added to this pull request", "fields": { "reviewers": [ "John Doe is not a member of this workspace and cannot be added to this pull request" ] } } }
Workaround
- Use the Delete Default Reviewer Endpoint to remove that user from the list of default reviewer;
$ Curl -X DELETE -u <username>:<password> "https://api.bitbucket.org/2.0/repositories/<workspace>/<repo>/default-reviewers/%7B<UUID>%7D"