Skip to content

ci: add CodeQL analysis for Rust + JavaScript/TypeScript - #49

Merged
rawkode merged 1 commit into
v3from
ci-codeql
May 19, 2026
Merged

rawkode merged 1 commit into
v3from
ci-codeql

Conversation

@rawkode

@rawkode rawkode commented May 19, 2026

Copy link
Copy Markdown
Member

The `main` branch ruleset requires CodeQL (`alerts_threshold: errors`) but no CodeQL workflow exists. Every PR targeting `main` is blocked indefinitely because the rule cannot evaluate without a scan. This adds the missing workflow so v3 → main (PR #1) and future merges can clear.

Coverage

  • rust — extracts via `cargo build --workspace`, same stable Rust + Go toolchain as ci.yml's rust job (cuengine's Go FFI build).
  • javascript-typescript — source-only extraction. Covers `.ts`, `.tsx`, `.js`, and `<script>` blocks inside `.vue` files (the JS/TS extractor reads Vue SFCs natively).

Query pack: `security-and-quality`. Ruleset only blocks on `errors`, so quality-pack `warning`/`notice` items surface in the Security tab without gating merges.

Triggers

  • `pull_request` and `push` to `main`/`v3` — so the ruleset auto-merge condition clears immediately after a green run.
  • Weekly cron (`13 6 * * 1`) — so newly-published CodeQL queries flag regressions on existing code without a push.

Permissions

Least-privilege: `security-events: write` for findings upload, `actions: read`/`contents: read` for the extractor. No `run:` step consumes untrusted external input.

What clears after this lands

PR #1 (v3 → main) has `autoMergeRequest` armed for squash; once a CodeQL run posts a passing analysis on v3, the ruleset's `code_scanning` requirement clears and the queue picks up the merge.

If the first scan returns actual `error`-level findings, I'll fix them in a follow-up before #1 can land — but the expectation on a Rust + TS codebase this shape is a clean scan or only `warning`/`notice` items.

Copilot AI review requested due to automatic review settings May 19, 2026 15:52
@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

Choose a reason for hiding this comment

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

Pull request overview

Adds a missing GitHub CodeQL workflow so the repository’s main branch ruleset requirement (code_scanning with alerts_threshold: errors) can evaluate and unblock PR merges. The workflow runs CodeQL for both the Rust workspace (manual cargo build --workspace) and JavaScript/TypeScript (source-only extraction), on PRs, pushes to main/v3, and a weekly schedule.

Changes:

  • Introduces .github/workflows/codeql.yml to run CodeQL analysis for rust and javascript-typescript.
  • Configures triggers for pull_request, push (main/v3), and weekly cron runs.
  • Uses least-privilege permissions and the security-and-quality query pack, with manual Rust build integration.

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

Comment thread .github/workflows/codeql.yml Outdated
Comment on lines +53 to +54
with:
components: rustfmt, clippy
The `main` branch ruleset has a `code_scanning` requirement (CodeQL,
`alerts_threshold: errors`) but no CodeQL workflow existed, so every
PR to main was blocked indefinitely — the rule can't pass without a
scan to evaluate. This adds the missing workflow.

Coverage
- `rust`: extracts the workspace via `cargo build --workspace`. Uses
  the same stable Rust + Go toolchain as `ci.yml`'s rust job so
  cuengine's Go FFI build keeps working under CodeQL's extractor.
- `javascript-typescript`: source-only extraction, no build. Covers
  .ts, .tsx, .js, and `<script>` blocks inside .vue files (the JS/TS
  extractor reads Vue SFCs natively).

Query pack: `security-and-quality`. The ruleset only blocks on
`errors`, so quality-pack warnings/notices surface in the Security
tab without gating PR merges.

Triggers: pull_request + push to main/v3 (so the ruleset auto-merge
clears immediately after a green run) and a weekly cron (so newly-
published queries flag regressions on existing code without a push).

Permissions: least-privilege — `security-events: write` for findings
upload, `actions: read`/`contents: read` for the extractor. No `run:`
step consumes untrusted external input.
@rawkode
rawkode merged commit 0ac38ab into v3 May 19, 2026
13 checks passed
@rawkode
rawkode deleted the ci-codeql branch May 19, 2026 16:04
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