Skip to content

fix(ci): make stable GitHub releases idempotent - #976

Open
svvarom wants to merge 2 commits into
mainfrom
fix-custom-github-release/svvarom
Open

fix(ci): make stable GitHub releases idempotent#976
svvarom wants to merge 2 commits into
mainfrom
fix-custom-github-release/svvarom

Conversation

@svvarom

@svvarom svvarom commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Stable subset and custom runs are also used to finish or retry individual artifacts. The workflow previously keyed GitHub tag/release creation to release-scope: all, so the successful 0.3.0 custom run skipped its tag and GitHub Release.

This makes stable the release intent: every successful non-dry-run stable run converges on its version tag and GitHub Release, regardless of artifact scope. Retries are idempotent:

  • A version tag that points to another SHA fails clearly.
  • An existing GitHub Release succeeds as a no-op.
  • A matching tag without a GitHub Release creates the missing release.

The extra create-github-release checkbox and its planner wiring are removed.

Incident: https://github.com/NVIDIA-NeMo/nemo-platform/actions/runs/30477833073/job/90703676069

Human attention needed

  • Decision: Treat every stable run as an instruction to create or confirm the version tag and GitHub Release.
  • Read carefully: Stable subset and custom runs now create the tag/release for a new version; retries of an existing version are safe no-ops.
  • Safe to skim: Documentation.
  • Proof: actionlint .github/workflows/release.yaml and git diff --check pass.
  • Biggest risk: Selecting stable for a subset with a brand-new version now cuts the version tag/release. This is intentional; release-scope controls artifacts only.

Validation

  • actionlint .github/workflows/release.yaml
  • git diff --check
  • Verified stable all, wheels, containers, helm, and custom scopes share the same release gate.
  • Verified nightly, dry-run, and failed polling skip GitHub Release creation.
  • Verified the release step no-ops for an existing release, repairs a matching tag-only state, and rejects a tag/SHA mismatch.

Summary by CodeRabbit

  • Bug Fixes / Improvements

    • GitHub Release creation is now consistently handled for all successful non-dry-run stable releases, regardless of release scope.
    • The “Create GitHub Release” step is more guarded: it checks that the existing tag points to the expected commit and avoids recreating a release if one already exists.
  • Documentation

    • Updated release documentation to reflect the always-on stable release tag/GitHub Release behavior.
    • Removed guidance about the prior explicit GitHub release setting and added updated stable one-container/one-wheel examples.

@github-actions github-actions Bot added the fix label Jul 29, 2026
@svvarom
svvarom force-pushed the fix-custom-github-release/svvarom branch from f60de95 to b49a179 Compare July 29, 2026 21:06
Signed-off-by: Swarom Muley <smuley@nvidia.com>
@svvarom
svvarom force-pushed the fix-custom-github-release/svvarom branch from b49a179 to 6ebf91c Compare July 29, 2026 21:08
@svvarom
svvarom marked this pull request as ready for review July 29, 2026 21:09
@svvarom
svvarom requested review from a team as code owners July 29, 2026 21:09
@svvarom
svvarom requested a review from crookedstorm July 29, 2026 21:09
@svvarom svvarom self-assigned this Jul 29, 2026
Comment thread .github/workflows/release.yaml Outdated
required: false
type: boolean
default: false
create-github-release:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

each day, the parameter list grows

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Which is fine if the default is "do what we want most of the time"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And I now believe this does NOT do that. This is the opposite of that, imo. Commented further below. I could be wrong.

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.

dropped the input

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Stable non-dry-run releases now create or confirm Git tags and GitHub Releases regardless of release scope. The workflow removes the manual override and adds tag-SHA validation plus existing-release checks. Documentation describes the unified behavior and retry handling.

Changes

Release gating

Layer / File(s) Summary
Stable release planning and gating
.github/workflows/release.yaml
Removes the manual input and computed output, and runs GitHub Release creation for stable non-dry-run releases after successful polling.
Idempotent release execution and documentation
.github/workflows/release.yaml, RELEASING.md
Validates existing tag targets, skips existing GitHub Releases, and documents stable release behavior and retries across scopes.

Possibly related PRs

Suggested labels: ci

Suggested reviewers: crookedstorm, mquong-ca

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: making stable GitHub release creation idempotent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-custom-github-release/svvarom

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/release.yaml (1)

230-236: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression coverage for the release-decision matrix.

Cover stable/all, stable/custom with the flag enabled, stable/custom with it disabled, stable wheels/containers/Helm, and nightly releases. This gate controls a write-permission job, so a small pure decision test would prevent accidental tagging of ordinary subset releases.

🤖 Prompt for 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.

In @.github/workflows/release.yaml around lines 230 - 236, Add a pure regression
test for the createGitHubRelease decision logic, covering stable/all,
stable/custom with createGitHubReleaseRequested enabled and disabled, stable
wheels/containers/Helm scopes, and nightly releases. Assert that only the
intended stable release combinations return true, preventing ordinary subset
releases from enabling the write-permission path.
🤖 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 `@RELEASING.md`:
- Line 71: Complete the stable custom release example in the release
documentation by adding concrete values for source-sha, version, release-scope:
custom, and the required artifact IDs alongside the existing stable release-type
and GitHub-release settings. Ensure the example represents a valid dispatch with
a specific, reproducible outcome.

---

Nitpick comments:
In @.github/workflows/release.yaml:
- Around line 230-236: Add a pure regression test for the createGitHubRelease
decision logic, covering stable/all, stable/custom with
createGitHubReleaseRequested enabled and disabled, stable wheels/containers/Helm
scopes, and nightly releases. Assert that only the intended stable release
combinations return true, preventing ordinary subset releases from enabling the
write-permission path.
🪄 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: CHILL

Plan: Enterprise

Run ID: 4ca7ef68-9001-45f4-9a5c-09928617e4a4

📥 Commits

Reviewing files that changed from the base of the PR and between 9aaf35d and 6ebf91c.

📒 Files selected for processing (2)
  • .github/workflows/release.yaml
  • RELEASING.md

Comment thread RELEASING.md Outdated
Comment thread .github/workflows/release.yaml Outdated
if: >-
needs.plan-release.outputs.release_type == 'stable' &&
needs.plan-release.outputs.release_scope == 'all' &&
needs.plan-release.outputs.create_github_release == 'true' &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need this at all? I don't see any reason not to just remove this and not introduce the new parameter.

An improvement would be to also just output what it would have created with ACT="true", but I emphatically reject needing to explicitly ask for release when I said make a stabe release already. :)

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.

But we can use stable custom runs to retry failed artifacts too, so we need a way to say whether that run should also cut the tag/release.

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.

Otherwise it'll fail by default if the tag already exists

@crookedstorm crookedstorm Jul 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about checking for the tag first and making it idempotent instead? This adds a random clickbox for what it should do by default.

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.

Updated the PR

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 28185/36015 78.3% 62.6%
Integration Tests 16748/34733 48.2% 20.9%

Signed-off-by: Swarom Muley <smuley@nvidia.com>
@svvarom svvarom changed the title fix(ci): allow custom stable releases to create tags fix(ci): make stable GitHub releases idempotent Jul 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/release.yaml (1)

60-69: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Gate GitHub Release creation to release-scope: all. Stable subset/custom releases still run gh release create here, so they publish a tag and GitHub Release. If those scopes should stay untagged, add the missing scope check back.

🤖 Prompt for 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.

In @.github/workflows/release.yaml around lines 60 - 69, Update the GitHub
Release creation step in the workflow to run only when release-scope is all,
while preserving the existing behavior for stable Helm-only and other scoped
releases except preventing tag and GitHub Release publication.
🤖 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/release.yaml:
- Around line 1132-1135: Update the release-check logic around RELEASE_TAG and
gh release view to require a non-empty tag before treating an existing release
as complete. Compare the existing tag’s commit SHA (tag_sha) with SOURCE_SHA,
skipping only when they match; otherwise recreate the tag or fail, and preserve
failure when the required tag is missing.

---

Outside diff comments:
In @.github/workflows/release.yaml:
- Around line 60-69: Update the GitHub Release creation step in the workflow to
run only when release-scope is all, while preserving the existing behavior for
stable Helm-only and other scoped releases except preventing tag and GitHub
Release publication.
🪄 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: CHILL

Plan: Enterprise

Run ID: 79ac2030-5f4e-4f68-ae0c-0d94b810b489

📥 Commits

Reviewing files that changed from the base of the PR and between 6ebf91c and f350808.

📒 Files selected for processing (2)
  • .github/workflows/release.yaml
  • RELEASING.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • RELEASING.md

Comment on lines +1132 to +1135
if gh release view "${RELEASE_TAG}" >/dev/null 2>&1; then
echo "GitHub Release ${RELEASE_TAG} already exists; nothing to do."
exit 0
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Require the tag before skipping an existing release. If gh release view succeeds while RELEASE_TAG is missing, this exits 0 and leaves the release untagged. Skip only when tag_sha == SOURCE_SHA; otherwise recreate the tag or fail.

🤖 Prompt for 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.

In @.github/workflows/release.yaml around lines 1132 - 1135, Update the
release-check logic around RELEASE_TAG and gh release view to require a
non-empty tag before treating an existing release as complete. Compare the
existing tag’s commit SHA (tag_sha) with SOURCE_SHA, skipping only when they
match; otherwise recreate the tag or fail, and preserve failure when the
required tag is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants