Skip to content

fix(seed): stop go-sdk idempotency-headers fixture from overwriting its nested config - #17318

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785761848-fix-seed-go-idempotency-nested-output
Open

fix(seed): stop go-sdk idempotency-headers fixture from overwriting its nested config#17318
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785761848-fix-seed-go-idempotency-nested-output

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description

The Update Seed workflow has failed on every push to main since 7/28 (e.g. run 30761733223, 30769540043):

Apply Patches
error: seed/go-sdk/idempotency-headers/auto-generate-idempotency-key/internal/query.go: No such file or directory

seed/go-sdk/seed.yml was the only place in the repo where one fixture had a config writing to the fixture root plus a config nested underneath it:

idempotency-headers:
  - outputFolder: .                              # writes seed/go-sdk/idempotency-headers/
  - outputFolder: auto-generate-idempotency-key   # writes a subfolder of the above

Local generation does rm -rf <output folder> before copying files (LocalTaskHandler.copyGeneratedFilesNoFernIgnoreDeleteAll), so the . config deletes the sibling's output. That folder has been thrashing in the snapshot PRs since #17009 introduced the nested config — alternately deleted and re-added (#17246#17278). It became a hard failure once #17256 changed the go core internal/query.go (present in every fixture): the shard running idempotency-headers:auto-generate-idempotency-key now uploads a patch modifying those files while the shard running idempotency-headers:. uploads a patch deleting the folder, and commit-seed-changes-by-pr applies both in one git apply. It is self-sustaining, since the snapshot on main never gets updated.

Changes Made

  • Moved the . config for go-sdk's idempotency-headers fixture into no-custom-config/ (seed.yml plus the generated snapshot, a pure file move — no content changes)
  • Added validateFixtureOutputFolders, run from loadGeneratorWorkspaces, which rejects any seed.yml fixture that mixes outputFolder: . with sibling output folders

Testing

  • Unit tests added/updated — packages/seed/src/__test__/validateFixtureOutputFolders.test.ts; pnpm test in packages/seed passes (225 tests)
  • Manual testing completed — loadGeneratorWorkspaces() against the repo's seed/ now resolves idempotency-headers to ["no-custom-config", "auto-generate-idempotency-key"], and no other seed.yml fixture trips the new validation

Link to Devin session: https://app.devin.ai/sessions/ed6999c08f884f04b6b5a7b29603e123


Open in Devin Review

…ts nested config

The '.' output folder wiped the sibling auto-generate-idempotency-key output, producing conflicting Update Seed patches.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@nitpickybot nitpickybot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI Review Summary

Straightforward fix: moves the . output config for go-sdk's idempotency-headers fixture into no-custom-config/ and adds a guard preventing a fixture from mixing outputFolder: "." with siblings. Logic is sound; the validator is a bit narrow (only catches the literal "." case) and the hard throw at load time will break unrelated seed commands.

  • 🔵 2 suggestion(s)

Comment on lines +17 to +18
const outputFolders = configurations.map((configuration) => configuration.outputFolder);
if (outputFolders.length > 1 && outputFolders.includes(".")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 suggestion

The check only catches the literal ".". It misses "./", "", and the more general nesting case (outputFolder: a + outputFolder: a/b), which has exactly the same rm -rf hazard. Consider normalizing with path.normalize and comparing prefixes:

Suggested change
const outputFolders = configurations.map((configuration) => configuration.outputFolder);
if (outputFolders.length > 1 && outputFolders.includes(".")) {
const normalized = outputFolders.map((f) => path.normalize(f ?? ".").replace(/\/+$/, ""));
const conflicts = normalized.filter((folder, i) =>
normalized.some((other, j) => i !== j && (other === folder || other.startsWith(`${folder}/`)))
);
if (conflicts.length > 0) {

(and adjust the message body accordingly). At minimum, normalize "./""." so the guard can't be trivially bypassed.

Comment on lines +63 to +66
const errors = validateFixtureOutputFolders({ workspaceName: workspace, workspaceConfig });
if (errors.length > 0) {
throw new Error(`Invalid ${SEED_CONFIG_FILENAME}:\n${errors.join("\n")}`);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 suggestion

loadGeneratorWorkspaces is called by every seed command, so one malformed seed.yml in an unrelated generator now hard-fails all of them. Consider collecting errors across workspaces and throwing once at the end (so users see every problem), or warning + skipping like the disabled branch above.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-08-03T05:11:10Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
csharp-sdk square 98s (n=5) N/A 63s -35s (-35.7%)
go-sdk square 146s (n=5) 307s (n=5) 131s -15s (-10.3%)
java-sdk square 207s (n=5) 272s (n=5) 209s +2s (+1.0%)
php-sdk square 64s (n=5) N/A 56s -8s (-12.5%)
python-sdk square 150s (n=5) 250s (n=5) 141s -9s (-6.0%)
ruby-sdk-v2 square 109s (n=5) 146s (n=5) 84s -25s (-22.9%)
rust-sdk square 204s (n=5) 215s (n=5) 206s +2s (+1.0%)
swift-sdk square 80s (n=5) 448s (n=5) 57s -23s (-28.7%)
ts-sdk square 133s (n=5) 134s (n=5) 124s -9s (-6.8%)

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-08-03T05:11:10Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-08-03 13:25 UTC

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Docs Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-08-03T05:11:10Z).

Fixture main PR Delta
docs 252.7s (n=5) 286.7s (35 versions) +34.0s (+13.5%)

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-08-03T05:11:10Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-08-03 13:25 UTC

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.

1 participant