Skip to content

CI: revive CodeQL — v3 action, build-mode none, wired to PRs + weekly cron#3104

Merged
borisbat merged 2 commits into
masterfrom
bbatkin/codeql-scanning
Jun 11, 2026
Merged

CI: revive CodeQL — v3 action, build-mode none, wired to PRs + weekly cron#3104
borisbat merged 2 commits into
masterfrom
bbatkin/codeql-scanning

Conversation

@borisbat

Copy link
Copy Markdown
Collaborator

What

Rewrites the dormant .github/workflows/codeql.yml. The existing file was the stock GitHub template parked on workflow_dispatch-only — it never triggered automatically, and it sits on codeql-action@v2, which GitHub has since sunset, so even a manual dispatch fails today.

Design

  • languages: c-cpp only. .das is invisible to CodeQL (covered by the in-tree lint, which is stricter anyway); the template's javascript/python lanes scanned a handful of scripts for the price of two extra jobs per run.
  • build-mode: none instead of Autobuild — no traced build, so a run costs minutes rather than a full build per PR. Can be upgraded to a built mode later if finding quality warrants the precision.
  • Vendored code excluded from analysis (3rdparty/, tests-cpp/3rdparty/) — findings in fmt/uriparser/doctest aren't actionable here. Modules pull externals via FetchContent, so nothing else is in-tree.
  • Triggers: PRs and master pushes path-filtered to the C++ surface (src/, include/, modules/, tests-cpp/), a weekly cron to keep the master baseline fresh (PR alert diffing compares against it), and workflow_dispatch kept for manual runs. Org ubuntu-latest-fat runner label kept per 9f7d8d0.

Adoption note

PR checks flag only alerts new in the diff. The first scan of the codebase will land a backlog of findings in the Security tab — that backlog does not gate PRs and can be triaged (or ignored) independently.

Companion to the local-vs-CI coverage-gap work (#3102): Copilot review covers diff-scoped judgment, CodeQL adds whole-program dataflow on the C++ surface.

🤖 Generated with Claude Code

… cron

The existing codeql.yml was the stock template parked on
workflow_dispatch-only: it never triggered automatically, ran a full
cpp Autobuild per language, and sits on codeql-action@v2, which GitHub
has since sunset — even a manual dispatch fails today.

Rewritten: c-cpp only (.das is invisible to CodeQL and is covered by
the in-tree lint; the template's javascript/python lanes scanned a few
scripts for the price of two more jobs), build-mode none instead of
Autobuild (no traced build — minutes per run, not a full build; can be
upgraded later if finding quality warrants), vendored 3rdparty/ and
tests-cpp/3rdparty/ excluded from analysis. Triggers: PRs and master
pushes path-filtered to the C++ surface, a weekly cron to keep the
master baseline fresh for PR alert diffing, and workflow_dispatch kept
for manual full runs. PR checks flag only alerts NEW in the diff; the
first-scan backlog lands in the Security tab without gating anything.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 11, 2026 22:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Revives and modernizes the repository’s CodeQL workflow so C/C++ code scanning runs automatically on relevant changes (PRs + master pushes) and on a weekly schedule, using CodeQL Action v3 in buildless mode to keep runtime low.

Changes:

  • Replace the dormant v2/template-only CodeQL workflow with a v3 workflow that runs automatically on PRs and master pushes (path-filtered) plus a weekly cron.
  • Limit scanning to the C/C++ surface and use build-mode: none to avoid full build costs.
  • Exclude vendored third-party directories from analysis results.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/codeql.yml
Fork PRs get a read-only token regardless of the permissions block, so
the analyze step's SARIF upload would red-check every external
contributor's C++ PR. Same-repo PRs and push/schedule/dispatch still
run; fork-contributed code gets scanned by the post-merge master push.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/codeql.yml
@borisbat borisbat merged commit 5421218 into master Jun 11, 2026
33 checks passed
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.

3 participants