Add ability to read automationDetails.id if present

This commit is contained in:
Kristen Newbury
2023-05-17 15:23:19 -04:00
parent e2501b94a9
commit 9407e5b00f
5 changed files with 19 additions and 3 deletions

View File

@@ -79,10 +79,14 @@ def joins_for_projects(basetables, external_info):
"""
b = basetables; e = external_info
extra = ""
# if the sarif does have automationDetails
if "automationDetails" in b.project:
extra = b.project.automationDetails[0]
# if the sarif does have versionControlProvenance
if "repositoryUri" in b.project:
repoUri = b.project.repositoryUri[0]
e.project_id = hash.hash_unique(repoUri.encode())
e.project_id = hash.hash_unique((repoUri+extra).encode())
else:
repoUri = "unknown"