Skip to content

feat(security-tab): surface native scan_findings on per-artifact Security tab (#368)#387

Merged
brandonrc merged 1 commit intomainfrom
feat/368-artifact-security-tab-scan-findings
May 9, 2026
Merged

feat(security-tab): surface native scan_findings on per-artifact Security tab (#368)#387
brandonrc merged 1 commit intomainfrom
feat/368-artifact-security-tab-scan-findings

Conversation

@brandonrc
Copy link
Copy Markdown
Contributor

Summary

Closes #368. The per-artifact Security tab used to show only SBOM CVE history and Dependency-Track findings — never the native scan_findings table. A user who triggered a scan via POST /api/v1/security/scan for a specific artifact had no way to see the resulting findings on the artifact's own page.

This wires up securityApi.listArtifactScans(artifact.id) (which already existed but had no consumer) and renders the recent scan_results rows for the artifact with a "View findings" link to the per-scan page.

What's new

  • ArtifactScansSection component (exported for testing)
  • Mounts in SecurityTabContent above the Dependency-Track section
  • Status / type / findings (with crit/high severity pills) / completed_at / link to /security/scans/[id]
  • Empty / loading / error states matching the rest of the tab

Test plan

  • npm test — 2088/2088 (6 new in artifact-scans-section.test.tsx)
  • npm run lint — 0 errors
  • npm run build — succeeds

🤖 Generated with Claude Code

@brandonrc brandonrc requested a review from a team as a code owner May 9, 2026 21:22
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

…rity tab (#368)

Pre-#368 the per-artifact Security tab only queried sbomApi.getCveHistory
and Dependency-Track. A user who triggered a scan via POST /api/v1/security/scan
for a specific artifact and whose scan completed with real findings
couldn't see those findings on the artifact's own page — they had to
navigate to /security/scans and find the right scan ID by artifact
name + timestamp. The natural single-pane-of-glass was empty.

The SDK method securityApi.listArtifactScans(artifact.id) already
existed but had no consumer. Wire it up.

src/app/(app)/repositories/_components/security-tab-content.tsx:
  + new ArtifactScansSection component, exported for testing
  + queryKey: ["security", "artifact-scans", artifactId]
  + table: status / type / findings (with crit/high pills) / completed_at /
    "View findings" link to /security/scans/[id]
  + empty / loading / error states matching the rest of the tab
  + mounted in SecurityTabContent above the DT section

src/app/(app)/repositories/_components/__tests__/artifact-scans-section.test.tsx (new):
  + empty / loading / error / row-rendered states
  + critical & high counts hidden when zero
  + locks the queryKey shape so a future rename surfaces at typecheck

CHANGELOG entry under [Unreleased] / Fixed.

Closes #368.
@brandonrc brandonrc force-pushed the feat/368-artifact-security-tab-scan-findings branch from 7938c90 to 2802256 Compare May 9, 2026 21:33
@brandonrc brandonrc merged commit 58cc357 into main May 9, 2026
18 checks passed
@brandonrc brandonrc deleted the feat/368-artifact-security-tab-scan-findings branch May 9, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Per-artifact Security tab uses SBOM/CVE history but never queries scan_findings (listArtifactScans is unused)

1 participant