fix(ci): skip version registration for latest release and sort by semver#338
Conversation
Greptile SummaryThis PR removes the static
Confidence Score: 4/5Safe to merge for normal forward-release workflows; the sort and stamp logic work correctly for the common case. The core changes are mechanically sound. The sort-and-rebuild loop hard-codes display-name from the raw slug, silently discarding any future custom labels, and the GH_TOKEN env binding is dead code left over from the old gh api call. Neither affects current behaviour. .github/workflows/publish-fern-docs.yml — the sort rebuild loop and the unused GH_TOKEN env warrant a second look. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Tag push / manual dispatch] --> B{is_release?}
B -- false / pre-release --> G
B -- true --> C{version file already exists?}
C -- yes --> G
C -- no --> D[Generate fern/versions/vX.Y.Z.yml from tag]
D --> E[Append entry then sort -rV and rebuild list]
E --> F[Prune oldest entries beyond MAX_VERSIONS]
F --> G[Checkout frozen version content]
G --> H[Stamp versions_0 as Latest vX.Y.Z]
H --> I[fern generate docs - Publish]
I --> J{is_release?}
J -- false --> K[Done]
J -- true --> L[Restore pre-stamp docs.yml]
L --> M[Open PR to persist registry changes to main]
Reviews (3): Last reviewed commit: "fix(ci): frozen-only versioning — remove..." | Re-trigger Greptile |
Port NVSentinel#1315: - Skip registration when tag matches the latest GitHub release (the Latest stamp already covers it, avoiding a duplicate dropdown entry) - Sort versioned entries by semver descending after insertion so backport patches don't appear above newer releases Signed-off-by: Pete MacKinnon <[email protected]>
…ster All dropdown versions now serve frozen content from their git tag. The newest entry is stamped "Latest · vX.Y.Z" at publish time (transient, not persisted). Removes the skip-latest logic that caused version gaps. - Remove the Latest entry pointing at live docs/index.yml - Always register every release (no SHOULD_REGISTER skip) - Stamp step targets the first version entry (newest after sort) - Prune counts versions directly (no +1 offset for Latest) Signed-off-by: Pete MacKinnon <[email protected]>
f4f6498 to
3d31d7f
Compare
|
Updated to frozen-only versioning — addresses the gap issue greptile flagged:
Simulated locally — v0.4.0 publish shows Aligned with the NVSentinel frozen-versions branch (pdmack/NVSentinel@pdmack/fern-frozen-versions). |
Description
Port NVSentinel#1315 to topograph:
Latest · vX.Y.Zstamp already covers it, so a separate version entry would create a duplicate in the dropdownsort -rVafter insertion so backport patches (e.g. v0.3.1 after v0.4.0) don't end up above newer releasesChecklist
git commit -s).