Skip to content

ci(release): gate production docs on stable release success#2989

Merged
caio-pizzol merged 2 commits into
mainfrom
caio/docs-production-gate
Apr 29, 2026
Merged

ci(release): gate production docs on stable release success#2989
caio-pizzol merged 2 commits into
mainfrom
caio/docs-production-gate

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

Mintlify currently deploys from main, so docs ship as soon as a doc commit lands, often weeks before the underlying packages reach npm via the weekly stable release. This change moves production docs onto a docs-stable branch that the release workflow only advances after every publish step succeeds, so docs and packages move together.

  • release-stable.yml pushes stable to docs-stable as its final step. Because it sits after all semantic-release and PyPI publish steps in a single sequential job, any earlier failure aborts the workflow and the docs branch stays put.
  • New preview-stable-docs.yml triggers a Mintlify preview for any PR targeting stable. Promote-stable PRs no longer target the deployment branch under this design, so Mintlify's automatic preview won't fire for them; this workflow restores that review checkpoint by calling the preview API and commenting the URL on PR open.
  • Considered the simpler alternative of just pointing Mintlify at stable directly. Rejected because Mintlify reacts to the push (release candidate present) rather than to release success (packages actually on npm), so a failed release-stable.yml run would leave production docs describing packages users cannot install.

Manual setup required before merging:

  1. Create the docs-stable branch on origin: git push origin origin/stable:refs/heads/docs-stable
  2. In Mintlify dashboard, change deployment branch from main to docs-stable
  3. Add MINTLIFY_API_KEY and MINTLIFY_PROJECT_ID repo secrets (preview workflow no-ops without them, so this can be deferred without breaking anything)
  4. If docs-stable gets branch protection, allow the GitHub App used by release-stable.yml to push to it

Mintlify currently deploys from main, so docs ship as soon as a doc commit lands, often weeks before the underlying packages reach npm via the weekly stable release. Move production docs onto a `docs-stable` branch that the release workflow only advances after every publish step succeeds, so docs and packages move together.

- release-stable.yml pushes stable -> docs-stable as its final step, only reachable on full success
- new preview-stable-docs.yml triggers a Mintlify preview for any PR targeting stable so the promote-stable PR shows reviewers the exact docs that will go live
- requires manual setup before this can take effect: create the docs-stable branch from current stable, switch Mintlify's deployment branch in the dashboard, and add MINTLIFY_API_KEY / MINTLIFY_PROJECT_ID repo secrets (preview workflow no-ops without them)
@caio-pizzol caio-pizzol self-assigned this Apr 29, 2026
Copy link
Copy Markdown

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

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: 59362acfd3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/release-stable.yml Outdated
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Address review on PR 2989. Two issues:

- The promote step refetched `origin/stable` and pushed it, so a newer commit landing on stable while the release was still publishing would be promoted to docs-stable before the next run actually published it. The orchestrator now emits `promote_sha` (current HEAD) only when no package failed and no deferral happened; the workflow gates the push on that output and pushes the explicit SHA instead of refetching.
- The preview workflow called `gh pr comment` without checking out the repo, so gh had no repo context. Added `--repo "$GITHUB_REPOSITORY"`.
@caio-pizzol caio-pizzol merged commit a4d2dae into main Apr 29, 2026
6 checks passed
@caio-pizzol caio-pizzol deleted the caio/docs-production-gate branch April 29, 2026 10:28
caio-pizzol added a commit that referenced this pull request Apr 29, 2026
* ci(release): gate production docs on stable release success

Mintlify currently deploys from main, so docs ship as soon as a doc commit lands, often weeks before the underlying packages reach npm via the weekly stable release. Move production docs onto a `docs-stable` branch that the release workflow only advances after every publish step succeeds, so docs and packages move together.

- release-stable.yml pushes stable -> docs-stable as its final step, only reachable on full success
- new preview-stable-docs.yml triggers a Mintlify preview for any PR targeting stable so the promote-stable PR shows reviewers the exact docs that will go live
- requires manual setup before this can take effect: create the docs-stable branch from current stable, switch Mintlify's deployment branch in the dashboard, and add MINTLIFY_API_KEY / MINTLIFY_PROJECT_ID repo secrets (preview workflow no-ops without them)

* fix(release): gate docs-stable promote on verified release SHA

Address review on PR 2989. Two issues:

- The promote step refetched `origin/stable` and pushed it, so a newer commit landing on stable while the release was still publishing would be promoted to docs-stable before the next run actually published it. The orchestrator now emits `promote_sha` (current HEAD) only when no package failed and no deferral happened; the workflow gates the push on that output and pushes the explicit SHA instead of refetching.
- The preview workflow called `gh pr comment` without checking out the repo, so gh had no repo context. Added `--repo "$GITHUB_REPOSITORY"`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants