Repository navigation
feat(scripts): extract a baseline API surface for every extractable language - #244
Merged
Merged
Conversation
…anguage Only Node was handed its shipped surface at generation time, so every other emitter generated blind and nothing stopped a parameter from shifting position or a method from changing name between releases. The Pipes bodies did exactly that to PHP: the emitter's compatibility code in oagen-emitters#284 only acts when a surface is present, and the pipeline never gave it one. The extraction now runs for any language oagen can extract whenever the output is a live checkout; a scratch directory has no history worth preserving and gets none. --baseline-ref (default HEAD) picks the commit to extract when HEAD is not the surface to preserve, which is PHP's case today: 9.5.0 shipped without the Pipes parameters, so the repair release baselines on v9.4.0 through the matrix. An explicit ref that cannot be honored is an error, never a silent no-op.
Contributor
[High impact] The PR appears safe to merge; all three previous findings are addressed. SummaryThe PR extends API baseline extraction to all supported languages and adds
|
…baseline counts A scratch directory inside this repository, such as .oagen/python/sdk, sits inside a git work tree, so the first cut would have made a worktree of openapi-spec itself and extracted that as the baseline on every repeat run. Only a directory that is the root of its own checkout is a live SDK now. --baseline-ref HEAD was also indistinguishable from the default and so slipped past the checks that make an unhonorable request fail; the flag is tracked separately from its value. The validation workflow passes the matrix baseline too, so pre-merge checks exercise the signatures the release path will ship.
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
sdk-generate.shextracted a baseline API surface for Node only, so every other emitter generated blind: nothing stopped a parameter from shifting position or a method from changing name between releases. PHP paid for that with the Pipes bodies. The compatibility code in workos/oagen-emitters#284 only acts whenctx.apiSurfaceis present, and this pipeline never supplied one.What changes
oagen extractsupports (node, php, python, ruby, go, rust, kotlin, dotnet) whenever--outputis a live checkout. A scratch directory still gets no surface. The Node-only manifest recovery step stays Node-only.--baseline-ref <git-ref>(defaultHEAD) chooses the commit to extract. A tag missing from a shallow checkout is fetched on demand. An explicit ref that cannot be honored, because the output is not a git checkout, the language has no extractor, or the ref does not exist, fails the run instead of silently generating without it.generate-prs.ymlandvalidate-sdks.ymlpass--baseline-reffrom an optionalbaseline_refinsdk-matrix.json, so pre-merge validation exercises the same signatures the release path ships. PHP is set tov9.4.0for its repair release, since 9.5.0 shipped the Pipes methods with every body parameter dropped. Remove that entry once the repaired PHP release is tagged.Proof
HEAD, with and without a surface extracted from that sameHEAD. Ruby, Go, .NET, PHP (on emittersmain): 0 files differ. Kotlin: 0 source files, only Gradle caches. Python: 88 files, the baseline enum compat aliases and their barrel re-exports, by design. Rust: 7 model files renamed toward the shipped names plus a few added or removed, because the overlay elects baseline names for deduplicated models; intended, but the Rust owner should see it before relying on it.--lang php --baseline-ref v9.4.0against a worktree ofworkos-phpHEAD extracted fromv9.4.0, passed the surface, and emittedauthorizeDataIntegration(slug, userId, organizationId, connectionOwner, returnTo, config, options, accountDisplayName, connectionIntent, connectedAccountId): 9.4.0's order through$options, the new optionals appended. The two organization writes, where the API now requiresuser_id, fell back to the schema signature with a named warning, as that PR now does.--baseline-refon a scratch output, on a language without an extractor, and with an unknown tag: each exits 1 with a one-line reason. Ruby live checkout with the default baseline: surface passed, extracted atHEAD. Elixir: no extractor, generates as before.Related to PIPES-900