ebierhoda opened a new issue, #6842:
URL: https://github.com/apache/incubator-devlake/issues/6842

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   When adding a data scope for Azure Devops, the scopes on the left return all 
the projects in Azure DevOps. Upon selection of one, it returns all the 
repositories linked to that project on the right. In this particular instance 
it makes the calls below. The call made for sourceProviders is duplicated when 
multiple service connections are linked to a project. A service connection to 
Bitbucket exists for each user that belongs to/works on that project.
   If these users have access to the same repositories in Bitbucket, the data 
returned in the right repositories pane are duplicated.
     
   https://dev.azure.com:443 \"GET 
/organisation/project/_apis/git/repositories?api-version=7.0 HTTP/1.1\" 200 
None"
   https://dev.azure.com:443 \"GET 
/organisation/project/_apis/serviceendpoint/endpoints?api-version=7.0 
HTTP/1.1\" 200 2529"
   **https://dev.azure.com:443 \"GET 
/organisation/project/_apis/sourceProviders/bitbucket/repositories?serviceEndpointId=abcdefghi
   https://dev.azure.com:443 \"GET 
/organisation/project/_apis/sourceProviders/bitbucket/repositories?serviceEndpointId=jklmnopq**
   
   When selecting one of these repositories, it appears multiple times in the 
top pane and when attempting to save the data it fails with a unique constraint 
error.
   
   Error 1062 (23000): Duplicate entry 'Workspace/Repo' for key 
'_tool_azuredevops_gitrepositories.PRIMARY'\n\x1b[0m\x1b[33m[43.223ms] 
\x1b[34;1m[rows:0]\x1b[0m INSERT INTO `_tool_azuredevops_gitrepositories` 
   
   
   
   
   ### What do you expect to happen
   
   Return a list of the Bitbucket service connections that exist for the 
project and allow the user to select one. 
   or
   Remove the duplicate repositories before displaying the data in the right 
pane. 
   
   ### How to reproduce
   
   Create an Azure Devops project with multiple service connections to 
Bitbucket. 
   Make sure each service connection has access to the same repos in bitbucket.
   Attempt to add a data scope for one of the repos.
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   v0.20.0-beta5
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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