Skip to content

ci: require reviewer approval on the production release environment - #92

Merged
Bre77 merged 1 commit into
mainfrom
fm/o10-e102-s2-changesets-env-harden
Aug 6, 2026
Merged

ci: require reviewer approval on the production release environment#92
Bre77 merged 1 commit into
mainfrom
fm/o10-e102-s2-changesets-env-harden

Conversation

@Bre77

@Bre77 Bre77 commented Aug 6, 2026

Copy link
Copy Markdown
Member

Intent

  • PR ci: gate publish on full CI passing for the exact SHA #91 made publish.yml's release job wait on the full CI suite (needs: validate) for the exact SHA before it can enter the production environment. This closes the remaining gap from that story: verify the production environment actually requires reviewer approval, and make sure that approval is structurally after the CI gate, not a separate/racing check.
    • Configured GitHub environment protection on production to require reviewer approval (via PUT /repos/.../environments/production) - previously it had environment: production referenced in the workflow but no protection rules at all, so the job would run unattended the moment validate passed.
    • Confirmed (no workflow change needed) that approval is already ordered after the CI gate: the release job's environment: production block only starts once needs: validate has completed, so the reviewer is approving a run that has already passed CI for that exact commit, not a racing/unrelated one.
    • This repo has exactly one collaborator, so they're the only reviewer that can be configured. GitHub's can_admins_bypass environment setting lets a repo admin skip protection entirely, and isn't configurable per-environment via this API (it requires org rulesets, not available here) - documented as a known limitation in RELEASE.md rather than silently left unaddressed.
  • Rewrote RELEASE.md, which still described a manual git tag release flow that hasn't matched publish.yml for a while, to document the actual changesets/action-driven flow plus recovery/idempotency for an interrupted publish (changeset publish re-run behavior, what state is/isn't preserved on failure at each stage).

No changes to the publish mechanics themselves - Changesets and npm OIDC trusted publishing are untouched.

Test plan

  • Verified via gh api repos/Teslemetry/typescript-teslemetry/environments/production that the required-reviewer protection rule is now present
  • Docs-only change to RELEASE.md, no build/test impact

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 075f08ff60

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread RELEASE.md

### Recovery from an interrupted publish

`changeset publish` (`ci:publish`) is safe to re-run: it walks each workspace package, compares its `package.json` version against what's already on npm, and only publishes versions that aren't there yet. If the `release` job fails or is cancelled partway through a multi-package publish (e.g. network blip after package A publishes but before package B does), simply re-running the workflow (re-push, or `gh workflow run publish.yml` / re-approve the environment) picks up where it left off - already-published versions are skipped, not re-published or errored on.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a supported command to rerun the publish workflow

When recovering from a failed publish, gh workflow run publish.yml cannot trigger this workflow: I checked .github/workflows/publish.yml, and it declares only on.push, while gh workflow run --help states that the workflow must support an on.workflow_dispatch trigger. Use gh run rerun <run-id> to rerun the existing exact-SHA run, or add workflow_dispatch before documenting this command; otherwise the documented recovery path fails immediately.

AGENTS.md reference: AGENTS.md:L417-L417

Useful? React with 👍 / 👎.

@Bre77 Bre77 added the fm Opened by a Firstmate crewmate label Aug 6, 2026
@Bre77
Bre77 merged commit 351470c into main Aug 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fm Opened by a Firstmate crewmate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant