Skip to content

fix(ci): stamp publish with resolved tag instead of releases/latest API#1136

Merged
mchmarny merged 1 commit into
NVIDIA:mainfrom
pdmack:pdmack/fix-publish-stamp
Jun 1, 2026
Merged

fix(ci): stamp publish with resolved tag instead of releases/latest API#1136
mchmarny merged 1 commit into
NVIDIA:mainfrom
pdmack:pdmack/fix-publish-stamp

Conversation

@pdmack

@pdmack pdmack commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Use the already-resolved tag from the resolve step to stamp the "Latest · vX.Y.Z" display name, instead of querying the GitHub releases/latest API which races with Release creation on tag push.

Motivation / Context

On a tag push, the Release object may not exist yet, causing the stamp to show the previous version. Observed in run 26770200319: v0.14.0 publish stamped "Latest · v0.13.0".

Fixes: #1134

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

Replaces the curl releases/latest API call with ${{ steps.resolve.outputs.tag }} which is already available from the earlier resolve step. This is the same pattern nvsentinel and topograph use.

Testing

No test commands — CI workflow change. Verified by inspecting the existing step logic and comparing with production patterns in nvsentinel/topograph.

Risk Assessment

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

Rollout notes: Next Publish Fern Docs run will use the resolved tag. No migration needed.

Checklist

  • Tests pass locally (make test with -race)
  • Linter passes (make lint)
  • I did not skip/disable tests to make CI green
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S)

The stamp step queried the GitHub releases/latest API to get the version
for the "Latest · vX.Y.Z" display name. On a tag push, the Release
object may not exist yet, causing the stamp to show the previous version
(e.g. "Latest · v0.13.0" on a v0.14.0 publish).

Use the already-resolved tag from the earlier step instead — it's always
correct since it comes from the trigger event itself.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@pdmack pdmack requested a review from a team as a code owner June 1, 2026 18:48
@mchmarny mchmarny enabled auto-merge (squash) June 1, 2026 18:51
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This pull request modifies the GitHub Actions workflow .github/workflows/publish-fern-docs.yml to fix a race condition in version stamping. The "Stamp version in docs.yml" step previously called the GitHub Releases API to fetch the latest release tag before stamping the documentation version. When a new tag was pushed, the Release object might not exist yet, causing the stamp to display the previous version. The fix removes the API call and instead uses the already-resolved tag from the earlier resolve step, ensuring the stamp always reflects the correct current tag.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: replacing the releases/latest API call with a resolved tag for stamping.
Description check ✅ Passed The description thoroughly explains the bug, motivation, implementation, and testing approach, directly relating to the changeset.
Linked Issues check ✅ Passed The PR successfully addresses the objective from issue #1134 by replacing the releases/latest API call with the resolved tag from the earlier resolve step.
Out of Scope Changes check ✅ Passed All changes are confined to the publish-fern-docs.yml workflow step and directly address the stated objective; no out-of-scope modifications detected.

✏️ 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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/publish-fern-docs.yml:
- Around line 203-208: The workflow currently overwrites the "Latest"
display-name using TAG (steps.resolve.outputs.tag), which can be a prerelease or
older tag; instead introduce a dedicated STAMP_TAG (e.g., export STAMP_TAG=${{
steps.resolve.outputs.tag }}), use STAMP_TAG in the yq update to write a
non-user-facing stamp field (for example set .products[0].versions[] |
select(.slug=="latest").stamp = env(STAMP_TAG)) or otherwise stamp artifacts
with STAMP_TAG, and stop changing .display-name for the "latest" version so
visible labels remain correct (leave .display-name as "Latest · " or unchanged).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 8dc37a1a-79cf-4067-ac66-7211d579b1e6

📥 Commits

Reviewing files that changed from the base of the PR and between 0a6b21a and 1775ad8.

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

Comment thread .github/workflows/publish-fern-docs.yml
@pdmack

pdmack commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Re: CodeRabbit's suggestion to introduce a STAMP_TAG fallback — this is a false positive.

Pre-releases: The stamp step runs unconditionally, but that's fine — pre-release publishes should show the pre-release tag. The stamp is transient (reverted before the registry PR) and only affects the published site for that run.

Manual dispatch with an older tag: If someone explicitly passes v0.12.0, they want to republish that version — stamping "Latest · v0.12.0" is correct for that run. The stamp reflects what was just published.

The race condition this PR fixes: On a tag push, releases/latest returns the previous release because the new Release hasn't been created yet. Observed in run 26770200319: v0.14.0 publish stamped "Latest · v0.13.0". The resolved tag is always correct because it comes from the trigger event.

CodeRabbit's suggested fix reintroduces the exact race condition this PR eliminates by falling back to LATEST_RELEASE_TAG from the API.

@mchmarny mchmarny merged commit ff8a756 into NVIDIA:main Jun 1, 2026
32 checks passed
@pdmack pdmack deleted the pdmack/fix-publish-stamp 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.

fix(ci): publish stamp shows stale version due to releases/latest API race

2 participants