Skip to content

ci(codeql): resolve sidecar crates before the Rust scan - #1352

Merged
rinchen merged 1 commit into
mainfrom
ci/codeql-rust-deps
Oct 30, 2026
Merged

rinchen merged 1 commit into
mainfrom
ci/codeql-rust-deps

Conversation

@cj-vana

@cj-vana cj-vana commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The CodeQL status page warns about Rust because the sidecar can't be fully analyzed. There are no open code scanning alerts. This is a coverage warning.

reticulum-sidecar/Cargo.toml pulls its Ratspeak crates from ../.rsstack/..., which only scripts/clone-ratspeak-stack.sh creates. Default setup can't run that script, so Cargo can't load the sidecar and its serde_json::json! and tracing macros fail to expand. On main at 98342088, the default-setup Rust job reported 35 of 102 Rust files extracted with errors (run). A Rust job from October 11 logged the same macro failures, so this predates the recent merges.

Change

  • codeql.yaml: the Rust job runs bash scripts/clone-ratspeak-stack.sh before Initialize CodeQL, the same way reticulum-sidecar.yaml does.
  • The inline CodeQL config adds paths-ignore: [.rsstack], so the cloned upstream crates resolve the sidecar without being scanned as this repo's code. GitHub supports paths-ignore for Rust analyzed without a build (docs).
  • scripts/codeql-workflow.test.mjs: covers the config, checks that the clone step runs only for Rust and before init, and checks that every sidecar path dependency lives under .rsstack/.
  • .github/codeql/README.md: a short Rust section.

What still needs a maintainer

Default setup is still the scanner that uploads, and it can't run custom steps, so the status page warning stays until the switch in .github/codeql/README.md ("Activation after the PR is merged"): disable default setup, set CODEQL_ADVANCED_ENABLED=true, then dispatch CodeQL (advanced) on main. That's a repository settings change, so this PR can't do it.

Testing

  • scripts/codeql-workflow.test.mjs: 22 passed.
  • actionlint, Prettier and markdownlint on the changed files: clean.
  • This PR's CodeQL (advanced) Rust job (run 41119532042) cloned the stack and reported 1 of 102 Rust files extracted with errors, down from 35 of 102 under default setup. The one left is a json! call in a #[cfg(not(feature = "rns-stack"))] branch (stack/mod.rs:3484), an extractor quirk rather than a missing dependency.
  • Its Rust SARIF artifact has 0 results and no artifact or result paths under .rsstack/. Default setup's Rust analysis on main also reports 0 results, so findings are unchanged.

The sidecar's Ratspeak crates are path dependencies under the gitignored
.rsstack/, which only scripts/clone-ratspeak-stack.sh creates. CodeQL
default setup cannot run it, so Cargo cannot load the sidecar and its
serde_json and tracing macros fail to expand: on main at 9834208, 35 of
102 Rust files extracted with errors, which the CodeQL status page
reports.

The advanced workflow now clones the stack for the Rust job and ignores
.rsstack/ so the upstream crates resolve the sidecar without being
scanned. The status page clears once the repository switches to the
advanced workflow (.github/codeql/README.md, activation steps).
@github-actions github-actions Bot added the chore Internal app functionality updates; non-user-facing changes and repo maintenance label Oct 30, 2026
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between df35e22 and d92a5dc.

Files selected for processing: 3
  • .github/codeql/README.md
  • .github/workflows/codeql.yaml
  • scripts/codeql-workflow.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

The CodeQL workflow now clones the Ratspeak stack before Rust analysis and excludes .rsstack from scanning. Documentation describes the default setup behavior, and tests verify the workflow configuration and sidecar path dependencies.

Changes: Rust CodeQL sidecar setup

Layer / File(s) Summary
Prepare and verify Rust analysis
.github/workflows/codeql.yaml, .github/codeql/README.md, scripts/codeql-workflow.test.mjs
The workflow clones the Ratspeak stack before CodeQL initialization and excludes .rsstack from scanning. Documentation describes the setup, and tests verify the workflow configuration and sidecar path dependencies.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: rinchen

Merge Risk: Minimal · up to d92a5

The change makes the advanced CodeQL Rust job clone the Ratspeak dependencies and exclude them from results. No concrete merge-blocking problem was found. Once the advanced workflow runs, maintainers should check the Rust extraction summary for any native-library errors.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: resolving the sidecar crates before the Rust CodeQL scan.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (2 skipped: 2 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@rinchen
rinchen merged commit c29dcab into main Oct 30, 2026
42 checks passed
@rinchen
rinchen deleted the ci/codeql-rust-deps branch October 30, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Internal app functionality updates; non-user-facing changes and repo maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants