Skip to content

Add publish-v1-specs workflow - #195

Open
zacchua-stripe wants to merge 4 commits into
masterfrom
zacchua/publish-private-preview-workflow
Open

Add publish-v1-specs workflow#195
zacchua-stripe wants to merge 4 commits into
masterfrom
zacchua/publish-private-preview-workflow

Conversation

@zacchua-stripe

@zacchua-stripe zacchua-stripe commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What

Follow up to https://docs.google.com/document/d/1RH_6VhWlPGnBX17bwu1WWXCaBjDO3CtKqg7nfRdLS8o/edit?tab=t.0. This PR adds .github/workflows/publish-v1-specs.yaml, a private-preview-only workflow that sits downstream of LockAndReleasePrivatePreviewSpecs, pulls the v1 specs from the CDN, and publishes them to stripe/openapi for a given API version.

It is functionally equivalent to the private-preview (beta) path of pay-server's api-codegen/tools/publish.sh. The difference is that specs are pulled from the CDN instead of a local build directory.

How it works

  1. Checks out openapi with full history and tags.
  2. Checks out the immutable stripe/sdk-codegen@v17.0.0 commit and installs just and Node 24 to provide the diff CLI.
  3. Downloads the required private-preview specs and optional fixtures from the CDN into openapi/.
  4. Commits fixtures, then the private-preview spec, if changed. When the spec changes, it generates rest.md and seven per-language diffs, commits upcoming-changes/, tags vN, and pushes atomically.

publish_release

The publish_release input defaults to false. By default, the workflow fetches, builds, and diffs without touching master or tags, then force-pushes the local commits to the disposable dry-run/private-preview branch for inspection. Tags are never created or pushed in this mode.

Setting publish_release to true publishes the commits to master and creates the release tag. The follow-up Mint wiring must set this input explicitly for production releases.

Context

Triggered by the Zoolander LockAndReleasePrivatePreviewSpecs workflow, which currently dispatches stripe/openapi under a PLACEHOLDER_WORKFLOW_NAME. Replacing that placeholder with this workflow's filename and passing publish_release: true is a separate, follow-up Mint PR.

Note: a full end-to-end test requires a dry-run Zoolander run to first publish a version to the CDN.

zacchua-stripe and others added 2 commits August 20, 2026 14:57
Adds a workflow_dispatch workflow that publishes v1 private-preview specs
for a given API version and cuts a release, mirroring the private-preview
(beta) path of pay-server's api-codegen/tools/publish.sh.

It pulls the specs from the Statics Commander CDN (instead of a local build
dir), commits them to master, generates per-language diffs against the
private-preview spec, and tags the release. Triggered by the zoolander
LockAndReleasePrivatePreviewSpecs workflow.

A dry_run input (default true) fetches, builds, and diffs without pushing,
uploading the would-be output as an artifact for inspection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Committed-By-Agent: claude
- Diff the GA spec (openapi/spec3.sdk.yaml), old-tag vs. working tree,
  exactly as publish.sh's beta path does, instead of the private-preview spec.
- In dry-run, force-push local commits to a disposable dry-run/private-preview
  branch for inspection instead of uploading an artifact; never create or push
  a tag (a stray vN would corrupt the next real run's describe increment).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Committed-By-Agent: claude
Comment thread .github/workflows/publish-private-preview.yml Outdated
Comment thread .github/workflows/publish-private-preview.yml Outdated
Adds a `mode` choice input (private-preview / public-preview / GA / all).
Only private-preview is implemented; the other channels fail fast at a new
"Resolve mode configuration" step until the zoolander dispatcher and CDN keys
for them are wired up. Mode-specific values (CDN subpath, spec/fixture
filenames, commit and tag messages, dry-run branch) are resolved into env vars
so the download and release steps stay mode-agnostic. Dry-run branch is now
dry-run/<mode>.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Committed-By-Agent: claude
@zacchua-stripe
zacchua-stripe marked this pull request as ready for review August 21, 2026 18:28
@zacchua-stripe
zacchua-stripe requested a review from xavdid August 21, 2026 18:28
@zacchua-stripe zacchua-stripe changed the title Add publish-private-preview workflow Add publish-v1-specs workflow Aug 21, 2026

@xavdid xavdid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

had a couple of nits, but the big blocker is to use the more secure Github actions (and figuring out why that didn't get flagged here in the first place)

Comment thread .github/workflows/publish-v1-specs.yaml Outdated
runs-on: ubuntu-latest
steps:
- name: Fetch app installation token
uses: tibdex/github-app-token@v1.5.2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This (and all other actions) should be using the new action and pinned hashes from #194

I'm actually surprised there wasn't a new CI job that failed on this branch because you're not pinning a version. so maybe double check why it didn't yell at you 😅

Comment thread .github/workflows/publish-v1-specs.yaml Outdated
options:
- private-preview
- public-preview
- GA

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is uppercase but the rest are lowercase

Comment thread .github/workflows/publish-v1-specs.yaml Outdated
- public-preview
- GA
- all
dry_run:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is fine, but should we invert it? Like, push_changes or something? dry_run: false is sort of a double negative, so it's a pet peeve of mine (especially if true is the default)

Comment thread .github/workflows/publish-v1-specs.yaml Outdated
export PATH="${PWD}/node_modules/.bin:${PATH}"

# `rest.md` is the language-agnostic diff (no --lang), matching publish.sh.
node ./dist/main.js diff --old-path "$OLD_SPEC" --new-path "$NEW_SPEC" --output-path "$DIFF_DIR/rest.md"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: I would use just --no-deps diff ... instead of reaching into main.js directly

Comment thread .github/workflows/publish-v1-specs.yaml Outdated
uses: actions/checkout@v4
with:
repository: stripe/sdk-codegen
ref: v17.0.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does this need to pin a specific codegen version?

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
@zacchua-stripe

Copy link
Copy Markdown
Contributor Author

Thanks for the comments @xavdid! Do you mind taking a second pass? Thank you! 🙏

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.

2 participants