molecule-core/scripts/ops
hongming-pc2 5373b5e7f6 fix(ci): extend class-E rename to scripts/ops/sweep-*.sh (chained-defect from #430 review)
core-devops lens review (review 1075) caught the chained defect: the 3
sweep workflows shell out to `bash scripts/ops/sweep-{aws-secrets,cf-orphans,cf-tunnels}.sh`,
and those scripts still consume the OLD env-var names — `need CP_PROD_ADMIN_TOKEN`,
`need CP_STAGING_ADMIN_TOKEN`, and `Bearer $CP_PROD_ADMIN_TOKEN` /
`Bearer $CP_STAGING_ADMIN_TOKEN` in the CP-admin curl calls. The workflow-
level presence-check loop (renamed in the first commit) would pass, then
the shell script would `exit 1` at the `need CP_PROD_ADMIN_TOKEN` line.
Classic `feedback_chained_defects_in_never_tested_workflows` — the YAML-
surface rename looked complete; the actual consumer is one layer deeper.

This commit completes the rename in the scripts:
- `CP_PROD_ADMIN_TOKEN`    -> `CP_ADMIN_API_TOKEN`
- `CP_STAGING_ADMIN_TOKEN` -> `CP_STAGING_ADMIN_API_TOKEN`
(6 occurrences total per script — comments, `need` checks, `Bearer $...`
curl headers — across all 3). The .gitea/workflows/sweep-*.yml files (first
commit) export `CP_ADMIN_API_TOKEN: ${{ secrets.CP_ADMIN_API_TOKEN }}` etc.,
so the scripts now read `$CP_ADMIN_API_TOKEN` — consistent end-to-end.

Per core-devops's other (non-blocking) note: `workflow_dispatch` each
sweep in dry-run after this lands + after the #425 class-A PUT, to confirm
the path beyond the presence-check actually works (the `MINIMAX_TOKEN`-grade
shape-match isn't enough — exercise the real CP-admin call).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 01:32:26 -07:00
..
audit-railway-sha-pins.sh ops: add Railway SHA-pin drift audit script + regression test (#2001) 2026-04-27 05:01:23 -07:00
check_migration_collisions.py fix(ci): replace gh pr CLI with Gitea v1 REST in workflows + scripts (#75 class A) 2026-05-07 15:29:26 -07:00
check-prod-versions.sh ops: scripts/ops/check-prod-versions.sh — one-line "is each tenant on latest?" 2026-04-30 13:13:47 -07:00
sweep_cf_decide.py refactor(ops): apply simplify findings on #2027 PR 2026-04-26 00:28:15 -07:00
sweep-aws-secrets.sh fix(ci): extend class-E rename to scripts/ops/sweep-*.sh (chained-defect from #430 review) 2026-05-11 01:32:26 -07:00
sweep-cf-orphans.sh fix(ci): extend class-E rename to scripts/ops/sweep-*.sh (chained-defect from #430 review) 2026-05-11 01:32:26 -07:00
sweep-cf-tunnels.sh fix(ci): extend class-E rename to scripts/ops/sweep-*.sh (chained-defect from #430 review) 2026-05-11 01:32:26 -07:00
test_check_migration_collisions.py fix(test): convert migration-collision tests from pytest to unittest (#2341) 2026-04-30 01:47:27 -07:00
test_sweep_cf_decide.py refactor(ops): apply simplify findings on #2027 PR 2026-04-26 00:28:15 -07:00