Skip to content

ci: auditor PR-flow phase 2 — fan out to remaining 12 workflows#299

Open
xiaolai wants to merge 1 commit into
mainfrom
ci/auditor-pr-flow-phase2
Open

ci: auditor PR-flow phase 2 — fan out to remaining 12 workflows#299
xiaolai wants to merge 1 commit into
mainfrom
ci/auditor-pr-flow-phase2

Conversation

@xiaolai

@xiaolai xiaolai commented Jun 5, 2026

Copy link
Copy Markdown
Owner

What

Migrates every remaining auditor workflow that pushes directly to `main` to use the shared `commit-via-pr.sh` helper from phase 1 (#296). After this lands, zero auditor workflows push to main directly — every state change goes through an auto-merging bot PR.

Workflow Commit blocks migrated
auditor-suppressions 1
auditor-classify 1
auditor-render-dashboard 1
auditor-daily-report 1
auditor-docs-diff 1
auditor-repo-report 1
auditor-vocab-drift 1
auditor-exemplar 1
auditor-discover 1
auditor-case-study 3 (no-narrative + article + complete-status)
auditor-audit 2 (main report + disclosure-pending)
auditor-contribute 4 (3 policy gates + no-high-confidence)

Each step's env now includes `PAT_TOKEN: ${{ secrets.PAT_TOKEN }}` so its bot PR triggers downstream workflows (required for phase 3).

Net -116 LOC — the helper absorbs the boilerplate.

Helper hardening (also in this PR)

Two pre-existing bugs in `commit-via-pr.sh` that phase 1 didn't hit but phase 2 would:

  • Branch name now includes the short SHA of the commit. Without this, a workflow that makes more than one commit per run (case-study makes 3, audit makes up to 2) would collide on the same branch name.
  • `gh label create --force` runs idempotently before `gh pr create`. Phase 1's first test failed because the `auditor-bot` label didn't exist; the manual fix was a one-time `gh label create`. This makes the helper portable to any repo.

What's next

Phase 3 recreates branch protection requiring `gate` once this lands. With every auditor workflow now opening bot PRs that trigger `gate` (skip-passes for non-release), the required check resolves uniformly for both human and bot PRs.

Verification plan

The gate will skip-pass on this PR itself. Post-merge, I'll dispatch one of the migrated workflows (probably `auditor-render-dashboard` — small, fast, low-blast-radius) to confirm the helper works end-to-end across the new call sites. If anything misbehaves, phase 3 stays parked.

Migrates every auditor workflow that pushes directly to main to use the
shared commit-via-pr.sh helper introduced in phase 1 (#296).

Workflows migrated:
- auditor-suppressions
- auditor-classify
- auditor-render-dashboard
- auditor-daily-report
- auditor-docs-diff
- auditor-repo-report
- auditor-vocab-drift
- auditor-exemplar
- auditor-discover
- auditor-case-study (3 commit blocks)
- auditor-audit (2 commit blocks — main report + disclosure-pending)
- auditor-contribute (4 commit blocks — three policy gates + no-high-confidence)

Each migration replaces `git config / set-url / git diff --cached --quiet ||
{ commit; push-with-retry }` with `git add ... ; commit-via-pr.sh "<msg>"`,
adds `PAT_TOKEN` to the step env (required so the bot PR triggers the gate).

Helper hardening — two pre-existing bugs that would surface in phase 2:

- Branch name now includes the short SHA of the just-made commit, so a
  workflow that creates multiple commits in one run (case-study and audit
  do) does not collide on the same branch name.
- gh label create --force runs idempotently before gh pr create, so the
  helper is portable to any repo where the `auditor-bot` label may not
  exist yet.

After this lands, every direct push to main from an auditor workflow is
replaced by an auto-merging bot PR. Phase 3 can re-enable branch
protection requiring `gate` without re-breaking the pipeline.
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