Skip to content

fix(ci): skip version registration for latest release and sort by semver#979

Merged
mchmarny merged 3 commits into
NVIDIA:mainfrom
pdmack:pdmack/fix-publish-skip-latest-semver-sort
May 20, 2026
Merged

fix(ci): skip version registration for latest release and sort by semver#979
mchmarny merged 3 commits into
NVIDIA:mainfrom
pdmack:pdmack/fix-publish-skip-latest-semver-sort

Conversation

@pdmack

@pdmack pdmack commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Skip version registration when the tag matches the current latest release (already covered by "Latest · vX.Y.Z" stamp) and sort version entries by semver descending after insert.

Motivation / Context

Fixes: #978
Related: NVIDIA/NVSentinel#1315, NVIDIA/topograph#338

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Build/CI/tooling

Component(s) Affected

  • Other: .github/workflows/publish-fern-docs.yml

Implementation Notes

Two changes to the publish workflow, matching NVIDIA/NVSentinel#1315:

  1. Skip latest registration: New should_register output in the resolve step. If the tag equals the current GitHub latest release, should_register=false — the "Latest · vX.Y.Z" stamp already covers it. All downstream steps (register, prune, restore, PR) now gate on should_register instead of is_release.

  2. Semver sort: After inserting a new version entry, re-sort all versioned entries (index 1+) by semver descending using sort -rV. Ensures out-of-order registration (e.g. backported patch releases) doesn't scramble the dropdown.

Testing

Structural parity with NVIDIA/NVSentinel#1315 (merged) and NVIDIA/topograph#338.

Risk Assessment

  • Low — Isolated change, well-tested, easy to revert

Rollout notes: Takes effect on next tag push or workflow_dispatch.

Checklist

  • I did not skip/disable tests to make CI green
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S)

@pdmack pdmack requested a review from a team as a code owner May 19, 2026 22:20
@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: efa5dacb-32cb-4028-ba92-042da45d01fb

📥 Commits

Reviewing files that changed from the base of the PR and between 8bb189b and 5020211.

📒 Files selected for processing (1)
  • .github/workflows/publish-fern-docs.yml

📝 Walkthrough

Walkthrough

The PR modifies the publish-fern-docs.yml workflow to fix duplicate version entry registration and ordering issues. It adds logic to resolve the latest GitHub release tag and computes a should_register flag that disables registration when the target tag already matches the latest release. The workflow then sorts all versioned entries by semver descending (while preserving the "Latest" entry at index 0) after inserting a new version. Steps that depend on version registration—including version pruning and registry PR generation—are re-conditioned on the new should_register flag instead of is_release.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • NVIDIA/aicr#936: Modifies the same publish-fern-docs.yml workflow around version entry registration and docs.yml maintenance logic, including conditions for pruning and updating version files.

Suggested labels

area/ci, size/M

Suggested reviewers

  • mchmarny
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the two main changes: skipping version registration for the latest release and sorting by semver.
Description check ✅ Passed The description is well-structured and directly related to the changeset, covering motivation, implementation, testing, and risk assessment.
Linked Issues check ✅ Passed The PR successfully addresses both objectives from issue #978: preventing duplicate version entries for latest release and ensuring semver sorting of version entries.
Out of Scope Changes check ✅ Passed All changes are scoped to the publish-fern-docs.yml workflow file and directly address the requirements specified in linked issue #978.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@mchmarny mchmarny enabled auto-merge (squash) May 20, 2026 11:47
@mchmarny mchmarny merged commit 423bc08 into NVIDIA:main May 20, 2026
30 checks passed
@pdmack pdmack deleted the pdmack/fix-publish-skip-latest-semver-sort branch June 10, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: publish workflow registers duplicate version entry for latest release

2 participants