Commit e6b2884
authored
feat(governance): add mirror-reusable.yml — consolidate 289-repo mirror.yml drift (#187)
## Summary
Extends the reusable-workflow pattern from #168 (governance-reusable +
deno-ci-reusable) and #174 (rust-ci-reusable + elixir-ci-reusable) to
the **mirror.yml** template.
Estate audit picked this as the highest-leverage next foundational
reusable across 5 candidates (codeql, secret-scanner, hypatia-scan,
mirror, scorecard).
### Drift survey
`gh api /search/code` paginated against `org:hyperpolymath`, then
blob-SHA grouped:
| Template | Deployments | Sampled | Unique SHAs | Top-SHA share |
|---|---|---|---|---|
| **mirror.yml** | **289** | **100** | **76 (76%)** | **16% — long
tail** |
| codeql.yml | 263 | 100 | 70 (70%) | 32% |
| secret-scanner.yml | 281 | 100 | 55 (55%) | 47% |
| scorecard.yml | 258 | 258 (full) | 46 (18%) | 39% |
| hypatia-scan.yml | 255 | 200 | 31 (15.5%) | 50% |
(scorecard + hypatia-scan are already mostly converged → low leverage
now.)
mirror.yml ranks first on **drift × deployments** (76% × 289 ≈ 220) and
was verified to have **low feature variance**: all 4 top-SHA variants
sampled (covering 29/100 sampled repos: bgp-backbone-lab, ipfs-overlay,
kaldor-iiot, vcs-ircd) carried the **same 7 forge jobs** (gitlab,
bitbucket, codeberg, sourcehut, disroot, gitea, radicle). Drift is
action-SHA / whitespace churn — not feature variance — exactly the shape
that consolidates cleanly behind one workflow_call reusable.
### Design
- **No per-call inputs other than runs-on** — per-repo forge selection
already externalised to Actions vars vars.<FORGE>_MIRROR_ENABLED ==
'true', so the reusable mirrors the gating pattern verbatim.
- **secrets: inherit required at the call site** — the per-forge SSH
keys (GITLAB_SSH_KEY, BITBUCKET_SSH_KEY, CODEBERG_SSH_KEY,
SOURCEHUT_SSH_KEY, DISROOT_SSH_KEY, GITEA_SSH_KEY) and RADICLE_KEY flow
through implicitly. Without secrets: inherit the inner secrets.X
references evaluate to empty (silent push failure on each enabled
forge).
- **vars.GITEA_HOST** consumed verbatim from the caller repo's Actions
vars — same as the canonical mirror.yml.
- All actions SHA-pinned; SPDX header present; top-level permissions:
contents: read; passes the workflow-lint job in governance-reusable.yml.
No filtering logic, so no regression-test file (cf.
scripts/tests/apply-baseline-test.sh for the governance/baseline path
that needs one).
### Caller wrapper shape (post-merge)
\`\`\`yaml
# SPDX-License-Identifier: PMPL-1.0-or-later
name: Mirror to Git Forges
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
mirror:
uses:
hyperpolymath/standards/.github/workflows/mirror-reusable.yml@<sha>
secrets: inherit
\`\`\`
~10 lines per repo, replacing ~145 lines.
### Rollout plan (downstream wrapper sweep)
**NOT started in this PR — owner-gated, same as #174's rust-ci sweep
(which capped at 82 PRs).**
Numbers (from the 100-repo SHA-sample, extrapolated to 289):
- **289 repos** total deployments to convert
- **~85% trivially convertible** (forge set matches canonical 7-forge
list; SHA-pinned actions only differ in pin SHA / whitespace). One
mechanical wrapper PR per repo, same shape as the #168 wrappers
(absolute-zero#41, tma-mark2#41).
- **~10-15% need careful review** — long-tail SHAs may include
legitimate custom forges or local additions. Surface a per-repo diff
during sweep; defer non-canonical variants to a follow-up.
- Sweep order: pin wrappers to **this PR's HEAD SHA** while owner-gated;
rebase to merged-main SHA in the wave's final batch (same protocol as
the rust-ci sweep).
### Pattern hardening (no per-PR action required)
- Same workflow_call shape as #168 / #174 — no new infrastructure.
- Independent of #174 (rust-ci-reusable.yml) and #180 (apply-baseline.sh
glob fix) — no conflicts; can land in any order.
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent fd11d1f commit e6b2884
1 file changed
Lines changed: 165 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 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
0 commit comments