Skip to content

Commit 5365188

Browse files
authored
Remove the Licenses tab the Compliance tab replaced (#37)
* fix(scan): match distro packages an SBOM never labelled with an OS Trivy picks a distro advisory database from an operating-system component, not from package PURLs, so a supplier SBOM listing every rpm on an image reported zero vulnerabilities. Measured on Trivy 0.71.2: 0 findings without the component, 306 with it; SPDX behaves the same (0 -> 166) and needs the SPDXRef-OperatingSystem id prefix, not primaryPackagePurpose. Infer the distro from the packages and scan an enriched copy — the upload itself is never edited, since it backs the conformance verdict and the signature bundle. A second defect surfaced alongside: os-pkgs results are labelled with the distro, which no PURL reconstruction maps, so every distro finding was dropped as "no purl". Fall back to the PURL Trivy attaches to the finding, leaving reconstruction first so existing ecosystems are untouched. Upstream's rewrite of an existing OS version down to its major release is deliberately not ported: centos 7.9.2009, rocky 8.10, alma 9.3 and redhat 8.9 each matched identically with and without the minor. * chore(web): remove the Licenses tab the Compliance tab replaced LicensesTab / LicensesToolbar stopped being routed when ComplianceTab took over (W9-#58), but the files and their unit test stayed, so the screen still read as live. Remove them along with useLicenses, whose only caller they were. licensesApi keeps listProjectLicenses: the list endpoint is staying as a REST surface a CI job can call, and this file is where it is typed and tested. That it now has no in-app caller is stated in the file. Comments that pointed at the removed files were repointed at what they actually mirror.
1 parent fe9b4cf commit 5365188

14 files changed

Lines changed: 22 additions & 1223 deletions

apps/frontend/src/features/projects/api/licensesApi.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@
33
/**
44
* Licenses wire surface — Phase 3 PR #12.
55
*
6-
* Two read-only endpoints back the project Licenses tab + drawer:
6+
* Two read-only endpoints:
77
*
88
* - GET /v1/projects/{id}/licenses → LicenseListResponse
99
* - GET /v1/license_findings/{finding_id} → LicenseDetailResponse
1010
*
1111
* The wire types mirror `apps/backend/schemas/license_detail.py` 1:1
12-
* (snake_case). Hooks in `./useLicenses.ts` and `./useLicenseFinding.ts`
13-
* wrap these in TanStack Query.
12+
* (snake_case). `./useLicenseFinding.ts` wraps the single-finding read in
13+
* TanStack Query, and the drawer consumes it.
14+
*
15+
* `listProjectLicenses` currently has no caller in the app: the Compliance tab
16+
* replaced the Licenses tab and reads its own endpoint. It is kept because the
17+
* list endpoint itself is kept — it is part of the REST surface a CI job can
18+
* call — and this file is where that surface is typed and tested.
1419
*
1520
* Read-only domain: license findings carry no analyst workflow (no status
1621
* transitions, no audit log). ORT's ruleset is the authoritative classifier

apps/frontend/src/features/projects/api/useLicenses.ts

Lines changed: 0 additions & 96 deletions
This file was deleted.

apps/frontend/src/features/projects/api/useObligations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/**
44
* useObligations — Phase 3 PR #13.
55
*
6-
* Paginated query for the project's obligations. Mirrors `useLicenses` (PR
7-
* #12): `useQuery` (not `useInfiniteQuery`) because the read is read-only
6+
* Paginated query for the project's obligations. `useQuery` (not
7+
* `useInfiniteQuery`) because the read is read-only
88
* and the distribution payload only makes sense per filter slice; flattening
99
* pages would muddle the chart semantics.
1010
*/

apps/frontend/src/features/projects/components/ComplianceTab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* - ``?compliance_sort=category|license_name|spdx_id|affected_count``
4242
* - ``?compliance_order=asc|desc`` order toggle
4343
* - ``?compliance_page=N`` 1-based page index
44-
* - ``?license=<finding_id>`` drawer selection (shared with LicensesTab)
44+
* - ``?license=<finding_id>`` drawer selection
4545
*
4646
* Backward compatibility (W4-C)
4747
* -----------------------------
@@ -280,7 +280,7 @@ export function ComplianceTab({
280280
parsePage(searchParams.get("compliance_page")),
281281
);
282282

283-
// Drawer selection. ``?license=<finding_id>`` is shared with LicensesTab so
283+
// Drawer selection. The ``?license=<finding_id>`` key predates this tab, so
284284
// a deep-link from a chart or a recent-finding card still works.
285285
const drawerId = searchParams.get("license");
286286
const drawerOpen = drawerId != null && drawerId.length > 0;

0 commit comments

Comments
 (0)