Skip to content

feat(governance): add codeql-reusable.yml — consolidate 263-repo codeql.yml drift#192

Open
hyperpolymath wants to merge 2 commits into
mainfrom
feat/codeql-reusable
Open

feat(governance): add codeql-reusable.yml — consolidate 263-repo codeql.yml drift#192
hyperpolymath wants to merge 2 commits into
mainfrom
feat/codeql-reusable

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Third foundational reusable in the workflow-convergence sweep (#168#174#187#190 → this). Targets codeql.yml, the 263-deployment CodeQL security-analysis workflow.

Drift survey

Full pagination of gh api /search/code against org:hyperpolymath, blob-SHA grouped:

Metric Value
Total deployments 263
Unique blob SHAs 69 (26% drift — same as mirror.yml)
Top 7 SHAs coverage 195/263 (74%)
Long-tail SHAs 62 SHAs / 68 repos

Language matrix distribution (key for design)

Languages Repos Share
javascript-typescript only 223 84.8%
actions only 22 8.4%
NONE (no matrix declared) 6 2.3%
rust only 3 1.1%
javascript-typescript,rust 3 1.1%
actions,javascript-typescript 3 1.1%
actions,javascript-typescript,rust 2 0.8%
actions,rust 1 0.4%

100% of estate variants use build-mode: none — verified across rust-only, actions-only, and mixed sampled variants.

Design choice — single-language single-job reusable

Caller invokes the reusable once per language. Multi-language wrappers (~3.4%) call it multiple times in parallel; per-language SARIF separation is preserved via the category: "/language:${{ inputs.language }}" step.

This matches how callers already think about CodeQL (one job per language) without forcing a JSON-array input or matrix-as-string-input. The alternative (matrix-as-input) would have made the 85% single-language case more awkward.

Inputs

  • language (string, default javascript-typescript) — single CodeQL language identifier
  • build-mode (string, default none) — 100% of estate currently uses none; default covers everything
  • runs-on (string, default ubuntu-latest)

Caller wrapper examples

Single-language (~85% of estate):

jobs:
  codeql:
    uses: hyperpolymath/standards/.github/workflows/codeql-reusable.yml@<sha>

~5 lines, replacing ~49.

Rust-only or actions-only (~10% of estate):

jobs:
  codeql:
    uses: hyperpolymath/standards/.github/workflows/codeql-reusable.yml@<sha>
    with:
      language: rust

Multi-language (~3.4% of estate):

jobs:
  codeql-js:
    uses: hyperpolymath/standards/.github/workflows/codeql-reusable.yml@<sha>
  codeql-actions:
    uses: hyperpolymath/standards/.github/workflows/codeql-reusable.yml@<sha>
    with:
      language: actions
  codeql-rust:
    uses: hyperpolymath/standards/.github/workflows/codeql-reusable.yml@<sha>
    with:
      language: rust

Rollout plan

NOT started in this PR — owner-gated.

Wave Repos Action
1: bulk-mechanical ~210 Single-language javascript-typescript default. One-line wrapper.
2: single non-default ~25 Override language: rust or language: actions.
3: multi-language ~9 Two or three reusable invocations per wrapper.
4: NEEDS_REVIEW ~18 NONE matrix (6) + 100-line custom workflows (~2-3). Per-repo review.

Total expected sweep: ~245 PRs (93% mechanical).

Pattern hardening

🤖 Generated with Claude Code

…ql.yml drift

Extends the #168/#174/#187/#190 reusable-workflow pattern to codeql.yml,
the third foundational security workflow in the convergence sweep.

Drift survey (gh api /search/code paginated over org:hyperpolymath,
blob-SHA grouped):
- 263 deployments, 69 unique blob SHAs (26% drift)
- Top 7 SHAs cover 195/263 (74%); long tail of 62 SHAs covers 68 repos

Language matrix distribution (key for the reusable design):
- 223 (84.8%) javascript-typescript only
-  22  (8.4%) actions only
-   6  (2.3%) NONE (no matrix declared — needs per-repo review)
-   3  (1.1%) rust only
-   3  (1.1%) javascript-typescript,rust
-   3  (1.1%) actions,javascript-typescript
-   2  (0.8%) actions,javascript-typescript,rust
-   1  (0.4%) actions,rust

100% of estate variants currently use `build-mode: none`.

Design choice — single-language single-job reusable (vs matrix-as-input):
- Single-language wrappers (~85%) call the reusable once with defaults.
- Multi-language wrappers (~3.4%) call the reusable once per language
  in parallel; per-language SARIF separation preserved via the
  `category: "/language:${{ inputs.language }}"` field.

This pattern matches how callers already think about CodeQL (one job
per language) without forcing them to pass JSON-array inputs.

Inputs:
- language (string, default `javascript-typescript`)
- build-mode (string, default `none`)
- runs-on (string, default `ubuntu-latest`)

Sweep classification (preview):
- TRIVIAL (~210): single javascript-typescript, default wrapper
- Single-language non-default (~25): rust or actions, override language
- Multi-language (~9): wrapper invokes reusable per-language
- NEEDS_REVIEW (~18): NONE matrix or non-canonical custom workflow

After merge, ~93% of 263 wrappers are mechanical conversions.
The PR was opened with auto-merge ON 4h ago but no workflow runs ever
fired against the head commit. The required-checks gate cannot be
satisfied without CI runs, so the PR cannot auto-merge. Pushing this
empty commit to re-trigger workflows.
hyperpolymath added a commit that referenced this pull request May 26, 2026
Same as #192 (codeql-reusable) — auto-merge enabled but zero workflow
runs against the head commit. Pushing empty commit to re-trigger CI.
hyperpolymath added a commit that referenced this pull request May 26, 2026
Same as #192 (codeql-reusable) — auto-merge enabled but zero workflow
runs against the head commit. Pushing empty commit to re-trigger CI.
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