Skip to content

docs: correct the stale --error comment in the semgrep job - #9

Merged
arootroatch merged 1 commit into
masterfrom
fix-stale-error-comment
Jul 28, 2026
Merged

docs: correct the stale --error comment in the semgrep job#9
arootroatch merged 1 commit into
masterfrom
fix-stale-error-comment

Conversation

@arootroatch

Copy link
Copy Markdown
Collaborator

Follow-up to review feedback that a comment had gone stale. It had — the
opposite file, and the opposite direction from the one flagged.

cc-generic-catch.yaml's comment is accurate. --error was removed in #5
when report-sarif.sh took over the exit decision, and that script counts only
error-level results. WARNING rules genuinely do not gate the build.

security.yml was the stale one, still asserting the removed flag:

semgrep ALWAYS runs with --error, so any finding turns this job red

That described the opposite of the behaviour and implied the WARNING rules block.
Replaced with the two gates stated separately, since conflating them is the easy
mistake:

  1. Which findings turn the job redbin/report-sarif.sh, error-level only,
    suppressed excluded.
  2. Whether a red job blocks the callercontinue-on-error /
    semgrep-blocking.

Plus a note that semgrep's own "Blocking" label in its console summary is its
policy tag and affects neither.

Regression guard

Re-adding --error is a one-word change with two silent consequences: semgrep
exits non-zero on any finding, and under set -e that kills the step before
report-sarif.sh runs — so the WARNING rules start blocking and the findings
table disappears.

bin/test-report-sarif.sh now asserts the flag is absent and the reporter is
invoked. Mutation-checked by re-adding the flag and confirming the test fails.

Swept the rest of the repo: all three WARNING rules describe themselves
accurately, and the only remaining --error mentions are this explanation and an
accurate historical note.

🤖 Generated with Claude Code

The job comment still claimed "semgrep ALWAYS runs with --error, so any finding
turns this job red". That flag was removed when the SARIF reporter took over the
exit decision, so the comment described the opposite of the behaviour and
implied the WARNING rules gate builds.

Replaced with the two gates spelled out separately, since conflating them is the
easy mistake: bin/report-sarif.sh decides WHICH findings turn the job red (error
level only, suppressed excluded), and continue-on-error decides whether that red
BLOCKS the caller. Also notes that semgrep's own "Blocking" label in its console
summary is its policy tag and affects neither.

Adds a regression guard. Re-adding --error would make semgrep exit non-zero on
any finding, and under set -e that kills the step before report-sarif.sh runs —
silently making the WARNING rules blocking and deleting the findings table.
bin/test-report-sarif.sh now asserts the flag is absent and the reporter is
called; mutation-checked by re-adding the flag and watching it fail.

Swept the rest: the three WARNING rules describe themselves accurately, and the
remaining --error mentions are this explanation and an accurate historical note.
@arootroatch
arootroatch merged commit 9766e7c into master Jul 28, 2026
10 checks passed
@arootroatch
arootroatch deleted the fix-stale-error-comment branch July 28, 2026 18:14
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