This is an automated email from the ASF dual-hosted git repository.

ka94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new cf6863fb6 fix: Prefix repositories names with project names (#5538)
cf6863fb6 is described below

commit cf6863fb66b26bc8ba347d45731fc89ce4bfa2ae
Author: Camille Teruel <[email protected]>
AuthorDate: Wed Jun 21 06:10:18 2023 +0200

    fix: Prefix repositories names with project names (#5538)
    
    Also prefix external repositories name with provider (e.g. GitHub, 
Bitbucket)
    
    Co-authored-by: Camille Teruel <[email protected]>
---
 backend/python/plugins/azuredevops/azuredevops/main.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/backend/python/plugins/azuredevops/azuredevops/main.py 
b/backend/python/plugins/azuredevops/azuredevops/main.py
index ff6007d3a..616a8076c 100644
--- a/backend/python/plugins/azuredevops/azuredevops/main.py
+++ b/backend/python/plugins/azuredevops/azuredevops/main.py
@@ -78,6 +78,7 @@ class AzureDevOpsPlugin(Plugin):
         org, proj = group_id.split('/')
         api = AzureDevOpsAPI(connection)
         for raw_repo in api.git_repos(org, proj):
+            raw_repo['name'] = f'{proj}/{raw_repo["name"]}'
             raw_repo['project_id'] = proj
             raw_repo['org_id'] = org
             # remove username from url
@@ -98,7 +99,7 @@ class AzureDevOpsPlugin(Plugin):
                 props = repo['properties']
                 yield GitRepository(
                     id=repo['id'],
-                    name=repo['name'],
+                    name=f'{provider}/{proj}/{repo["name"]}',
                     project_id=proj,
                     org_id=org,
                     provider=provider,

Reply via email to