Skip to content

Fix Snyk Issue API reachability rendering; pin parser output surfaces#15219

Draft
devGregA wants to merge 1 commit into
devfrom
fix/snyk-issue-api-reachability-rendering
Draft

Fix Snyk Issue API reachability rendering; pin parser output surfaces#15219
devGregA wants to merge 1 commit into
devfrom
fix/snyk-issue-api-reachability-rendering

Conversation

@devGregA

Copy link
Copy Markdown
Contributor

Description

Fixes the Snyk Issue API parser's reachability rendering. The parser collapsed Snyk's per-coordinate reachability values into a single boolean via reachability != "not-applicable", so no-path-found — Snyk affirmatively reporting that no path to the vulnerable code exists — and even a completely missing value both rendered as Reachable: Yes in the impact field.

The impact text now renders the raw values Snyk reported (Reachability: reachable / package / no-path-found / not-applicable, deduped and sorted for determinism), and renders nothing when Snyk reports nothing.

This PR also adds output-stability assertions for existing parser output surfaces that users and downstream tooling rely on, so future changes to these formats are deliberate rather than incidental:

  • govulncheck (V2): the **Reachability:** <level> (<severity> severity) description line and the **Traces:** block
  • sysdig_reports: the InUse:<bool> tag format

Test results

  • New fixture unittests/scans/snyk_issue_api/snyk_sca_scan_api_reachability.json exercises all four Snyk cases (reachable, package, no-path-found, and a coordinate with no reachability value) with assertions on the rendered impact text — including that the previously-misrendered no-path-found and missing-value cases no longer claim reachability.
  • Updated the existing assertion that pinned the old misleading Reachable: No text.
  • Added the stability assertions to the existing govulncheck V2 and sysdig 2025-format tests using existing fixtures.
  • All touched files are Ruff-compliant; relying on CI for the full suite run.

Documentation

No documentation changes needed — output rendering fix and test hardening only.

🤖 Generated with Claude Code

The parser collapsed Snyk's per-coordinate reachability into a broken
boolean: 'reachability != "not-applicable"' counted 'no-path-found' (Snyk
affirmatively found NO path to the vulnerable code) and even a missing value
as reachable, so those findings rendered 'Reachable: Yes' in the impact
text. Render the raw values Snyk reported instead ('Reachability:
reachable / package / no-path-found / not-applicable'), and say nothing when
Snyk reports nothing.

Also pins existing observable output surfaces with tests so future changes
to them are deliberate rather than incidental:
- govulncheck V2: the '**Reachability:** <level> (<severity> severity)'
  description line and the '**Traces:**' block
- sysdig_reports: the 'InUse:<bool>' tag format

New fixture exercises all four Snyk reachability cases including the
previously-misrendered no-path-found and missing-value cases.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant