Skip to content

Commit a8896e0

Browse files
author
Makoto
committed
Added link to snippet ui in the header
1 parent 35639bd commit a8896e0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/client/consolidated_file_report.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
BLACKDUCK_REPORT_MEDIATYPE = "application/vnd.blackducksoftware.report-4+json"
9090
blackduck_report_download_api = "/api/projects/{projectId}/versions/{projectVersionId}/reports/{reportId}/download"
9191
blackduck_link_component_ui_api = "/api/projects/{projectId}/versions/{projectVersionId}/components"
92+
blackduck_link_snippet_ui_api = "/api/projects/{projectId}/versions/{projectVersionId}/source-trees"
9293
# BD version details report
9394
blackduck_create_version_report_api = "/api/versions/{projectVersionId}/reports"
9495
blackduck_version_report_filename = "./blackduck_version_report_for_{projectVersionId}.zip"
@@ -105,6 +106,7 @@
105106
REPORT_COMPONENT_BOM = "/component_bom_report"
106107
REPORT_FILE_BOM = "/file_bom_report"
107108
REPORT_DISCOVERY = "/discovery"
109+
BLACKDUCK_SNIPPET_FILTER = "?filter=bomMatchType%3Asnippet&offset=0&limit=100"
108110
# Retries to wait for BD report creation. RETRY_LIMIT can be overwritten by the script parameter.
109111
RETRY_LIMIT = 30
110112
RETRY_TIMER = 30
@@ -115,7 +117,8 @@
115117
'detectParameters': [],
116118
'scanDateTime': '',
117119
'blackDuckVersion': '',
118-
'linkToBlackDuckProjectVersionInUI': ''
120+
'linkToBlackDuckProjectVersionInUI': '',
121+
'linkToBlackDuckSnippetMatchInUI': ''
119122
},
120123
'fileInventory': {
121124
'linkToUnmatchedOsFileData': "",
@@ -632,6 +635,9 @@ def generate_file_report(hub_client, project_id, version_id, codelocations, copy
632635
blackduck_link_component_ui_api.replace("{projectId}", project_id).replace("{projectVersionId}", version_id)
633636
report_content['configurationSettings']['linkToBlackDuckProjectVersionInUI'] = \
634637
hub_client.base_url + blackduck_link_component_ui_api.replace("{projectId}", project_id).replace("{projectVersionId}", version_id)
638+
report_content['configurationSettings']['linkToBlackDuckSnippetMatchInUI'] = \
639+
hub_client.base_url + blackduck_link_snippet_ui_api.replace("{projectId}", project_id).replace("{projectVersionId}", version_id) \
640+
+ BLACKDUCK_SNIPPET_FILTER
635641

636642
# Report body - Component BOM, file BOM with Discoveries data
637643
version_report_zip = get_version_detail_report(hub_client, project_id, version_id, retries)

0 commit comments

Comments
 (0)