Skip to content

Commit 97a5352

Browse files
scan manual projects
1 parent 4957643 commit 97a5352

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cxone_api/high/projects.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ async def __get_repourl_from_scan_config(self):
5353
return entry['value']
5454

5555
return None
56+
57+
async def __get_primary_branch_from_scan_config(self):
58+
# The project config API does not always return the repoUrl. The scan configuration
59+
# API used by the UI has it if it is not in the project config.
60+
for entry in await self.get_project_scan_config():
61+
if entry['key'] == "scan.handler.git.branch":
62+
return entry['value']
63+
64+
return ""
5665

5766
async def __get_repomgr_config(self):
5867
# Projects imported from the SCM have their repo credentials stored in the repo-manager
@@ -105,6 +114,8 @@ async def __get_logical_primary_branch(self):
105114
return self.__project_data['mainBranch']
106115
elif len(await self.__get_primary_branch_from_repomgr_config()) > 0:
107116
return await self.__get_primary_branch_from_repomgr_config()
117+
elif len(await self.__get_primary_branch_from_scan_config()):
118+
return await self.__get_primary_branch_from_scan_config()
108119

109120
return None
110121

0 commit comments

Comments
 (0)