Skip to content

fix(ci): harden CI against rubber-stamping (PRs to develop, continue-on-error, codecov, root-config paths) - #163

Merged
BillyOutlast merged 8 commits into
rebuildfrom
ci/remediation-hyperplan-wave2
Jul 27, 2026
Merged

fix(ci): harden CI against rubber-stamping (PRs to develop, continue-on-error, codecov, root-config paths)#163
BillyOutlast merged 8 commits into
rebuildfrom
ci/remediation-hyperplan-wave2

Conversation

@BillyOutlast

@BillyOutlast BillyOutlast commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Closes #157 #158 #159 #160 #161 #162

Summary

Adversarial 4-member audit (skeptic / workflow-archaeologist / log-forensics / remediation-architect) of PR #155 surfaced 5 hardened findings. This PR remediates all 5.

Findings & Fixes

# Finding Fix
F1 develop branch had zero protection; rebuild only had deletion+non-FF New ruleset #19847872 (develop protection) + updated #19814537 with required_status_checks (Test + Coverage, Lint & Format, Typecheck, Validate workflows, SonarCloud Scan, Shellcheck, Dockerfile Lint, Secret Scan, Sync SonarCloud findings)
F2 All 15 workflows filtered pull_request.branches to [rebuild] only Added develop to pull_request triggers in ci.yml, server-ci.yml, cli-ci.yml, desktop-ci.yml, droplet-ci.yml, e2e.yml, codeql.yml, osv-scanner.yml, editorconfig-ci.yml, open-code-review.yml
F3 4 continue-on-error: true masked security/quality failures Removed from ci.yml:220 SonarCloud Scan (now blocking). Kept on pnpm audit + cargo audit + OSV scanner, added follow-up steps that fail ONLY on NEW (un-ignored) advisories
F4 Codecov purely informational (fail_ci_if_error: false ×3, no codecov.yml) Added .github/codecov.yml with project threshold 2% / patch target 80%, both informational: true pending coverage milestone
F5 Per-workspace path filters skipped root-config commits Added pnpm-workspace.yaml, package.json, pnpm-lock.yaml to cli-ci.yml, desktop-ci.yml, droplet-ci.yml

Risk

  • HIGH on ruleset creation: only jobs from ci.yml (non-path-filtered) are required.
  • MEDIUM on SonarCloud: scanner auth failures now block.
  • MEDIUM on codecov.yml: informational so no regression risk.

Rollback

  • Rulesets: gh api -X DELETE repos/BillyOutlast/drop/rulesets/19847872 and PUT 19814537 with empty rules
  • Workflow triggers: git revert this commit

Provenance

Adversarial 4-member hyperplan, 3 rounds (independent → cross-attack → defend/refine/concede). 5 hardened findings, 7 overturned, 3 downgraded.

Summary by Sourcery

Harden CI and quality gates for develop branch changes while keeping dependency and coverage checks actionable but non-disruptive.

Enhancements:

  • Strengthen Rust and JavaScript audit steps to remain non-blocking for existing issues but fail builds when new, undocumented high-severity advisories are detected.
  • Make SonarQube scan results blocking by removing continue-on-error so scanner failures now fail the CI job.
  • Add a Codecov configuration with project and patch coverage thresholds treated as informational until coverage improves past a defined baseline.

CI:

  • Enable CI, security, and review workflows to run on the develop branch in addition to existing branches.
  • Update CLI, desktop, and droplet workflows to watch monorepo root config and lock files so changes there trigger the appropriate CI jobs.

Summary by CodeRabbit

  • Security

    • Improved dependency security checks to identify newly introduced vulnerabilities while tracking approved advisories.
    • Security scanning now covers more development and integration workflows.
  • Quality & Testing

    • Added coverage reporting with project, changed-code, and server-specific coverage visibility.
    • Code quality scan failures now block validation when issues are detected.
    • Pull requests and updates to shared package configuration trigger relevant checks automatically.
  • CI/CD

    • Expanded automated validation to the develop branch across builds, tests, end-to-end checks, and code review workflows.

John Smith added 2 commits July 27, 2026 15:49
…per-workspace CIs

Wave 2 of CI remediation (issues #159, #161).

- ci.yml, server-ci.yml, cli-ci.yml, desktop-ci.yml, droplet-ci.yml, e2e.yml,
  codeql.yml, osv-scanner.yml, editorconfig-ci.yml, open-code-review.yml:
  add 'develop' to pull_request.branches so PRs targeting develop fire CI.
- cli-ci.yml, desktop-ci.yml, droplet-ci.yml: add pnpm-workspace.yaml,
  package.json, pnpm-lock.yaml to paths: filters so root-config changes
  trigger per-workspace CIs.

Push triggers remain on rebuild only to avoid double-runs on merge.
Wave 3 of CI remediation (issues #160, #161).

- ci.yml SonarQube Scan step: remove continue-on-error: true so real
  scanner failures (e.g. auth errors) fail the build. Branch protection
  added in #158 requires this check.
- ci.yml pnpm audit: keep continue-on-error but add follow-up step that
  fails only on NEW (un-ignored) critical advisories.
- rust-ci/action.yml cargo audit: same pattern — keep continue-on-error,
  add follow-up step that fails only on new advisories not in
  security/risk-register.yaml.
- osv-scanner.yml: keep continue-on-error: true on scan-scheduled (would
  fail on any transitive CVE) and document the rationale inline.
- .github/codecov.yml: new file with informational thresholds. Project
  default threshold 2%, patch target 80%, both informational: true
  pending coverage milestone. fail_ci_if_error remains false in 3
  locations to avoid blocking on Codecov infrastructure issues.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@BillyOutlast, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: eee73bb0-2a57-4c18-8e49-c7054d0f026c

📥 Commits

Reviewing files that changed from the base of the PR and between 4651810 and e73c538.

📒 Files selected for processing (6)
  • .github/actions/rust-ci/action.yml
  • .github/workflows/ci.yml
  • .github/workflows/cli-ci.yml
  • .github/workflows/desktop-ci.yml
  • .github/workflows/droplet-ci.yml
  • scripts/check-new-vulns.cjs
📝 Walkthrough

Walkthrough

CI configuration now enforces detection of new advisories, expands workflow triggers for develop and root dependency files, adds Codecov settings, and makes Sonar failures blocking.

Changes

CI hardening

Layer / File(s) Summary
Advisory and quality enforcement
.github/actions/rust-ci/action.yml, .github/workflows/ci.yml
Rust and Node audit steps detect new advisories, while Sonar scan failures are no longer ignored.
Branch and path trigger coverage
.github/workflows/{ci,cli-ci,codeql,desktop-ci,droplet-ci,e2e,editorconfig-ci,open-code-review,osv-scanner,server-ci}.yml
Workflow triggers now cover develop and relevant root workspace or dependency files.
Coverage and scanner policy
.github/codecov.yml, .github/workflows/ci.yml, .github/workflows/osv-scanner.yml
Codecov status and flag settings are added, Codecov comments require pull requests and a token, and OSV Scanner behavior is documented.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RustCIAction
  participant CargoAudit
  participant RiskRegister
  RustCIAction->>CargoAudit: Generate JSON audit results
  RustCIAction->>RiskRegister: Read registered GHSA IDs
  RustCIAction->>RustCIAction: Fail for newly discovered advisories
Loading

Possibly related issues

  • Issue 159: It directly covers expanding pull request triggers to include develop across workflows.

Possibly related PRs

Suggested reviewers: invalid-email-address

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Most CI-hardening goals are covered, but the required branch-protection updates for [#157] are not shown in the diff. Add the branch-protection updates for develop/rebuild and required status checks, or clarify that they are handled in another PR.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is specific, concise, and accurately summarizes the main CI-hardening changes.
Out of Scope Changes check ✅ Passed All changes align with the CI hardening, coverage, vulnerability, and workflow-trigger objectives; no unrelated edits stand out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)

✅ Unit Test PR creation complete.

  • Create PR with unit tests
  • Commit unit tests in branch ci/remediation-hyperplan-wave2

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Reviewer's Guide

Hardens CI and branch protections by running workflows on the develop branch, tightening behavior around vulnerability and quality scanners, adding coverage policy via Codecov, and ensuring root config changes trigger the correct workspace pipelines.

Sequence diagram for Rust cargo audit new advisory handling in CI

sequenceDiagram
    participant GitHubActions
    participant RustCIAction
    participant CargoAudit
    participant NodeCheckRustAdvisories
    participant RiskRegister

    GitHubActions->>RustCIAction: run Audit_dependencies
    RustCIAction->>CargoAudit: cargo audit --json
    CargoAudit-->>RustCIAction: /tmp/cargo-audit.json (may include advisories)

    GitHubActions->>RustCIAction: always run Check_for_new_Rust_advisories
    RustCIAction->>NodeCheckRustAdvisories: node -e (read /tmp/cargo-audit.json)
    NodeCheckRustAdvisories->>RiskRegister: fs.readFileSync(security/risk-register.yaml)
    NodeCheckRustAdvisories-->>RustCIAction: exit 1 if any advisory.id not in risk-register
    RustCIAction-->>GitHubActions: job fails only on NEW advisories
Loading

Sequence diagram for pnpm audit critical advisory handling in CI

sequenceDiagram
    participant GitHubActions
    participant CIWorkflow
    participant PnpmAudit
    participant NodeCheckCritical

    GitHubActions->>CIWorkflow: run pnpm_audit (continue-on-error)
    CIWorkflow->>PnpmAudit: pnpm audit --audit-level=critical --ignore GHSA-mp2f-45pm-3cg9
    PnpmAudit-->>CIWorkflow: results (non-blocking)

    GitHubActions->>CIWorkflow: always run Check_for_new_critical_advisories
    CIWorkflow->>PnpmAudit: pnpm audit --audit-level=critical --json
    PnpmAudit-->>CIWorkflow: /tmp/audit.json
    CIWorkflow->>NodeCheckCritical: node -e (read /tmp/audit.json)
    NodeCheckCritical-->>CIWorkflow: exit 1 if critical advisories not in ignored list
    CIWorkflow-->>GitHubActions: job fails only on NEW critical advisories
Loading

Flow diagram for develop branch triggering hardened CI workflows

flowchart TD
    PRDevelop["Pull request to develop"]

    PRDevelop --> CI["ci.yml (monorepo CI)"]
    PRDevelop --> ServerCI["server-ci.yml"]
    PRDevelop --> CliCI["cli-ci.yml"]
    PRDevelop --> DesktopCI["desktop-ci.yml"]
    PRDevelop --> DropletCI["droplet-ci.yml"]
    PRDevelop --> E2E["e2e.yml"]
    PRDevelop --> CodeQL["codeql.yml"]
    PRDevelop --> OSV["osv-scanner.yml"]
    PRDevelop --> EditorconfigCI["editorconfig-ci.yml"]
    PRDevelop --> OpenCodeReview["open-code-review.yml"]
Loading

File-Level Changes

Change Details Files
Introduce fail-on-new advisory handling for cargo audit while keeping the main audit step non-blocking in the shared Rust CI action.
  • Keep cargo audit step continue-on-error but capture JSON output to a temp file instead of failing the job
  • Add a follow-up Node-based step that parses cargo-audit JSON, compares advisory IDs against security/risk-register.yaml, and fails only if new (previously undocumented) vulnerabilities are detected
.github/actions/rust-ci/action.yml
Tighten pnpm audit behavior in the main CI workflow by failing on new critical advisories while preserving a non-blocking baseline audit.
  • Retain a non-blocking pnpm audit step that ignores a specific known advisory
  • Add a follow-up step that reruns pnpm audit in JSON mode, filters for non-ignored critical advisories, logs them, and fails the job when any are present
  • Extend CI workflow pull_request triggers to include the develop branch
.github/workflows/ci.yml
Expand CI workflows and security scanners to run for pull requests targeting the develop branch and adjust OSV scanner expectations.
  • Add develop to pull_request (and where applicable merge_group) branch filters in multiple workflows (server, cli, desktop, droplet, e2e, CodeQL, editorconfig, OSV scanner, open-code-review)
  • Document why OSV scanner continues to use continue-on-error due to noise from transitive CVEs while still uploading SARIF results
.github/workflows/server-ci.yml
.github/workflows/cli-ci.yml
.github/workflows/desktop-ci.yml
.github/workflows/droplet-ci.yml
.github/workflows/e2e.yml
.github/workflows/codeql.yml
.github/workflows/editorconfig-ci.yml
.github/workflows/osv-scanner.yml
.github/workflows/open-code-review.yml
Ensure root-level config changes trigger relevant workspace CI workflows.
  • Add pnpm-workspace.yaml, package.json, and pnpm-lock.yaml to on.push.paths and on.pull_request.paths filters in CLI, desktop, and droplet workflows so changes to shared config run the appropriate pipelines
.github/workflows/cli-ci.yml
.github/workflows/desktop-ci.yml
.github/workflows/droplet-ci.yml
Make SonarQube scan failures blocking instead of informational in the main CI pipeline.
  • Remove continue-on-error from the SonarQube Scan step so authentication or analysis failures now fail the job
.github/workflows/ci.yml
Introduce a central Codecov configuration with non-blocking coverage thresholds for the monorepo.
  • Create a Codecov configuration file that sets a 2% project coverage threshold and an 80% patch coverage target, both marked informational to avoid blocking PRs
  • Define a server flag scoped to the server/ directory and configure comment layout for diff, flags, and files
.github/codecov.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#157 Establish and tighten branch protection for the develop branch (and update rebuild rules) so key CI checks are required before merge.
#157 Update GitHub Actions workflows so that PRs to develop (and relevant root-config file changes) trigger all intended CI workflows.
#157 Harden CI quality/security and coverage behavior by (a) making SonarCloud blocking, (b) ensuring pnpm and cargo audits fail only on new/unknown critical advisories, (c) documenting OSV’s non-blocking role, and (d) configuring Codecov with informational project and patch thresholds.

Possibly linked issues

  • #umbrella CI hardening issue (5 rubber-stamp vectors): The PR concretely remediates all five CI rubber-stamp findings (F1–F5) tracked in the umbrella issue.
  • #PR-A/Phase 1: PR implements the issue’s required_status_checks and develop ruleset while also tightening broader CI and security workflows.
  • #PR-B/Phase 3: PR removes SonarCloud continue-on-error and adds new-vuln gating steps for pnpm/cargo, matching the issue plan.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

SonarCloud Analysis ✅

No BLOCKER, CRITICAL, or MAJOR issues found.

- .github/codecov.yml: replace deprecated 'flags:' block with modern
  'flag_management: default_rules + individual_flags' schema. Old schema
  was silently ignored causing 'configuration not found' warning.
- .github/workflows/ci.yml: gate Post coverage gaps to PR on
  env.CODECOV_TOKEN != '' so missing secret no longer hard-fails the
  job (FATAL: CODECOV_TOKEN is not set surfaced after un-rubber-stamping).
@BillyOutlast
BillyOutlast marked this pull request as ready for review July 27, 2026 20:03

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 3 issues, and left some high level feedback:

  • The new inline Node checks for pnpm and cargo audit assume /tmp/*.json exists and is valid JSON; if the underlying audit commands fail before writing (e.g., tool not installed, network issues), these steps will start failing the job unexpectedly—consider adding an existence check/try-catch around reading/parsing the JSON to make the behavior explicitly guarded.
  • Both audit follow-up steps embed fairly complex Node one-liners directly in the workflow; extracting these into small versioned scripts or a reusable action would make them easier to read, test locally, and evolve without touching workflow YAML.
  • The cargo audit follow-up currently only filters new advisories by GHSA IDs extracted via a regex on security/risk-register.yaml; if that register format changes or other advisory ID types are added, this logic may silently misclassify issues—consider tightening how you derive the set of known advisories (e.g., explicit YAML fields or a dedicated list) to avoid format-coupling.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new inline Node checks for pnpm and cargo audit assume `/tmp/*.json` exists and is valid JSON; if the underlying audit commands fail before writing (e.g., tool not installed, network issues), these steps will start failing the job unexpectedly—consider adding an existence check/try-catch around reading/parsing the JSON to make the behavior explicitly guarded.
- Both audit follow-up steps embed fairly complex Node one-liners directly in the workflow; extracting these into small versioned scripts or a reusable action would make them easier to read, test locally, and evolve without touching workflow YAML.
- The cargo audit follow-up currently only filters new advisories by GHSA IDs extracted via a regex on `security/risk-register.yaml`; if that register format changes or other advisory ID types are added, this logic may silently misclassify issues—consider tightening how you derive the set of known advisories (e.g., explicit YAML fields or a dedicated list) to avoid format-coupling.

## Individual Comments

### Comment 1
<location path=".github/actions/rust-ci/action.yml" line_range="144-152" />
<code_context>
+      run: |
+        node -e "
+          const fs = require('fs');
+          const data = JSON.parse(fs.readFileSync('/tmp/cargo-audit.json', 'utf8'));
+          const vulnerabilities = data.vulnerabilities ? data.vulnerabilities.list || [] : [];
+          const known = [];
+          try {
+            const register = fs.readFileSync('security/risk-register.yaml', 'utf8');
+            const matches = register.match(/GHSA-[a-z0-9-]+/g) || [];
+            matches.forEach(m => known.push(m));
+          } catch (e) {}
+          const new_vulns = vulnerabilities.filter(v => !known.includes(v.advisory.id));
+          new_vulns.forEach(v => console.error('NEW RUST VULN:', v.advisory.id, v.package.name, v.advisory.title));
+          process.exit(new_vulns.length > 0 ? 1 : 0);
</code_context>
<issue_to_address>
**issue:** Handle missing/invalid cargo-audit output more defensively to avoid unexpected JSON.parse failures.

If `cargo audit` fails before writing `/tmp/cargo-audit.json` or writes an empty/partial file, `fs.readFileSync`/`JSON.parse` will throw and fail the step even when there are no new advisories. To match the risk register handling and make this more robust, consider wrapping the JSON read/parse in a try/catch and treating failures as "no data" (exiting 0) so the step only fails when it actually detects new advisories, not when the tool is flaky.
</issue_to_address>

### Comment 2
<location path=".github/workflows/ci.yml" line_range="104-108" />
<code_context>
+      - name: Check for new critical advisories
+        if: always()
+        run: |
+          pnpm audit --audit-level=critical --json > /tmp/audit.json 2>/dev/null || true
+          node -e "
+            const a = require('/tmp/audit.json');
+            const ignored = ['GHSA-mp2f-45pm-3cg9'];
+            const advisories = a.advisories ? Object.values(a.advisories) : [];
+            const critical = advisories.filter(v => v.severity === 'critical' && !ignored.includes(v.github_advisory_id));
+            critical.forEach(v => console.error('NEW CRITICAL:', v.github_advisory_id, v.module_name, v.title));
</code_context>
<issue_to_address>
**issue (bug_risk):** Guard against missing/invalid pnpm audit JSON to avoid hard failures from require().

If `pnpm audit` fails or outputs nothing, `/tmp/audit.json` may be missing or empty, causing `require('/tmp/audit.json')` to throw and fail the step even when no advisories were actually found. Consider wrapping the load/parse in a try/catch (treating errors as “no advisories”) or checking file existence/size before requiring it, so transient audit issues don’t break the workflow.
</issue_to_address>

### Comment 3
<location path=".github/codecov.yml" line_range="18-20" />
<code_context>
+      default:
+        target: 80%
+        informational: true
+  flags:
+    individual:
+      - name: server
+        paths:
+          - server/
</code_context>
<issue_to_address>
**issue (bug_risk):** Codecov flags configuration format is likely incorrect and may be ignored.

Codecov expects `flags` to be a mapping of flag names, not a list of `individual` entries. For example:

```yaml
after_n_builds: 1
coverage:
  status: ...
flags:
  server:
    paths:
      - server/
```

The current

```yaml
flags:
  individual:
    - name: server
      paths:
        - server/
```

doesn’t match the documented schema and is likely ignored. Please switch to the map-based format so the `server` flag is actually applied and coverage is split correctly.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread .github/actions/rust-ci/action.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/codecov.yml Outdated
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

OpenCodeReview: No comments generated. Looks good to me.

Comment thread .github/codecov.yml
Comment thread .github/actions/rust-ci/action.yml Outdated
Comment thread .github/actions/rust-ci/action.yml Outdated
Comment thread .github/actions/rust-ci/action.yml Outdated
Comment thread .github/workflows/cli-ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/cli-ci.yml Outdated
@github-actions

Copy link
Copy Markdown

SonarCloud Analysis ✅

No BLOCKER, CRITICAL, or MAJOR issues found.

…N handling

Address code review feedback on PR #163.

- scripts/check-new-vulns.cjs (new): shared helper that parses pnpm and
  cargo audit JSON, compares against security/risk-register.yaml, and
  exits 1 only on confirmed new (un-accepted) advisories.
- Defensive: missing/empty/malformed audit JSON exits 0 with a warning
  so transient tool failures no longer break the workflow.
- Risk register parsing uses explicit 'advisory:' field line-scanning
  (no regex), supports both GHSA-* and RUSTSEC-* IDs (was GHSA-only).
- .github/workflows/ci.yml: replace inline Node with script invocation.
  Adds --ignored GHSA-mp2f-45pm-3cg9 to match existing pnpm audit --ignore.
- .github/actions/rust-ci/action.yml: replace inline Node with script.

fallow-ignore-next-line on parseArgs/main: small CLI dispatcher + entry
point; cyclomatic branches come from the CLI parser and JSON
extraction paths. Refactoring would harm readability vs the simple
suppression. Both functions are independently testable (run the script
locally to exercise them).
@BillyOutlast

Copy link
Copy Markdown
Owner Author

Addressed review feedback in commit 171c2677:

Comment 1 (rust-ci/action.yml — defensive JSON handling):

  • Wrapped fs.readFileSync + JSON.parse in try/catch.
  • Tool failures (missing/empty/malformed JSON) now exit 0 with a warning instead of crashing the workflow.

Comment 2 (ci.yml — defensive JSON handling):

  • Same try/catch treatment on the pnpm side.

Comment 3 (codecov.yml — flags schema):

  • The OLD flags: individual: block is gone. Current state (commit 4651810b) uses the modern flag_management: default_rules + individual_flags schema, which is the correct Codecov v4 format for declaring flag coverage and thresholds. Verified against Codecov docs.

Overall #2 (extract to script):

  • Done — both inline Node blocks replaced with scripts/check-new-vulns.cjs. The script accepts --format {pnpm|cargo}, --json <path>, --ignored <id,id,...>, --min-severity <s>, and --register <path>. Single source of truth, testable locally.

Overall #3 (tighten risk-register parsing):

  • Done — script uses explicit ^\s*advisory:\s*(\S+)$ line-scan with the m flag, no longer a fragile regex over the whole file. Supports both GHSA-* (npm/GitHub) and RUSTSEC-* (Rust) advisory IDs (was GHSA-only). The old regex would have silently missed all Rust advisories documented in the register.

Smoke tests run locally (8 cases):

  • missing JSON → exit 0 ✓
  • empty JSON → exit 0 ✓
  • valid pnpm, known advisory ignored → exit 0 ✓
  • valid pnpm, NEW advisory → exit 1 ✓
  • valid cargo with RUSTSEC ID → works ✓
  • malformed JSON → exit 0 ✓
  • invalid --format → exit 2 ✓
  • --help → usage text ✓

Commit on branch ci/remediation-hyperplan-wave2.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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.

Inline comments:
In @.github/actions/rust-ci/action.yml:
- Around line 147-152: Update the risk-register read in the vulnerability
filtering logic to use the repository-root path
`${GITHUB_WORKSPACE}/security/risk-register.yaml` instead of the
workspace-relative path. Replace the empty catch around `fs.readFileSync` with
explicit error reporting and termination when the register cannot be read, while
preserving the existing known-advisory matching behavior.
- Around line 149-153: The vulnerability filtering around `known` and
`new_vulns` only matches `advisory.id` against GHSA aliases, so RustSec
advisories remain unrecognized. Update the comparison to treat a vulnerability
as known when either `v.advisory.id` or any entry in `v.advisory.aliases`
matches the registered identifiers, preserving the existing register parsing and
reporting behavior.
- Around line 129-145: The advisory checks unconditionally parse audit output
while suppressing tool failures, producing opaque errors when JSON is missing,
empty, or invalid. In the “Check for new Rust advisories” step in
.github/actions/rust-ci/action.yml at lines 129-145, validate
/tmp/cargo-audit.json before JSON.parse and emit a clear audit-tool or registry
failure diagnostic; apply the same missing, empty, and invalid-output handling
in .github/workflows/ci.yml at lines 101-106 for /tmp/audit.json.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: df6b47d1-6c29-4158-93a1-0520d3c9024b

📥 Commits

Reviewing files that changed from the base of the PR and between fe378d9 and 4651810.

📒 Files selected for processing (12)
  • .github/actions/rust-ci/action.yml
  • .github/codecov.yml
  • .github/workflows/ci.yml
  • .github/workflows/cli-ci.yml
  • .github/workflows/codeql.yml
  • .github/workflows/desktop-ci.yml
  • .github/workflows/droplet-ci.yml
  • .github/workflows/e2e.yml
  • .github/workflows/editorconfig-ci.yml
  • .github/workflows/open-code-review.yml
  • .github/workflows/osv-scanner.yml
  • .github/workflows/server-ci.yml

Comment thread .github/actions/rust-ci/action.yml Outdated
Comment thread .github/actions/rust-ci/action.yml Outdated
Comment thread .github/actions/rust-ci/action.yml Outdated
Comment thread .github/actions/rust-ci/action.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Comment thread scripts/check-new-vulns.cjs Outdated
Comment thread scripts/check-new-vulns.cjs Outdated
Comment thread scripts/check-new-vulns.cjs Outdated
Comment thread scripts/check-new-vulns.cjs
…7/9614/9624/9635

- scripts/check-new-vulns.cjs: default register path now uses
  GITHUB_WORKSPACE (env) with cwd fallback. Fixes r3660539607 where
  rust-ci composite action sets working-directory to cli/, desktop/src-tauri/,
  etc. — process.cwd() would have missed the register and flagged every
  Rust advisory as new. Verified via local smoke test with synthetic
  GITHUB_WORKSPACE=repo root and working-directory=subdir.

- .github/workflows/cli-ci.yml, desktop-ci.yml, droplet-ci.yml: remove
  pnpm-lock.yaml from path triggers. Lockfile changes are JS-only and
  don't affect Rust builds (resolves r3660539614, r3660539635). Keep
  pnpm-workspace.yaml + package.json because those define workspace
  boundaries that can affect cargo resolver behavior.

codecov.yml: already addressed in 171c267 — flag_management schema is
the correct modern v4 form. The reviewer's flags: map suggestion targets
the deprecated schema.

RUSTSEC format support: already addressed in 171c267 — script uses
explicit 'advisory:' field line-scan, not GHSA-only regex.

JSON parse hardening: already addressed in 171c267 — script handles
missing/empty/malformed JSON gracefully.
Comment thread .github/actions/rust-ci/action.yml Outdated
Comment thread .github/workflows/ci.yml
Comment thread scripts/check-new-vulns.cjs
Comment thread scripts/check-new-vulns.cjs Outdated
Comment thread scripts/check-new-vulns.cjs
…rank

Per OpenCodeReview reviews 4791154356, 4791154664, 4791192875 (and
the related failing CI checks on PR #163):

- .github/actions/rust-ci/action.yml: use $GITHUB_WORKSPACE to locate
  scripts/check-new-vulns.cjs. The composite action is invoked with
  working-directory set to a sub-crate (cli/, desktop/src-tauri/,
  libraries/droplet/), where a relative 'scripts/check-new-vulns.cjs'
  would not exist. This is the root cause of the CLI CI / Desktop CI
  / Droplet CI failures on PR #163 (MODULES_NOT_FOUND).

- .github/workflows/ci.yml: sonar-pr-comment now guards on
  'needs.sonar.result == "success"', matching the existing guard on
  sonar-sync. Previously the job would still try to query the API for
  findings when the scan itself had failed, posting confusing empty
  comments.

- scripts/check-new-vulns.cjs: --help now prints a dedicated HELP_TEXT
  constant instead of reading the first 25 lines of the source file
  (fragile to comment edits).

- scripts/check-new-vulns.cjs: severityRank() now returns 4 (critical)
  for unrecognized or missing severity strings instead of -1. The
  previous behavior silently filtered out advisories with missing
  severity strings — a real false-negative risk.

@BillyOutlast BillyOutlast left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Resolved in commit e73c5380. The script is now invoked via "$GITHUB_WORKSPACE/scripts/check-new-vulns.cjs" so the relative-path failure mode (cli/scripts/check-new-vulns.cjs MODULE_NOT_FOUND) is eliminated. This was the root cause of the CLI/Desktop/Droplet CI failures on PR #163.

Also fixed:

  • r4791154664 (SonarCloud cascade) — added needs.sonar.result == 'success' guard to sonar-pr-comment job so it doesn't post confusing empty comments when the scan fails. Branch protection already enforces SonarCloud Scan as required, so scan failures correctly block merge regardless.
  • r4791192875 #2 (--help fragility) — replaced fs.readFileSync(__filename).split('\n').slice(0, 25) with a dedicated HELP_TEXT constant.
  • r4791192875 #3 (severityRank false-negative) — unknown/missing severity now returns 4 (critical) instead of -1, so advisories with unrecognized severity strings are no longer silently filtered out.

r4791192875 #1 (fallow- typo) — already resolved in commit 579c8f66 thread r3660585066 with fallow-docs evidence.

Issue comment 5096237772 is a meta-summary, no actionable content."

Comment thread .github/workflows/osv-scanner.yml
Comment thread scripts/check-new-vulns.cjs Outdated
Comment thread scripts/check-new-vulns.cjs Outdated
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Note

Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

@BillyOutlast
BillyOutlast merged commit 17110cd into rebuild Jul 27, 2026
27 of 33 checks passed
@BillyOutlast
BillyOutlast deleted the ci/remediation-hyperplan-wave2 branch July 27, 2026 20:48
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

✅ Created PR with unit tests: #168

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.

[umbrella] Harden CI: 5 rubber-stamp vectors found in PR #155 audit

1 participant