Skip to content

Commit b5d0a16

Browse files
fix(cli): only upload dynamic IR after successful SDK generation (#11380)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Catherine Deskur <[email protected]>
1 parent 97a581b commit b5d0a16

File tree

2 files changed

+38
-22
lines changed

2 files changed

+38
-22
lines changed

packages/cli/cli/versions.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# yaml-language-server: $schema=../../../fern-versions-yml.schema.json
2+
- version: 3.30.6
3+
changelogEntry:
4+
- summary: |
5+
Only upload dynamic IR for SDK generation after confirmed success and when not in preview mode.
6+
type: fix
7+
createdAt: "2025-12-23"
8+
irVersion: 62
9+
210
- version: 3.30.5
311
changelogEntry:
412
- summary: |

packages/cli/generation/remote-generation/remote-workspace-runner/src/runRemoteGenerationForGenerator.ts

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -161,27 +161,6 @@ export async function runRemoteGenerationForGenerator({
161161
ir.sourceConfig = sourceConfig;
162162
}
163163

164-
// Upload dynamic IR for SDK generation (for dynamic snippets)
165-
if (generatorInvocation.language != null && packageName != null && resolvedVersion != null && !isPreview) {
166-
try {
167-
await uploadDynamicIRForSdkGeneration({
168-
fdr,
169-
organization,
170-
version: resolvedVersion,
171-
language: generatorInvocation.language,
172-
packageName,
173-
ir,
174-
smartCasing: generatorInvocation.smartCasing,
175-
dynamicGeneratorConfig,
176-
context: interactiveTaskContext
177-
});
178-
} catch (error) {
179-
interactiveTaskContext.logger.warn(
180-
`Failed to upload dynamic IR for SDK generation: ${error instanceof Error ? error.message : String(error)}`
181-
);
182-
}
183-
}
184-
185164
const job = await createAndStartJob({
186165
projectConfig,
187166
workspace,
@@ -218,12 +197,41 @@ export async function runRemoteGenerationForGenerator({
218197
absolutePathToPreview
219198
});
220199

221-
return await pollJobAndReportStatus({
200+
const result = await pollJobAndReportStatus({
222201
job,
223202
taskHandler,
224203
taskId,
225204
context: interactiveTaskContext
226205
});
206+
207+
// Upload dynamic IR for SDK generation (for dynamic snippets) only after successful generation
208+
if (
209+
result != null &&
210+
generatorInvocation.language != null &&
211+
packageName != null &&
212+
resolvedVersion != null &&
213+
!isPreview
214+
) {
215+
try {
216+
await uploadDynamicIRForSdkGeneration({
217+
fdr,
218+
organization,
219+
version: resolvedVersion,
220+
language: generatorInvocation.language,
221+
packageName,
222+
ir,
223+
smartCasing: generatorInvocation.smartCasing,
224+
dynamicGeneratorConfig,
225+
context: interactiveTaskContext
226+
});
227+
} catch (error) {
228+
interactiveTaskContext.logger.warn(
229+
`Failed to upload dynamic IR for SDK generation: ${error instanceof Error ? error.message : String(error)}`
230+
);
231+
}
232+
}
233+
234+
return result;
227235
}
228236

229237
function getPublishConfig({

0 commit comments

Comments
 (0)