Skip to content

ci: release with the org's shared signing and tap secrets - #436

Merged
jflowers merged 1 commit into
mainfrom
ci-org-release-secrets
Nov 30, 2026
Merged

jflowers merged 1 commit into
mainfrom
ci-org-release-secrets

Conversation

@jflowers

Copy link
Copy Markdown
Collaborator

Closes #435.

The unbound-force release secrets are now organization secrets, shared by dewey, gaze, replicator and unbound-force: the five MACOS_* signing secrets and HOMEBREW_TAP_TOKEN. jflowers/ship's scripts/secrets-sync.sh sets them from the dotfiles, and the repository copies have been deleted.

The caller still passes MACOS_SIGN_IDENTITY, a repository secret nothing syncs. Ship's go-release.yml finds the identity in the .p12 when it is absent, and the .p12 holds exactly one Developer ID Application identity, so the secret only adds a copy that can drift.

  • .github/workflows/release.yml: drops MACOS_SIGN_IDENTITY and passes HOMEBREW_TAP_TOKEN as itself
  • cmd/gaze/release_workflow_test.go: expects the six secrets under their own names and fails on MACOS_SIGN_IDENTITY or HOMEBREW_TAP_GITHUB_TOKEN anywhere in the workflow. A mutation restoring the old mapping fails it.
  • .goreleaser.yaml: drops the cask token: read from HOMEBREW_TAP_GITHUB_TOKEN, which is empty under ship anyway because ship publishes the cask. goreleaser check passes.
  • README and AGENTS.md: describe the org secrets and say where the identity comes from

The fix-macos-signing-identity-secret openspec change still says the identity must come from secrets.MACOS_SIGN_IDENTITY. This reverses it, because the .p12 has a single identity.

After this merges, I will delete the leftover repository secrets: MACOS_SIGN_IDENTITY and HOMEBREW_TAP_GITHUB_TOKEN. The next release is the first to use the org secrets.

🤖 Generated with Claude Code

The signing and tap secrets are unbound-force organization secrets now,
set by jflowers/ship's secrets-sync.sh. Stop passing MACOS_SIGN_IDENTITY:
ship finds the identity in the .p12, which holds just one.
Pass HOMEBREW_TAP_TOKEN under its own name instead of mapping it from
HOMEBREW_TAP_GITHUB_TOKEN, and drop that name from .goreleaser.yaml.

Closes #435

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jflowers
jflowers enabled auto-merge (rebase) November 30, 2026 00:38
@github-actions

Copy link
Copy Markdown

✅MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ GO golangci-lint yes yes no no 31.83s
✅ MARKDOWN markdownlint 2 0 0 0 1.32s
✅ REPOSITORY gitleaks yes no no 5.01s
✅ REPOSITORY git_diff yes no no 0.32s
✅ YAML yamllint 2 0 0 0.63s

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@uf-divisor uf-divisor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Council verdict: REQUEST CHANGES

8 reviewer personas ran against head 9c14da51 (correlation d87b86cc-5a09-443e-b7fb-44882ce4b353): 7 returned APPROVE / APPROVE WITH ADVISORIES, 1 (divisor-sre) returned REQUEST CHANGES. CI is fully green on this head — CI OK, Unit+Integration (Go 1.24/1.25), E2E (Go 1.24/1.25), MegaLinter, scope; Gaze AI Report advisory; Auto-merge and Gitleaks (learnings-only) skipped. No PR-caused or pre-existing CI failures. Local gates ran at the head commit in a detached worktree; all detected tools were covered by passing CI checks.

The PR migrates the release caller to the org's shared signing and tap secrets (five MACOS_* + HOMEBREW_TAP_TOKEN under their own names, no MACOS_SIGN_IDENTITY) and updates the guard test and docs. The change matches issue #435's done-criteria on the caller side. One release-blocking gap remains, plus four non-blocking findings:

Severity Finding Location
HIGH The uses: pin for jflowers/ship/.github/workflows/go-release.yml is unchanged while the caller now passes five MACOS_* secrets. Every record of the pinned v0.12.0 contract (AGENTS.md, the base guard-test comment, disk-replicator's agents.md, issue #363) says ship's settings job requires all six and fails on a partial set before tagging. If v0.12.0 still expects six, the next release fails at settings; workflow_dispatch has no CI to surface it. Pair the secret-set change with a synchronized ship pin bump (or canary / recorded confirmation of the pinned callee's contract). .github/workflows/release.yml:135
MEDIUM AGENTS.md's Release item still says signing needs "all six MACOS_* secrets or none," contradicting the workflow, guard test, and README (now five, identity from the .p12). Found independently by 5 reviewers (architect, curator, guard, sre, testing). AGENTS.md:482
MEDIUM .goreleaser.yaml drops homebrew_casks.repository.token with no compensating token source; the removed comment claimed the token is required for cask URL generation even with skip_upload: true. PR CI never runs GoReleaser, so a regression surfaces only at release. .goreleaser.yaml:57
MEDIUM The forbidden-substring guard scans only release.yml; .goreleaser.yaml — the only other live consumer of HOMEBREW_TAP_GITHUB_TOKEN — has no negative-space coverage, so the old secret name can be reintroduced with every check green. cmd/gaze/release_workflow_test.go:131
LOW README's retained "when any required secret is missing, the release pipeline produces unsigned binaries" wording conflates the partial-set case (fails before tagging) with the fully-absent case (unsigned binaries). README.md:77

Inline comments carry the details. Resolving the HIGH finding (synchronized pin bump or recorded confirmation that pinned ship v0.12.0 accepts five secrets and derives identity from the .p12) plus the AGENTS.md count fix would move this to approve-with-advisories territory.

This review was generated by /uf.review-pr (AI-assisted).

Comment thread .github/workflows/release.yml Resolved
Comment thread AGENTS.md Resolved
Comment thread .goreleaser.yaml Resolved
Comment thread cmd/gaze/release_workflow_test.go Resolved
Comment thread README.md Resolved

@uf-divisor uf-divisor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Council verdict: APPROVE WITH ADVISORIES

Re-review of 9c14da51 (no new commits since the prior round). 8 reviewer personas ran; all returned APPROVE or APPROVE WITH ADVISORIES.

The prior round's HIGH finding (caller/callee pin-contract risk on the unchanged ship v0.12.0 pin) is resolved: the author's recorded verification against the pinned callee confirms settings checks exactly the five MACOS_* secrets the caller now passes and derives the signing identity from the .p12 — the explicit-confirmation mitigation the prior review accepted. divisor-testing additionally downgraded the .goreleaser.yaml guard gap from MEDIUM to LOW on evidence the removed token: line was already inert (the name was never exportable by the callee; v2.6.0 shipped a canary-verified cask with it present).

Findings (11 raw → 6 grouped): 0 CRITICAL, 0 HIGH, 1 MEDIUM, 5 LOW.

Severity Finding Location Tracked
MEDIUM AGENTS.md release runbook retains "all six MACOS_* secrets" vs the five-secret contract this PR ships (raised by 4 reviewers) AGENTS.md:482 #438
LOW README conflates partial-set (pre-tag failure) with fully-absent (unsigned) README.md:78 #440
LOW Forbidden-substring guard scans release.yml only; .goreleaser.yaml reintroduction unguarded (inertness evidence downgrades from prior MEDIUM) cmd/gaze/release_workflow_test.go:131 #439
LOW Pin-contract verification durable only as a PR comment release.yml:135 —
LOW Tap-token rename moves failure to the post-publication cask job; org secret must exist before repo-secret deletion release.yml:140 —
LOW Review context carried no gaze report data, so CRAP-prioritization checks ran on file-existence and assertion guards only (body-only) —

CI fully green (CI OK, both Go matrix legs, MegaLinter). Local gates not run (review_head_root unavailable; CI evidence only).

The MEDIUM and three of the LOWs are already filed (#438, #439, #440); none block merge.

This review was generated by /uf.review-pr (AI-assisted).

Comment thread AGENTS.md
1. **Test** (`.github/workflows/test.yml`): Build + test with `-race -count=1` on push/PR to `main`; workflow-level concurrency cancels superseded PR runs (main runs queue). A `scope` job calls `jflowers/ship/.github/workflows/pr-scope.yml` (SHA-pinned, `contents: read`), whose `code` output is `'false'` only for chore pull requests — every changed file a Dewey learning (`.uf/dewey/learnings/*.md`), or a gh-hud toolkit rollout (author `jflowers`, branch `chore/toolkit-*`, every file under `.opencode/`) — and `'true'` for pushes and everything else (fail closed; ship owns and tests the classifier). `unit-and-integration`/`e2e` gate on `if: needs.scope.outputs.code == 'true'`. A `gitleaks` job runs only on chore PRs (which skip MegaLinter and its secret scan) and scans the PR's commits with gitleaks 8.30.1, SHA-256 pinned. The `ci-ok` aggregate job (name `CI OK`, needs `[scope, unit-and-integration, e2e, gitleaks]`, `if: always()`) fails unless `scope` succeeded and, for code, `unit-and-integration` and `e2e` succeeded with `gitleaks` skipped, or, for chores, the reverse; it is the sole required status check. The `gaze-ai-report` dogfood job (thresholds 38/6/8, `build-from-source: true`) is advisory — outside `ci-ok`'s needs — and skips transitively on chore PRs. Push-to-main runs are unchanged (`scope` outputs `code=true` on push, and the `release.yml` preflight `ci_checks` names still report on `main` HEAD). `cmd/gaze/ci_workflow_test.go` (`TestCIWorkflow_*`) pins the wiring and executes the `CI OK` script against a truth table. Operational prerequisite: `main`'s branch protection (the org's safe-settings) must require only `CI OK` — skipped matrix legs report no per-leg check names, so a leg name left required hangs chore PRs indefinitely.
2. **MegaLinter** (`.github/workflows/mega-linter.yml`): Runs golangci-lint, revive, markdownlint, yamllint, and gitleaks on push/PR to `main`; auto-commits lint fixes to PR branches. Carries its own `scope` job (the same ship `pr-scope.yml` call) and gates `megalinter` on `if: needs.scope.outputs.code == 'true'`, so chore PRs skip linting and its auto-fix commits; the push-to-main MegaLinter run still scans every merged chore (gitleaks compensating control). Markdownlint follows a four-bucket ownership policy — user-owned, generated, tool-owned, historical — with per-fragment bucket and reason documented in `.mega-linter.yml` beside the linter-scoped exclusion regex (the living copy). User-owned documentation (`README.md`, `AGENTS.md`, `CLAUDE.md`, `docs/**`) is linted; generated (`.uf/`, `openspec/changes/` including `archive/`, the `internal/scaffold/assets/` and `internal/aireport/assets/` embedded mirrors, `testdata/`), tool-owned (`.opencode/`, `.specify/`, vendored `openspec/schemas/`), and historical (`specs/`, which also covers `openspec/specs/`) paths are excluded — hand-fixing is not durable there or the content is not author-owned. The markdownlint gate is blocking: `MARKDOWN_MARKDOWNLINT_DISABLE_ERRORS: false` makes violations fail the check (MegaLinter v9.3.0 registers markdownlint as a formatter, so without this knob errors are non-blocking warnings). `MD024` is narrowed to `siblings_only` in `.markdownlint.json`: repeated section headings under different parents are intentional parallel structure; same-parent duplicates remain errors. The policy is default-open — unmatched paths are linted — and any newly added generated or tool-owned Markdown path requires a documented exclusion decision in `.mega-linter.yml` (bucket label + reason) before merge. User-owned documentation debt is at zero findings; any new markdownlint failure in a linted file is a genuine regression.
3. **Release** (`.github/workflows/release.yml`): Triggered via `workflow_dispatch` with a `tag` input (e.g., `v0.15.0`). Three local gates run first, offline and unskippable: `validate-module-major` (tag major must match the `go.mod` module path), `validate-workflow-floor` (the tag must not fall below the `minWorkflowTag` floor that `gaze init --ci` enforces; above-floor releases additionally require the floor tag to exist and contain `reusable_gaze_ai_report.yml`), and `validate-ai-report-default` (the `gaze-version` default in `reusable_gaze_ai_report.yml` must equal the tag exactly). The `release` job then calls the shared pipeline `jflowers/ship/.github/workflows/go-release.yml`, pinned by commit SHA, which runs: `settings` (signing needs all six `MACOS_*` secrets or none; a partial set fails before anything is tagged, and with none the cask ships unsigned), `preflight` (`complytime/org-infra`: tag format with pre-release suffixes allowed, uniqueness with re-run detection, semver ordering, CI checks on HEAD — `Unit + Integration Tests (Go 1.24)`, `Unit + Integration Tests (Go 1.25)`, `MegaLinter` — and unreleased commits, then the annotated tag), `release` (`complytime/org-infra` GoReleaser: darwin/linux x amd64/arm64 binaries, GitHub Release, cosign signatures, SBOMs), `sign-macos` (Developer ID signing and notarization of the darwin archives, re-uploaded with `checksums.txt` rewritten), and the cask job (sha256s from the final `checksums.txt`, `brew audit`, push to `unbound-force/homebrew-tap`). Secrets are mapped by name because `secrets: inherit` does not reach another owner's workflow; this repo's `HOMEBREW_TAP_GITHUB_TOKEN` is passed as `HOMEBREW_TAP_TOKEN`. Ship lives in a personal account by decision: the SHA pin keeps the code immutable, and availability depends on that account. `cmd/gaze/release_workflow_test.go` guards the caller: job set, exact pin, gate order, every `with:` input and every secret mapping. Optional skip inputs (`skip_semver_check`, `skip_ci_checks`, `skip_unreleased_check`) bypass individual preflight checks for debugging. To release: use the GitHub Actions "Run workflow" button or `gh workflow run release.yml -f tag=v1.2.3`.
3. **Release** (`.github/workflows/release.yml`): Triggered via `workflow_dispatch` with a `tag` input (e.g., `v0.15.0`). Three local gates run first, offline and unskippable: `validate-module-major` (tag major must match the `go.mod` module path), `validate-workflow-floor` (the tag must not fall below the `minWorkflowTag` floor that `gaze init --ci` enforces; above-floor releases additionally require the floor tag to exist and contain `reusable_gaze_ai_report.yml`), and `validate-ai-report-default` (the `gaze-version` default in `reusable_gaze_ai_report.yml` must equal the tag exactly). The `release` job then calls the shared pipeline `jflowers/ship/.github/workflows/go-release.yml`, pinned by commit SHA, which runs: `settings` (signing needs all six `MACOS_*` secrets or none; a partial set fails before anything is tagged, and with none the cask ships unsigned), `preflight` (`complytime/org-infra`: tag format with pre-release suffixes allowed, uniqueness with re-run detection, semver ordering, CI checks on HEAD — `Unit + Integration Tests (Go 1.24)`, `Unit + Integration Tests (Go 1.25)`, `MegaLinter` — and unreleased commits, then the annotated tag), `release` (`complytime/org-infra` GoReleaser: darwin/linux x amd64/arm64 binaries, GitHub Release, cosign signatures, SBOMs), `sign-macos` (Developer ID signing and notarization of the darwin archives, re-uploaded with `checksums.txt` rewritten), and the cask job (sha256s from the final `checksums.txt`, `brew audit`, push to `unbound-force/homebrew-tap`). Secrets are mapped by name because `secrets: inherit` does not reach another owner's workflow. Ship lives in a personal account by decision: the SHA pin keeps the code immutable, and availability depends on that account. `cmd/gaze/release_workflow_test.go` guards the caller: job set, exact pin, gate order, every `with:` input and every secret mapping. Optional skip inputs (`skip_semver_check`, `skip_ci_checks`, `skip_unreleased_check`) bypass individual preflight checks for debugging. To release: use the GitHub Actions "Run workflow" button or `gh workflow run release.yml -f tag=v1.2.3`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release runbook still states signing needs "all six MACOS_* secrets or none," but this PR aligns the workflow, README, and guard test to five MACOS_* secrets (MACOS_SIGN_IDENTITY removed; identity derived from the .p12). The PR edits this exact Release item — removing the tap-token mapping sentence — yet retains the count that contradicts the contract the item documents. Four reviewers flag this line; compound severity MEDIUM. Tracked as #438. The fix is a one-word count correction in the settings parenthetical.

Comment thread README.md
They are unbound-force organization secrets, shared with the org's other
release repos and set by jflowers/ship's `scripts/secrets-sync.sh`; don't
add repository copies, which would override them. The signing identity is
the Developer ID Application certificate in the .p12. When any required

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The signing note conflates two failure paths: a partial secret set fails in ship's settings job before anything is tagged, while a fully-absent set ships unsigned binaries. "When any required secret is missing, the release pipeline produces unsigned binaries" describes only the none-case recovery behavior, so a maintainer with a partial set expects unsigned artifacts where the pipeline actually fails fast pre-tag. Tracked as #440. Distinguishing the two paths ("a partial set fails the settings gate before tagging; when none are configured, the release ships unsigned") closes the gap.

assertExactMap(t, "secrets", secrets, wantSecrets)

for _, forbidden := range []string{`vars.MACOS_SIGN_IDENTITY`, `Developer ID Application:`} {
for _, forbidden := range []string{`MACOS_SIGN_IDENTITY`, `HOMEBREW_TAP_GITHUB_TOKEN`, `Developer ID Application:`} {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The broadened forbidden-substring guard (MACOS_SIGN_IDENTITY, HOMEBREW_TAP_GITHUB_TOKEN, Developer ID Application:) scans only the release.yml bytes loaded at line 51. .goreleaser.yaml carried the retired name until this PR removed it, and no test reads that file, so re-introduction there passes every PR check and surfaces only at manual release time. Tracked as #439. Severity note: this is downgraded from the prior round's MEDIUM on evidence the removed token: line was provably inert — the caller passes HOMEBREW_TAP_TOKEN, ship exports only that name, so .Env.HOMEBREW_TAP_GITHUB_TOKEN always expanded empty (v2.6.0 shipped a canary-verified cask with the line present), and this PR deletes the repository secret, making re-introduction permanently unresolvable dead code. The gap is hygiene, not failure prevention; the fix is unchanged: extend the sweep to every live consumer.

# HOMEBREW_TAP_GITHUB_TOKEN; ship calls it HOMEBREW_TAP_TOKEN.
# another owner's repo.
secrets:
MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release job calls jflowers/ship's go-release.yml at the unchanged pin (3b0ce8bf, v0.12.0) while the caller now passes five MACOS_* secrets. The author's recorded verification confirms the pinned callee's settings checks exactly those five and derives the identity from the .p12 — this satisfies the accepted mitigation pattern and resolves the prior round's HIGH. The confirmation lives only in a PR comment, though: a future maintainer dispatching a release has no in-repo record of the caller/callee contract, and workflow_dispatch has no CI to catch a mismatch. A one-line comment at the secrets block noting the verified v0.12.0 contract would make the confirmation durable.

MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }}
MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tap token now sources from secrets.HOMEBREW_TAP_TOKEN (org secret). A missing or misnamed org secret surfaces in the cask job — after tag, release, and sign-macos publish artifacts — so the failure is late and cask-only rather than fail-fast, recoverable by re-running once the secret exists. The ordering prerequisite matters for the post-merge cleanup: the org secret must exist under this exact name before the leftover repository secret is deleted. The PR description records that intent; noting the migration order in-repo (README or AGENTS.md) would let it survive the PR thread.

@jflowers
jflowers merged commit 82c83af into main Nov 30, 2026
11 checks passed
@jflowers
jflowers deleted the ci-org-release-secrets branch November 30, 2026 02:30
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.

ci: release with the org's shared signing and tap secrets

2 participants