diff --git a/docs/runbooks/sdk-generation-stlc.md b/docs/runbooks/sdk-generation-stlc.md index 5ba1cc77..7828bc9f 100644 --- a/docs/runbooks/sdk-generation-stlc.md +++ b/docs/runbooks/sdk-generation-stlc.md @@ -9,18 +9,19 @@ Hypeman's Go, Python, and TypeScript SDKs are generated by internal SDK staging repositories and posts one build-manifest comment. 2. Merging the config PR validates the integrated SDKs and pushes staging `main` only after bootstrap, lint, tests, and clean-worktree checks pass. -3. Each staging repo opens or updates one `stainless/release` PR against its - public production repo. Merge it with a merge commit; never squash or rebase. -4. Release-please opens the version and changelog PR in production. Merging it - publishes the package. -5. The scheduled sync fast-forwards production commits back into staging. +3. The staging `stlc-promote.yml` workflow merges validated staging changes into + the production repo's `next` branch. A conflict opens a recovery PR instead + of rewriting either repository's history. +4. Release-please maintains the version and changelog PR from `next` to `main`. + Merging it creates the release and publishes the package. +5. The scheduled sync fast-forwards production `main` back into staging. ## Normal API changes Update `openapi.yaml` and `stainless.yaml`, then open a PR. Review the generated -preview branches and manifest diagnostics before merging. The public SDK -promotion PRs are created or updated automatically; publishing requires merging -them with merge commits, then merging the release-please PRs. +preview branches and manifest diagnostics before merging. The production `next` +branches and release-please PRs are updated automatically; publishing requires +merging the release-please PRs. Every merged SDK-affecting PR becomes a releasable SDK commit automatically. Explicit `feat:`, `fix:`, `perf:`, and `revert:` titles are preserved; other @@ -39,6 +40,22 @@ The run creates a unique `stlc/integration-test/run-` branch and draft PR in all three staging repos. Never merge these PRs; close them and delete their branches after review. +## Bootstrapping a staging workflow + +GitHub does not emit a `push` event when a workflow file first arrives on an +existing staging `main` branch. After adding `stlc-promote.yml` to a staging SDK +for the first time, dispatch it once manually: + +```bash +gh workflow run stlc-promote.yml \ + --repo kernel/hypeman-python-staging \ + --ref main +``` + +After that one-time dispatch, generation pushes trigger promotion normally. +Verify that production `next` exists and that release-please opened a PR from +`next` to `main` before publishing the first package. + ## Custom code and recovery Edit custom code in `stainless/sdks//`, then seal and commit it from the diff --git a/stainless/custom-code/python/2026-08-17T14-04-38-940Z-custom-code.json b/stainless/custom-code/python/2026-08-17T14-04-38-940Z-custom-code.json new file mode 100644 index 00000000..a14030f8 --- /dev/null +++ b/stainless/custom-code/python/2026-08-17T14-04-38-940Z-custom-code.json @@ -0,0 +1,6 @@ +{ + "base": "192444585c150d0f39dbb7038bb67176c44aef2c", + "integrated": "caf71961faafb465db0d8f7c00de1d40e56ba731", + "filename": "2026-08-17T14-04-38-940Z-custom-code.json", + "branch": "main" +}