feat: fail the Security Suite on error-severity findings#93
Conversation
Previously zizmor was fully warn-only, so a PR could 'pass' the suite with a zizmor error. Make the report job the single gate: it now exits 1 on any error-severity condition (a hard-gate fail/error, or a zizmor error-severity finding), after posting the summary comment so the result stays visible. - report job: track SUITE_FAILED in the two [!CAUTION] branches, exit 1 at the end; update the zizmor callout to say error-severity findings block. - zizmor step keeps continue-on-error (still emits annotations + counts); the report job decides blocking. Warnings/notices (and warn-only pinact) never block; bumblebee/betterleaks already block via their own jobs. - docs: add a 'What blocks a PR' table to security-suite.md. Note: once released, this blocks any repo that still has a zizmor error (org-wide) until hardened (see #87 / infra-cdk#152 for the pattern).
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR modifies the reusable security-suite workflow so the ChangesZizmor Error-Severity PR Gating
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant ZizmorStep
participant ReportJob
participant PRComment
participant CIExit
ZizmorStep->>ReportJob: emit SARIF severity counts (continue-on-error)
ReportJob->>ReportJob: set SUITE_FAILED=1 if ZIZMOR_SEV is error
ReportJob->>PRComment: post consolidated comment with blocking callout text
ReportJob->>CIExit: exit 1 if SUITE_FAILED=1
Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🛡️ Security suite
Note All security checks passed. Updated for |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/reusable-security-suite.yml (1)
222-225: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winStale "warn-only" wording now contradicts the new blocking behavior.
ZIZMOR_BREAKDOWNstill hardcodes"(warn-only; see annotations)"and the comment above still stateszizmor is warn-only. This string is used verbatim asZIZMOR_MSGin the error branch (line 234), so the posted PR comment will show something like"N error(s)... (warn-only; see annotations)"even though this PR makes error-severity findings block the PR via the newSUITE_FAILEDgate. This directly contradicts the new gating contract this PR introduces and will confuse readers of the summary comment.🛠️ Proposed fix
- # zizmor is warn-only. Show the full severity breakdown (from the - # SARIF count pass) so errors are never understated as warnings. + # Show the full severity breakdown (from the SARIF count pass) so + # errors are never understated as warnings; only error-severity + # findings actually block (see SUITE_FAILED below). ZE="${ZIZMOR_ERRORS:-0}"; ZW="${ZIZMOR_WARNINGS:-0}"; ZN="${ZIZMOR_NOTICES:-0}" - ZIZMOR_BREAKDOWN="${ZE} error(s), ${ZW} warning(s), ${ZN} notice(s) (warn-only; see annotations)" + ZIZMOR_BREAKDOWN="${ZE} error(s), ${ZW} warning(s), ${ZN} notice(s) (see annotations)"Then adjust the warn-branch message (line 236) if you still want to call out that warnings/notices specifically don't block.
Also applies to: 233-234
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/reusable-security-suite.yml around lines 222 - 225, Update the Zizmor summary text in the reusable security workflow so it no longer says “warn-only” in the error path, since `ZIZMOR_BREAKDOWN` is reused as `ZIZMOR_MSG` when `SUITE_FAILED` is set and now represents blocking error-severity findings. Edit the comment and the `ZIZMOR_BREAKDOWN` string near the severity aggregation logic so the wording reflects the new gating behavior, and keep any “warnings/notices don’t block” note only in the warn branch message if needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/reusable-security-suite.yml:
- Around line 222-225: Update the Zizmor summary text in the reusable security
workflow so it no longer says “warn-only” in the error path, since
`ZIZMOR_BREAKDOWN` is reused as `ZIZMOR_MSG` when `SUITE_FAILED` is set and now
represents blocking error-severity findings. Edit the comment and the
`ZIZMOR_BREAKDOWN` string near the severity aggregation logic so the wording
reflects the new gating behavior, and keep any “warnings/notices don’t block”
note only in the warn branch message if needed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1094f4f9-6b5c-478b-9c14-1037ea156a73
📒 Files selected for processing (2)
.github/workflows/reusable-security-suite.ymldocs/workflows/security-suite.md
Closes the "it's weird to pass with an error" gap: zizmor was fully warn-only, so a PR could pass the suite with a zizmor error.
Change
The
reportjob becomes the single gate. It now exits 1 on any error-severity condition — a hard-gate fail/error (bumblebee/betterleaks), or a zizmor error-severity finding — after posting the summary comment so the result stays visible. Warnings and notices (and warn-only pinact, and zizmor warning/notice findings) never block.continue-on-error(still emits annotations + the error/warning/notice counts); the report job decides blocking.fail-on-findingsdefaults to true); this doesn't change them.security-suite.md.Once released, this blocks any repo that still has a zizmor error org-wide until it's hardened (same pattern as #87 / infra-cdk#152). You're driving that cleanup across the ~10 repos you manage. Known next: geolonia-operations (~10 error-level findings).
After merge
Cut v1.33.0 (lightweight tag) →
@v1moves → the gate is live. Verify on a consumer PR that a zizmor-error repo now goes red and a clean one stays green.Validation:
pinact --checkOK,zizmorself-clean, no em-dashes.Summary by CodeRabbit
Bug Fixes
zizmorfindings are detected.Documentation