Skip to content

Run Snyk Open Source monitor even when Snyk Code test fails - #56

Merged
AviBackToBlack merged 8 commits into
mainfrom
fix/snyk-monitor-always-run
Jul 26, 2026
Merged

AviBackToBlack merged 8 commits into
mainfrom
fix/snyk-monitor-always-run

Conversation

@AviBackToBlack

@AviBackToBlack AviBackToBlack commented Jul 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Snyk Code test and Snyk Open Source monitor are independent scans, but neither step had an if: condition, so a Code finding failing its step (which is happening right now — 16 pre-existing findings) silently skips Open Source dependency monitoring too. Confirmed on the merge-to-main run for #47/#48/etc: https://github.com/AviBackToBlack/lidaldi/actions/runs/30214194004/job/89825422862 — Snyk Open Source monitor shows skipped.

Added if: always() to the monitor step so it always runs and reports to Snyk regardless of the Code scan's outcome. Doesn't change the "Code findings fail the job" policy — just stops it from also blinding the separate SCA scan.

Test plan

  • Confirm Snyk Open Source monitor shows as run (not skipped) on this PR, even with snyk still failing overall

🤖 Generated with Claude Code


Open in Devin Review

Neither step had an if: condition, so a Code (SAST) finding failing
its step silently skipped Open Source (SCA) dependency monitoring too
— confirmed on https://github.com/AviBackToBlack/lidaldi/actions/runs/30214194004/job/89825422862,
where `Snyk Open Source monitor` shows skipped. The two scans are
independent concerns; one failing shouldn't blind the other.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread .github/workflows/snyk-security.yml
AviBackToBlack and others added 7 commits July 27, 2026 00:10
Now that the Open Source monitor step actually runs (previous commit),
it surfaced a second issue: `snyk monitor --all-projects` reported
"Missing required packages" for requirements.txt and
tests/requirements.txt — this workflow only ever set up Node, so the
two pip-based projects had nothing installed to resolve against. Added
actions/setup-python + pip install, mirroring what's already done for
the frontend's npm dependencies.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Per Devin Review on this PR: always() also runs a step when the job is
cancelled, and cancel-in-progress cancels superseded PR runs — so a
cancelled run could still push a snyk monitor snapshot (a persistent
record) or attempt a SARIF upload. success()||failure() runs regardless
of the Code test's pass/fail outcome (the actual intent) while still
skipping on cancellation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
`snyk code test --sarif > snyk-code.sarif` redirects ALL output into
the SARIF file, so a failing run's log shows nothing but "Process
completed with exit code 1" — no indication it's real findings vs. a
broken pipeline. --sarif-file-output writes the SARIF to disk while
still printing the normal human-readable findings list (file, line,
rule, severity) to the console.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diagnostic only — will be reverted once the failing call is identified.
Not for merge as-is.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Traced the trailing "403 Forbidden (SNYK-CLI-0000)" via -d debug
output: it's a single failed GET /rest/orgs/{id} call, where the CLI
tries to resolve the org ID into a display slug. The actual scan (POST
.../tests, result polling, findings retrieval) all succeed regardless
— this is a PAT-scope gap on a non-essential lookup, not a workflow
bug. Documented inline instead of leaving debug logging on permanently.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The CLI's only failing call was resolving SNYK_CFG_ORG's UUID into a
display slug via GET /rest/orgs/{id}, which 403s for this PAT's scopes.
Passing the slug (avibacktoblack, taken from the snyk monitor snapshot
URLs) directly should make that lookup unnecessary. Verifying with this
push before finalizing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Tested passing the org slug instead of the UUID to see if it'd skip
the GET /rest/orgs/{id} resolution call that 403s — it doesn't; the
CLI hits that endpoint regardless of which identifier format it's
given. So this is confirmed to be a PAT scope gap, not an identifier
format issue. Reverting to the UUID (more stable than a slug, which
can be renamed) and documenting the actual fix path inline.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@AviBackToBlack
AviBackToBlack merged commit b909d0d into main Jul 26, 2026
8 of 10 checks passed
@AviBackToBlack
AviBackToBlack deleted the fix/snyk-monitor-always-run branch July 26, 2026 23:57
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.

1 participant