Skip to content

feat(cli): make sdk-config authoritative for generation - #17759

Merged
bears4barrett merged 4 commits into
mainfrom
FSDK-1774/improve-sdk-migrate
Sep 16, 2026
Merged

bears4barrett merged 4 commits into
mainfrom
FSDK-1774/improve-sdk-migrate

Conversation

@bears4barrett

@bears4barrett bears4barrett commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Description

Makes sdk-config.yml authoritative when generating SDKs with fern generate --sdk-config.

Changes

  • Builds API workspaces directly from SDK Config sources and targets.
  • Avoids loading or validating generators.yml when --sdk-config is provided.
  • Supports OpenAPI, AsyncAPI, and GraphQL sources.
  • Propagates SDK Config package and output settings through sdk-gen-api.
  • Rejects --group with --sdk-config, since SDK Config targets are authoritative.
  • Updates fern sdk migrate to omit generatorVersion, allowing targets to use the latest supported generator.
  • Removes the obsolete logic that matched SDK Config targets against generators.yml groups.

Backwards compatibility

Generation without --sdk-config continues through the existing generators.yml path unchanged.

Hand-authored generatorVersion values remain supported as exact pins. When omitted, the CLI resolves the latest supported generator during generation.

Testing

  • Added SDK Config workspace construction coverage.
  • Added project-loading coverage without generators.yml.
  • Added remote request package and output propagation coverage.
  • Updated migration unit and end-to-end tests to verify generatorVersion is omitted.

Devin Review

@nitpickybot nitpickybot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Review Summary

This PR makes sdk-config.yml authoritative for fern generate --sdk-config, replacing generators.yml group matching with an in-memory OSSWorkspace built from SDK Config sources/targets. Overall the approach is coherent, but the removal of validateSdkConfigImportSettings drops a validation path, and a few details in createSdkConfigWorkspace (temp file extension for remote specs, silently dropping extra overlays vs. failing, output path handling) deserve a second look.

  • 🟡 2 warning(s)
  • 🔵 2 suggestion(s)

AI Review

🔵 suggestion — packages/cli/cli/src/commands/generate/createSdkConfigWorkspace.ts (line 160)

Failing hard when a source declares more than one overlay is fine, but the surrounding code then silently uses only overlays[0]. Since a single overlay is supported and >1 throws, the intent is clear — just note that any future schema change allowing multiple overlays will hit this hard error at generation time rather than at config parse time. Consider surfacing this constraint in the SDK Config schema validation instead, so users learn about it before running generation.


This review is complete for the current scope. Addressing all critical and warning findings above satisfies the review; suggestions are optional. Request another review only if subsequent changes introduce new behavior or materially expand the pull request's scope.

Comment thread packages/cli/cli/src/commands/generate/createSdkConfigWorkspace.ts
Comment thread packages/cli/cli/src/commands/generate/createFernSourceArchiveResolver.ts Outdated
Comment thread packages/cli/cli/src/commands/generate/createSdkConfigWorkspace.ts Outdated

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 5 potential issues.

2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Comment thread packages/cli/cli/src/commands/generate/loadSdkConfigV1.ts
Comment thread packages/cli/cli/src/commands/generate/createSdkConfigWorkspace.ts
Comment thread packages/cli/cli/src/commands/generate/createSdkConfigWorkspace.ts
Comment thread packages/cli/cli/src/commands/generate/createSdkConfigWorkspace.ts Outdated
@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Docs Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-09-16T04:06:27Z).

Fixture main PR Delta
docs 268.5s (n=5) 196.9s (35 versions) -71.6s (-26.7%)

Docs generation runs fern generate --docs --preview end-to-end against the benchmark fixture with 35 API versions (each version: markdown processing + OpenAPI-to-IR + FDR upload).
Delta is computed against the nightly baseline on main.
Baseline from nightly run(s) on main (latest: 2026-09-16T04:06:27Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-09-16 16:29 UTC

@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-09-16T04:06:27Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
csharp-sdk square 95s (n=5) 113s (n=5) 79s -16s (-16.8%)
go-sdk square 134s (n=5) 295s (n=5) 147s +13s (+9.7%)
java-sdk square 221s (n=5) 272s (n=5) 199s -22s (-10.0%)
php-sdk square 78s (n=5) N/A 56s -22s (-28.2%)
python-sdk square 157s (n=5) 252s (n=5) 157s +0s (+0.0%)
ruby-sdk-v2 square 102s (n=5) 148s (n=5) 111s +9s (+8.8%)
rust-sdk square 181s (n=5) 208s (n=5) 150s -31s (-17.1%)
swift-sdk square 58s (n=5) 435s (n=5) 54s -4s (-6.9%)
ts-sdk square 170s (n=5) 167s (n=5) 134s -36s (-21.2%)

main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via fern generate). main (E2E): full customer-observable time including build/test scripts (nightly baseline, informational). Delta is computed against generator-only baseline.
⚠️ = generation exited with a non-zero exit code (timing may not reflect a successful run).
Baseline from nightly runs on main (latest: 2026-09-16T04:06:27Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-09-16 16:31 UTC

@bears4barrett
bears4barrett requested a review from zamn September 16, 2026 15:36
Comment thread packages/cli/cli/src/commands/generate/createSdkConfigWorkspace.ts
@bears4barrett
bears4barrett merged commit a4490fe into main Sep 16, 2026
222 checks passed
@bears4barrett
bears4barrett deleted the FSDK-1774/improve-sdk-migrate branch September 16, 2026 16:33
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