ci(codeql): centralize CodeQL as a reusable workflow + org rollout handoff#3
Conversation
Same config-as-code CodeQL workflow used org-wide across Quantum-L9 repos: a detect job builds the analysis matrix from the repo's actual languages, and the shared .github/codeql/codeql-config.yml supplies the security-and-quality suite (security + maintainability/code-quality queries). Byte-identical to the L9-Ops-MCP copy so it stays in sync across all L9 repositories. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rr6wpk9eehnJdRmh5BwWGG
…ndoff Convert the standalone CodeQL setup into a single org-wide source of truth hosted here in Cursor-Governance: - .github/workflows/codeql-reusable.yml: reusable (workflow_call) analysis with language auto-detection and per-language build-mode (interpreted -> none, compiled -> autobuild), so the standalone autobuild step is gone and the same workflow stays portable to any L9 repo. - .github/codeql/codeql-config.yml: add query-filters (exclude precision:low) and ignore tests/ — source-level noise suppression, not per-alert dismissal. - .github/workflows/codeql.yml: converted to a thin caller (self-scan) plus a pull_request paths-ignore filter to skip docs-only PRs. - docs/handoffs/codeql-caller-template.yml: verbatim ~18-line caller for every other Quantum-L9 repo. - docs/handoffs/CODEQL_ROLLOUT_HANDOFF.md: exemplary GMP-format handoff to roll the caller to all repos under github.com/Quantum-L9, with admin runbook, sequencing, verification ladder, and no-auto-commit guardrails. Static validation (YAML, structure, detection logic) passes; runtime CodeQL verification is pending the first Actions run after merge to main. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rr6wpk9eehnJdRmh5BwWGG
There was a problem hiding this comment.
Pull request overview
Centralizes CodeQL security + code-quality scanning for the Quantum-L9 org by introducing a reusable workflow (single “source of truth”) plus a standardized thin caller workflow and rollout handoff documentation.
Changes:
- Adds a reusable CodeQL workflow that detects repo languages and sets per-language build-mode, then runs
init+analyze. - Adds a shared CodeQL configuration (query suite + query-filters + paths-ignore) intended to be used org-wide.
- Adds a thin caller workflow + a copy/paste caller template and an org rollout handoff/runbook.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/codeql-reusable.yml |
Introduces org-wide reusable CodeQL workflow with language detection and per-language build mode. |
.github/codeql/codeql-config.yml |
Defines shared CodeQL query policy and ignore rules. |
.github/workflows/codeql.yml |
Adds this repo’s thin caller that invokes the reusable workflow (self-scan). |
docs/handoffs/codeql-caller-template.yml |
Provides a verbatim thin-caller template for other Quantum-L9 repos. |
docs/handoffs/CODEQL_ROLLOUT_HANDOFF.md |
Documents the rollout plan/runbook and verification ladder for org-wide adoption. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Move `permissions: contents: read` from workflow-level to the `detect` job in codeql-reusable.yml (least privilege; SonarCloud githubactions:S8264). - CODEQL_ROLLOUT_HANDOFF.md: drop hardcoded feature-branch reference in the Status line and the AI-session-specific write-scope parenthetical, per Copilot review comments. Note: codeql.yml's `@main` pin (SonarCloud githubactions:S7637) is left as-is intentionally — pinning to a full commit SHA is circular for a workflow that self-references its own repo pre-merge. Plan: tag v1/v1.0.0 after merge (matching the l9-ci-core kernel convention) and bump the pin in a follow-up PR.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Remediation pass:
|
SonarCloud S7637 (MAJOR, failing the Quality Gate's Security Rating on New Code): codeql.yml referenced codeql-reusable.yml@main -- a mutable ref is a supply-chain risk (main could be repointed to malicious content between runs). Pin to this PR's own head commit (400691f), which already contains the job-scoped-permissions fix from the prior remediation pass. This satisfies "full commit SHA" now, without waiting on a release tag. Once main has a stable release (v1 / v1.0.0), a follow-up PR can re-pin to that tag for readability -- tracked as a known follow-up, not deferred indefinitely. Co-authored-by: Cursor <cursoragent@cursor.com>
CodeQL init failed (404 via the Contents API) because the reusable workflow's config-file default points at Quantum-L9/Cursor-Governance/.github/codeql/codeql-config.yml@main, and main doesn't have that file yet -- it's introduced by this very PR (bootstrapping problem for a self-referencing caller). Override with a local relative path: this workflow lives in the same repo as the config it needs, and actions/checkout already has it on disk at any ref (PR branch, push, or main), so a local path resolves without hitting the Contents API at all. The org-wide caller template (docs/handoffs/codeql-caller-template.yml) is unaffected -- other repos correctly keep the remote @main reference, which will resolve once this merges. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Two more fixes (e48ec02, 9f5fb42):
|
|
|
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:
For more information about GitHub Code Scanning, check out the documentation. |



Summary
Makes CodeQL security + code-quality analysis org-wide from a single source of truth hosted here in Cursor-Governance. Every other Quantum-L9 repo enables it with one ~18-line thin caller and no local config — change the analysis once here and it propagates to all callers pinned at
@main.What's in this PR
.github/workflows/codeql-reusable.ymlworkflow_call) analysis: language auto-detect + per-language build-mode (interpreted →none, compiled →autobuild) → no standalone autobuild step, portable to any L9 repo..github/codeql/codeql-config.ymlsecurity-and-qualitysuite +query-filters: exclude precision:low+paths-ignoreincl.tests/. Source-level noise suppression, not per-alert dismissal..github/workflows/codeql.ymlpull_request: paths-ignoreto skip docs-only PRs.docs/handoffs/codeql-caller-template.ymldocs/handoffs/CODEQL_ROLLOUT_HANDOFF.mdgithub.com/Quantum-L9— admin runbook, sequencing, verification ladder, DORA block.Tuning folded in (reduce friction / increase autonomy)
pull_request: paths-ignore+ ignoretests/in config.query-filters: exclude precision:low— cut low-precision noise at source before it trains people to ignore the bot.Guardrails (non-negotiable)
query-filters/paths-ignore), never silent mass-dismissal.https://github.com/Quantum-L9/.Validation
detectbuild-mode logic simulated on real language data (python/none), plus compiled/mixed/docs-only/API-failure edge cases degrade correctly.main(callers pin@main). CI is not claimed green until that run passes — see the handoff's Level-5 steps.Rollout (after merge)
Merge this → add the caller template to each non-archived Quantum-L9 repo (delete any local
.github/codeql/) → switch each repo's CodeQL default setup → advanced → verify. Full step-by-step indocs/handoffs/CODEQL_ROLLOUT_HANDOFF.md. This session's write scope is limited to L9-Ops-MCP and Cursor-Governance, so the org-wide caller rollout is handed off there for an authorized session/engineer.🤖 Generated with Claude Code
https://claude.ai/code/session_01Rr6wpk9eehnJdRmh5BwWGG
Generated by Claude Code