Conversation
…default Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Contributor
🌱 Seed Test SelectorSelect languages to run seed tests for:
How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR. |
…n by default Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
devin-ai-integration Bot
added a commit
to fern-api/actions
that referenced
this pull request
Apr 9, 2026
…eration Remove fern-api.ts (installation token client) and push-diff.ts (diff branch pushing) — Fiddle now handles npm publishing and diff branch pushing server-side. The action now just runs `fern sdk preview --json --group <group>` which routes through Fiddle by default (no --output flag), then posts a PR comment with install links and diff URLs from the CLI JSON output. Depends on: - fern-api/fiddle#682 (preview diff branch push in GithubFiddleTask) - fern-api/fern#14856 (remote Fiddle routing in fern sdk preview) Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
3 tasks
…te preview - Default fern sdk preview (no flags): publishV2(npmOverride) → registry-only publish, safe to merge independently - With --push-diff: githubV2(push) + preview=true → Fiddle publishes AND pushes diff branch to SDK repo - Added explicit isPreview param to remote generation chain (createAndStartJob, runRemoteGenerationForGenerator, runRemoteGenerationForAPIWorkspace) so preview flag can be set independently of absolutePathToPreview Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
fern sdk preview through Fiddle for remote generation by defaultfern sdk preview through Fiddle for remote generation by default
…lish In Fiddle, preview=true causes dryRun=true in the generator config, which makes the generator run 'npm publish --dry-run' instead of actually publishing. For sdk preview via publishV2(npmOverride), we want the generator to actually publish to the registry. Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
…ditional on pushDiff, clarify JSDoc Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
…-diff Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
…ndle dryRun Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
…port - Add `fiddlePreview` param to decouple what's sent to Fiddle as `preview` from CLI-internal `isPreview` behavior. For sdk preview, isPreview=true (lenient env vars, skip version check) while fiddlePreview=false (so Fiddle doesn't set dryRun=true). This preserves fern generate --preview behavior exactly as-is. - Add `pushPreviewBranch` param threaded through the remote generation chain. Will be sent to Fiddle once fiddle-sdk is bumped. - Add `--push-diff` CLI flag for pushing preview branches to SDK repos. - Add `getGithubOwnerRepo` helper and pushDiff support to `overrideGroupOutputForRemotePreview` — uses githubV2(push) with npm publishInfo when --push-diff is set and generator has github config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fern sdk preview through Fiddle for remote generation by default…ction Merge the local-Docker-only overrideGroupOutputForPreview and remote-only overrideGroupOutputForRemotePreview into a single exported function with an optional pushDiff param. Extract createNpmOverrideOutputMode helper to deduplicate the publishV2(npmOverride) construction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Error out on --push-diff until fiddle-sdk is bumped with pushPreviewBranch support — without it, Fiddle would treat the githubV2(push) job as a normal push to the default branch. - Error on --push-diff combined with --output (incompatible flags). - Warn when --push-diff falls back to registry-only publish because the generator has no github output configuration. - Clarify the dryRun comment in createAndStartJob.ts explaining that fiddlePreview is the sole mechanism preventing dryRun for sdk preview jobs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document the behavior differences between modes: omitting --output uses remote generation, providing it uses local Docker. Add examples for --output combinations. Clarify --push-diff branch naming, GitHub App requirement, and incompatibility with --output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Swimburger
approved these changes
Apr 10, 2026
…mote generation Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
…of --output Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
Co-Authored-By: barry.zou <barry.zou@buildwithfern.com>
…preview When --output is provided without a registry URL and without --local, remote generation was using the generator's original output mode (e.g. npm publish to registry.npmjs.org) which fails. Override to downloadFiles so the generator produces files without publishing, and the CLI downloads them from S3 to the specified path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover getGithubOwnerRepo, overrideGroupOutputForDownload, and overrideGroupOutputForPreview including pushDiff routing logic. Add clarifying comment on publishV2 being registry-only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
isPreview was threaded to createAndStartJob only to participate in the fallback chain for the Fiddle preview flag, but no caller needed it — fern sdk preview already passes fiddlePreview explicitly, and fern generate --preview relies on absolutePathToPreview != null. Simplify the fallback to: fiddlePreview ?? absolutePathToPreview != null. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Swimburger
approved these changes
Apr 10, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
automationMode and autoMerge are in the type signature but not destructured on main (they're commented out in the createJobV3 call). The merge conflict resolution incorrectly added them to the destructuring. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Description
Routes
fern sdk previewthrough remote generation by default (matchingfern generate), adds--localflag to opt into local Docker execution, and adds--push-diffflag for pushing preview branches to SDK repos.fern sdk previewfern sdk preview --output ./pathfern sdk preview --local --output ./path --output https://registryfern sdk preview --push-difffern sdk preview --localfern sdk preview --local --output ./pathKey design: decoupled preview semantics
The CLI needs preview mode internally (lenient env var substitution, skip version check, skip dynamic IR upload), but sending
preview: trueto the generation service causes dry-run mode which prevents actual publishing.Solution: New
fiddlePreviewparameter that overrides what's sent to the generation service as thepreviewfield. Forfern sdk preview, we sendfiddlePreview: falseso the service doesn't dry-run. Forfern generate --preview,fiddlePreviewis undefined and falls back to the existing behavior (absolutePathToPreview != null, which is true for preview — preserving dry-run exactly as-is).This avoids any server-side dry-run logic changes, eliminating regression risk for
fern generate --preview.Changes Made
cli.ts: Add--localand--push-diffboolean options.--localopts into local Docker generation;--push-diffcannot be combined with--local. Pass both tosdkPreview().sdkPreview.ts: Route based on--localflag (useRemoteGeneration = !local) instead of presence of--output. PassabsolutePathToPreview: absolutePathToOutputto remote generation so--outputdownloads files from S3. Validate--push-diff+--localincompatibility. Warn when--push-difffalls back due to missing github config.overrideOutputForPreview.ts: Consolidate local/remote output override into single function with optionalpushDiffparam. ExtractcreateNpmOverrideOutputModehelper. WhenpushDiff=trueand generator has github config, usegithubV2(push)with npmpublishInfo. Add unit tests forgetGithubOwnerRepo,overrideGroupOutputForDownload, andoverrideGroupOutputForPreview.createAndStartJob.ts: AddfiddlePreviewandpushPreviewBranchparams. Overridepreviewfield sent to the generation service viafiddlePreview ?? absolutePathToPreview != null.pushPreviewBranchis threaded but commented out until the server-side SDK is bumped.runRemoteGenerationForAPIWorkspace.ts/runRemoteGenerationForGenerator.ts: ThreadfiddlePreviewandpushPreviewBranchthrough the remote generation chain.versions.yml: Add 4.66.0 changelog entry.Safety
--push-diffis gated with an error until the server-side SDK is bumped — prevents sending a github push job without the preview branch flag, which would write to the default branch.fern generate --previewis completely unaffected —fiddlePreviewis only set in thesdkPreview.tscode path.Human review checklist
RemoteTaskHandlercorrectly downloads generated files toabsolutePathToOutputwhen set — verified end-to-end withfern sdk preview --output ./out.--localflag is independent of--output:--localalone still publishes to the preview registry via Docker. Verify this matches product intent.fiddlePreview: falseis the critical behavioral change — it prevents the generation service from settingdryRun=true. If the service's dry-run logic changes in the future, this coupling should be revisited.--output ./path --output https://registry) is fully stubbed and routed for both local and remote paths, but the custom-registry-URL flow through remote generation has not been verified end-to-end.Testing
fern sdk preview→ package published to preview registry via remote (no dry-run)fern sdk preview --output ./out→ remote generation, files downloaded to diskfern sdk preview --local→ local Docker, package published to preview registryfern sdk preview --local --output ./out→ local Docker, files on diskfern sdk preview --local --output ./out --output https://registry→ local Docker, files on disk + custom registryfern sdk preview --push-diff→ errors with "not yet available" (gated until server update)fern generate --preview→ existing behavior preserved (dry-run)fern generate→ completely unaffectedLink to Devin session: https://app.devin.ai/sessions/92d936472d7a4bf187ae6b52721f36fd