Autoversion counts SDK artifacts synced after the previous generation

Aperta
#18,903 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
openapi, python, typescript
Ambito
release

Direzione di ricerca

Start by reading the prior fix in #16874 and the symptom in #16870, since this report says the lockfile advance already works and the problem is in what the snapshot comparison contains. Then trace where autoversion reads .fern/replay.lock and builds the diff between the previous generation SHA and the new [fern-generated] tree, and check how .fernignored paths like the bundled openapi.json and code-examples.json enter that diff. Done means an exclusion or comparison change plus a regression test that repeats a generation after an artifact-only sync with identical generator inputs and asserts no version bump or release entry.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

component:sdks lang:python lang:typescript priority:p1-high
Component

SDKs

Priority

P1 - High (Strongly needed)

SDK Language(s)

TypeScript, Python

Bug Description

Fern Autorelease can count OpenAPI and example files synced after generation as changes in the next release, even when both files are protected by .fernignore. We saw both SDKs re-announce already released API changes and propose a second major bump.

Steps to reproduce
  1. Enable Autorelease and Replay with GitHub in pull-request mode.
  2. Generate a release with a visible API change. On the release PR, run a workflow after generation that updates the bundled openapi.json and code-examples.json. Keep both paths in .fernignore so regeneration preserves them.
  3. Merge that release and trigger another generation with a small change. Compare the new [fern-generated] tree with the prior generation SHA in .fern/replay.lock, then compare it with its parent on SDK main.
Expected behavior

Autoversion should classify and describe the new SDK changes. Updates to release artifacts already shipped with the previous SDK should contribute no changes to the next version analysis. A regression test could repeat the generation after an artifact sync with identical generator inputs and assert that the sync alone produces no bump or release entry.

Actual behavior and evidence

The previous generation SHA resolves in both repos, and both new PRs advance current_generation. The prior snapshot predates the artifact sync, while the new generation inherits the synced files from SDK main. The raw snapshot-to-snapshot diff includes about 1,500 changed lines across the OpenAPI and example files per SDK. Neither file changes between the new generation commit and its parent on SDK main.

The only new API change was documenting that the optional Lang2FHIR batch status field detect_retries is deprecated and omitted for new items. The original generated releases instead proposed TypeScript 20.0.0 → 21.0.0 and Python 19.0.0 → 20.0.0, and repeated previously shipped changes such as FHIR-to-OMOP batch, de-identification, and page-filter removal. We corrected those PRs to patch releases.

SDK Previous release Prior generation SHA New generation SHA Original autoversion output
TypeScript PhenoML/phenoml-ts-sdk#294 007dde41b34cb343c58e35469b4a501f54afe6b2 8e389904af383e7982ec08200059049414a319be TypeScript autoversion commit in PhenoML/phenoml-ts-sdk#295
Python PhenoML/phenoml-python-sdk#290 9692a0b94c42b5a4f8a3b1e199697d77df66356d 926b002f5be814cca4a2e14ffbcd6eda8c241077 Python autoversion commit in PhenoML/phenoml-python-sdk#291

This has the same symptom as #16870. The fix in #16874 addressed persisting the lockfile advance. In this repro the lock advances successfully, and the contents of the snapshots cause the carryover.

A configurable exclusion list for autoversion would address this setup. We would exclude code-examples.json and the bundled spec paths, openapi/openapi.json in TypeScript and src/phenoml/openapi/openapi.json in Python. These files still need to ship in our SDK packages.

Versions
  • Fern CLI 5.228.1, hosted SDK Generation
  • fernapi/fern-typescript-sdk 3.107.3
  • fernapi/fern-python-sdk 5.41.4
Workaround

Compare the generated SDK with the last released SDK and correct the version, changelog, and PR description before merging.

Lingua principale
TypeScript
Stelle
3.8k
Fork
376
Merge medio
9h 15m
PR unite (30g)
171

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fern-api/fern

Tutte le issue di fern-api/fern

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.