Skip to content

ci: scan Rust with CodeQL only when a PR touches it - #423

Merged
WaylandYang merged 5 commits into
devfrom
claude/codeql-only-when-needed
Oct 31, 2026
Merged

WaylandYang merged 5 commits into
devfrom
claude/codeql-only-when-needed

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

Analyze (rust) takes about 5.5 minutes (median of the last 14 PR runs), and it ran even on docs-only PRs. Extraction took 102 s, import 33 s and queries 158 s on #420, and nothing is cached between runs. It does not block merging, but it is the last check to finish.

  • Rust: PRs scan only when they touch crates/, Cargo.toml or Cargo.lock. 25 of the last 60 merged PRs touched none of these.
  • Other languages: skipped on docs-only PRs.
  • Superseded scans: a new push to a PR cancels the scan of the last one.
  • Unchanged: every push to dev and main and the weekly run still scan everything, with the same languages and default query suite. A PR that changes Rust still takes about 5.5 minutes.

Before merging: default setup has to be turned off in Settings > Advanced Security, because code scanning rejects these uploads while it is on. Until then, the Analyze checks on this PR are expected to fail. They are not required checks, so re-run them after turning it off.

Categories match default setup's, so alerts should carry over. Check that the one open alert is still open after the first run on dev.

Tested: actionlint is clean. The workflows have not run on GitHub yet.

🤖 Generated with Claude Code

WaylandYang and others added 3 commits October 31, 2026 15:57
Rust takes about 5.5 minutes in CodeQL, nearly all of it extraction and
queries over the whole crate, with no cache to use. 25 of the last 60 PRs
touched nothing under crates/ or Cargo.*, and still waited for it.

Default setup cannot filter by path, so this moves to workflows of our own.
Rust runs on PRs that touch it, the other languages skip docs-only PRs, and
a new push to a PR cancels the scan of the last one. Pushes to dev and main
and the weekly run still scan everything. The categories match default
setup's so alerts carry over.

Default setup has to be turned off before these can upload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WaylandYang
WaylandYang merged commit f7209cf into dev Oct 31, 2026
10 checks passed
@WaylandYang
WaylandYang deleted the claude/codeql-only-when-needed branch October 31, 2026 15:48
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