ci: release the SDK on any change that alters what it ships - #470
Open
josecarneiro wants to merge 1 commit into
Open
ci: release the SDK on any change that alters what it ships#470josecarneiro wants to merge 1 commit into
josecarneiro wants to merge 1 commit into
Conversation
The auto-release gate only fired on `clients/*/openapi.json`, so a change to the SDK's own runtime (proxy.ts, retry.ts, client-factory.ts), to a hand-written client module (schema-model.ts, additional-types.ts), or to the generator itself never published. #464 and #469 both landed on main unpublished and only shipped when an unrelated spec PR swept them up. The gate now matches those paths too, and excludes the generated output under src/{apis,types,models,definitions,docs} — the auto-release commit rewrites those itself, so matching them would make it re-trigger this job and bump versions in a loop. The release commit also now carries `[skip release]`, which the job's own `if` already honours, as a second layer in case the exclusion is later widened carelessly. Verified the new expression against real commit file lists: a spec change, #464, #469, an SDK runtime fix and a generator change all trigger; the auto-release commit 5e39d9c, docs-only, changeset-only and generated-output-only changes all do not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXhwfYV419Bodt42E3aw2C
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
auto-releasegate fires only onclients/*/openapi.json. That misses everything else that changes what@epilot/sdkactually ships:proxy.ts,retry.ts,client-factory.ts,authorize.ts,overrides.ts,large-response.ts. A bug fix in any of these never publishes.schema-model.ts,additional-types.ts,index.ts.scripts/generate-sdk-v2.ts, which changes the output of all 51 APIs.This is not hypothetical: #464 and #469 both landed on
mainand published nothing. #464 only reached npm ~90 minutes later, as a passenger on #467, an unrelated spec PR. #469 is still unpublished.The trap this has to avoid
The
auto-releasejob commits back tomain, and that commit touches generated SDK output. From5e39d9ce:So a naive
packages/epilot-sdk-v2/src/**pattern would make the release commit re-trigger its own gate → bump → push → trigger → an unbounded release loop. The existing[skip release]guard does not save you, because the release commit's message is@epilot/sdk@2.19.12, @epilot/cli@0.1.141.The gate works today partly by accident: the release commit happens to match nothing in it. Widening removes that accidental protection, so this PR restores it deliberately.
What changed
The gate matches hand-written paths and excludes generated output:
A denylist for the generated dirs rather than an allowlist of runtime files, so a new hand-written module is covered by default instead of silently missed.
The release commit now carries
[skip release], which the job's ownifalready honours — a second layer, in case the exclusion is later widened carelessly. The path exclusion alone closes the loop; this makes it hard to reopen by accident.The CLI gate is untouched.
Test plan
Ran the new expression against real commit file lists, including the actual release commit:
sdk=trueschema-model.tssdk=truesdk=truesrc/retry.ts)sdk=truesdk=true5e39d9ceitselfsdk=falsesdk=falsesdk=falsesdk=false.github/workflows/ci.ymlparses as valid YAML, all five jobs intactpnpm lintcleanOut of scope
This covers
@epilot/sdkonly. The client packages (@epilot/pricing-clientet al.) publish through changesets, which is manual — that is whypricing-clientsits at 3.56.2 in the repo against 3.55.1 on npm. Whether that should auto-publish on merge is a separate decision.Generated by Claude Code