Skip to content

ci: cache Rust deps/rustc for the CodeQL rust job - #2159

Merged
shm11C3 merged 1 commit into
developfrom
feature/sweet-colden-d3ef66
Sep 16, 2026
Merged

shm11C3 merged 1 commit into
developfrom
feature/sweet-colden-d3ef66

Conversation

@shm11C3

@shm11C3 shm11C3 commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Analyze (rust) in codeql.yml runs build-mode: none, which is Rust's only supported build mode with CodeQL (manual/autobuild aren't available for Rust). Under none, CodeQL's docs say it "uses rust-analyzer to compile and run build scripts (build.rs files) and compile macro code" — it still shells out to cargo/rustc for most of the workspace's build-dependency and proc-macro closure, just without a final link.
  • With no toolchain pin, no registry cache, and no rustc-level cache, that job cold-compiles the workspace every run: 19m in CI run 35124428510, vs ~1m for the javascript-typescript/actions legs of the same matrix. This pattern holds across other recent develop runs.
  • CodeQL's own built-in dependency-caching input explicitly does not cover Rust (only Java, Go, C#), so that official escape hatch doesn't apply here.
  • Fix: reuse this repo's existing ./.github/actions/setup-rust and ./.github/actions/cache-duckdb (sccache) composite actions in the rust matrix leg only, under their own codeql-rust cache key — the same pattern ci.yml's lint-core/test-core/lint-tauri jobs already use. duckdb-archive isn't a default Cargo feature, so this doesn't touch the DuckDB C++ build cache-duckdb was originally written for; the win here is from caching ordinary dependency and proc-macro compilation instead.
  • No new secrets or infra: everything routes through the plain actions/cache backend already used by ci.yml.

Test plan

  • Watch the next Analyze (rust) run on this PR/branch for wall-clock time and sccache hit-rate stats to confirm the cache is actually exercised by CodeQL's internal rust-analyzer invocation (this can't be verified without a real run).
  • If confirmed effective, follow up with a docs/development/local-build-cache.md entry documenting the measured before/after, matching this repo's evidence-backed documentation convention.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated Rust code analysis workflows to use standardized Rust setup and caching configuration.

CodeQL's build-mode: none for Rust still shells out via rust-analyzer
to compile build scripts and proc-macro crates across most of the
workspace's dependency graph, with no toolchain pin, registry cache,
or rustc-level cache today (Analyze (rust) took 19m in run
35124428510 vs ~1m for the other two matrix languages). Rust has no
build-mode: manual/autobuild to fall back to, and CodeQL's own
dependency-caching input explicitly excludes Rust, so reuse this
repo's existing setup-rust/cache-duckdb (sccache) composite actions
under a dedicated codeql-rust cache key, the same way ci.yml's
lint-core/test-core/lint-tauri jobs already do.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-16T17:54:16.679140Z 83d6df0 PR opened
🔒 Security Review ✅ Completed 2026-09-16T17:56:11.850175Z 83d6df0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Team

Run ID: 7e3a6585-e92f-48ad-a299-6bd201710139

📥 Commits

Reviewing files that changed from the base of the PR and between 6ea945d and 83d6df0.

📒 Files selected for processing (1)
  • .github/workflows/codeql.yml

Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The CodeQL workflow now prepares Rust jobs with the repository’s Rust setup action and compiler cache. JavaScript/TypeScript and Actions jobs remain unchanged.

Changes

Rust CodeQL workflow

Layer / File(s) Summary
Rust setup and compiler caching
.github/workflows/codeql.yml
Rust jobs run setup-rust with no extra components, then use cache-duckdb with the codeql-rust key before CodeQL initialization. Other matrix languages skip these steps.

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to 83d6d

The Rust CodeQL cache setup is correctly scoped and ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides a detailed summary and a proposed test plan, but it omits the Related Issues and Type of Change sections. The checklist is also entirely unchecked, and the test plan describes… Add the missing template sections, select the applicable change type, provide related issue information or state that none applies, and update the test plan and checklist with completed validation results before merging.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: caching Rust dependencies and rustc artifacts for the CodeQL Rust job.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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: Description check

Explanation

The description provides a detailed summary and a proposed test plan, but it omits the Related Issues and Type of Change sections. The checklist is also entirely unchecked, and the test plan describes future validation rather than completed testing.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/sweet-colden-d3ef66

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

@github-actions github-actions Bot added change:feature PR: feature branch work change:ci PR: CI, GitHub Actions, or repository automation changes area:github-actions Area: GitHub Actions workflows, actions, or scripts labels Sep 16, 2026
@shm11C3
shm11C3 enabled auto-merge (squash) September 16, 2026 17:52
@shm11C3
shm11C3 merged commit 247f104 into develop Sep 16, 2026
32 checks passed
@shm11C3
shm11C3 deleted the feature/sweet-colden-d3ef66 branch September 16, 2026 18:10
shm11C3 added a commit that referenced this pull request Sep 17, 2026
#2151 renamed .github/actions/cache-duckdb to cache-sccache and changed its inputs to the R2 bucket credentials, while #2159 added a CodeQL step that still referenced cache-duckdb with the old cache-key input. Every Analyze (rust) run on develop and on pull requests has failed since with "Can't find action.yml under .github/actions/cache-duckdb". Use the renamed action with the same inputs ci.yml passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:github-actions Area: GitHub Actions workflows, actions, or scripts change:ci PR: CI, GitHub Actions, or repository automation changes change:feature PR: feature branch work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant