Commit ccf01cd
authored
feat(governance): add codeql-reusable.yml — consolidate 263-repo codeql.yml drift (#192)
## 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):**
```yaml
jobs:
codeql:
uses: hyperpolymath/standards/.github/workflows/codeql-reusable.yml@<sha>
```
~5 lines, replacing ~49.
**Rust-only or actions-only (~10% of estate):**
```yaml
jobs:
codeql:
uses: hyperpolymath/standards/.github/workflows/codeql-reusable.yml@<sha>
with:
language: rust
```
**Multi-language (~3.4% of estate):**
```yaml
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
- Same `workflow_call` shape as #168 / #174 / #187 / #190 — no new
infrastructure.
- Independent of all open standards PRs — lands in any order.
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent 6a519a2 commit ccf01cd
1 file changed
Lines changed: 96 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
0 commit comments