fix: keep the ejected example compatible across releases - #3053
Draft
Marshevskyy wants to merge 2 commits into
Draft
fix: keep the ejected example compatible across releases#3053Marshevskyy wants to merge 2 commits into
Marshevskyy wants to merge 2 commits into
Conversation
…guage SDKs ignore the module runtime
|
Contributor
Performance Benchmark (Lower is Faster)
|
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
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.
What this fixes
The release PR's
examplesjob fails on every@redocly/client-generator0.x minor bump (see the failure on #3049):The checked-in ejected example (
tests/e2e/generate-client/examples/ejected-generator/generators/php/) recordsrequiresGenerator: '^<version>'at eject time, and caret on a 0.x version pins the minor, so the compatibility gate correctly rejects the example the momentchangeset versionbumps the package.The fix
scripts/refresh-ejected-example.mjsre-stamps the example's provenance headers andrequiresGeneratorrange with the current package version. Idempotent; skips non-.tsentries.release.yamlruns it in the changesetsversionblock, afterpost-changeset.js, so every release PR carries the stamped example and theexamplesjob stays green. The example is stamped to the current0.3.8in this PR, so the script's output is verifiable in the diff.A related bug this surfaced
LANGUAGE_SDK_NOT_APPLICABLEstill declaredruntime: 'the runtime is always embedded in the generated file', which stopped being true when thepython/go/phpgenerators gained--runtime module. Selecting module mode for a language SDK printed a bogus "ignores runtime" warning while honoring the option. Removed the entry, reworded theoutputModereason, updated the warning unit test, and synced the ejected example's contract block. No changeset: module runtime ships in the still-unreleased 0.4.0, so the warning never reached users.Verification
npm run unit -- packages/client-generator: 75 files / 1248 tests green.regenerate-examples.mjs(22 clients, the ejected generator loads and regenerates cleanly) andtypecheck:examples.Check yourself
Security
🤖 Generated with Claude Code
https://claude.ai/code/session_011NhwgmWzvAYidYGMKFqGMa