Skip to content

Commit b1fad21

Browse files
Add license detections to Compliance alerts panel
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent 9f8d552 commit b1fad21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scanpipe/pipes/compliance.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ def get_project_compliance_alerts(project, fail_level="error"):
105105
.only(*PACKAGE_URL_FIELDS, "compliance_alert")
106106
.order_by(*PACKAGE_URL_FIELDS)
107107
)
108+
licenses_qs = (
109+
project.discoveredlicenses.compliance_issues(severity=fail_level)
110+
.only("identifier", "compliance_alert")
111+
.order_by("identifier")
112+
)
108113
resource_qs = (
109114
project.codebaseresources.compliance_issues(severity=fail_level)
110115
.only("path", "compliance_alert")
@@ -113,6 +118,7 @@ def get_project_compliance_alerts(project, fail_level="error"):
113118

114119
queryset_mapping = {
115120
"packages": package_qs,
121+
"license_detections": licenses_qs,
116122
"resources": resource_qs,
117123
}
118124

0 commit comments

Comments
 (0)