Skip to content

fix(scripts): remove static issue line from release PR template#1596

Merged
brandonpelfrey merged 4 commits intomainfrom
fix/bump-version-pr-template
Apr 8, 2026
Merged

fix(scripts): remove static issue line from release PR template#1596
brandonpelfrey merged 4 commits intomainfrom
fix/bump-version-pr-template

Conversation

@brandonpelfrey
Copy link
Copy Markdown
Collaborator

@brandonpelfrey brandonpelfrey commented Apr 8, 2026

Summary

Fix the release PR body generated by scripts/bump-version.ts so it no longer includes a static issue-closing line for version bumps.
This also corrects an oversight introduced in #1581 by making the test and formatting checkboxes reflect what the script actually ran.

Related Issue

Changes

  • remove the hardcoded Fixes #1577. line from the generated release PR body
  • make buildPrBody() accept runtime status so npm test and formatting checklist items match the actual run
  • update the release PR creation call site to pass the runtime flags used for the current invocation

Type of Change

  • Code change for a new feature, bug fix, or refactor.
  • Code change with doc updates.
  • Doc only. Prose changes without code sample modifications.
  • Doc only. Includes code sample changes.

Testing

  • npx prek run --all-files passes (or equivalently make check).
  • npm test passes.
  • make docs builds without warnings. (for doc-only changes)

Checklist

General

Code Changes

  • Formatters applied — npx prek run --all-files auto-fixes formatting (or make format for targeted runs).
  • Tests added or updated for new or changed behavior.
  • No secrets, API keys, or credentials committed.
  • Doc pages updated for any user-facing behavior changes (new commands, changed defaults, new features, bug fixes that contradict existing docs).

Doc Changes

  • Follows the style guide. Try running the update-docs agent skill to draft changes while complying with the style guide. For example, prompt your agent with "/update-docs catch up the docs for the new changes I made in this PR."
  • New pages include SPDX license header and frontmatter, if creating a new page.
  • Cross-references and links verified.

Signed-off-by: Brandon Pelfrey bpelfrey@nvidia.com

Summary by CodeRabbit

  • Documentation

    • Manage docs versions metadata: set newest release as preferred, enforce exact doc URLs, keep up to five recent releases, and ensure entries are valid and ordered.
  • Chores

    • Release PR bodies now reflect whether tests ran and show formatter status via checkboxes.
    • Removed the "Related Issue" section from generated PR descriptions.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2dc10e64-2890-4181-8324-e8e3fb2dc12a

📥 Commits

Reviewing files that changed from the base of the PR and between 623edea and 8d59686.

📒 Files selected for processing (2)
  • docs/versions1.json
  • scripts/bump-version.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/bump-version.ts

📝 Walkthrough

Walkthrough

The bump-version script now updates/docs version artifacts (docs/project.json, docs/versions1.json), adds stricter verification for docs version state, and refactors release PR body generation to accept runtime options that set testing/format checkboxes; the PR template’s "Related Issue" section was removed.

Changes

Cohort / File(s) Summary
Version bump script
scripts/bump-version.ts
Updates release bump to stage and write docs/project.json.version; reads/rewrites docs/versions1.json by removing any existing entry matching the target version, prepending a new { preferred: true, version, url }, regenerating url for remaining entries, and truncating the list (script truncates to first 10). Expands verification: verifyVersionState now asserts docs/project.json.version, and adds verifyDocsVersionsJson which requires docs/versions1.json to exist as an array with at least one entry, at most 5 entries, each entry has non-empty version, each url equals https://docs.nvidia.com/nemoclaw/<version>/, and the first entry must equal the new release and have preferred: true (only first may set preferred). Refactors PR generation: createReleasePr passes PrBodyOptions into buildPrBody (signature becomes (previousVersion, nextVersion, options)); PR body checkboxes for testing/format are set based on options.skipTests and a fixed ranFormat: false; the "Related Issue / Fixes #1577." section was removed.
Docs versions file
docs/versions1.json
Adds docs/versions1.json containing initial array with one entry: { "preferred": true, "version": "0.0.9", "url": "https://docs.nvidia.com/nemoclaw/0.0.9/" }.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

"I nibbled bytes and hopped with glee,
I set the docs and PR check — whee!
Preferred version sits on top,
URLs aligned — no need to stop.
Hooray — a tidy, hoppity release!" 🐇

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Changes to docs/versions1.json and doc versioning validation logic in bump-version.ts extend beyond the stated PR objective of fixing the release PR template. Clarify whether docs versioning logic is part of this PR's scope or should be addressed separately; consider splitting into multiple PRs if addressing distinct features.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing the hardcoded issue line from the release PR template, which aligns with the primary objective mentioned in the PR description.
Linked Issues check ✅ Passed The PR addresses the initial scope of #1577 (automated version bump script) but focuses narrowly on fixing the PR body generation, not the core feature requirements.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bump-version-pr-template

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

@brandonpelfrey brandonpelfrey requested a review from cv April 8, 2026 03:42
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@scripts/bump-version.ts`:
- Around line 355-377: readDocsVersionsJson currently accepts any non-empty
string for historical entry.version, allowing malformed versions like "latest"
to be preserved; update readDocsVersionsJson to validate each candidate.version
using the same semver parsing/validation used by parseArgs() (or reuse the
parseArgs semver check function) and throw an error if the version is not a
valid semver; keep the existing URL logic (use candidate.url if valid otherwise
buildDocsVersionUrl(candidate.version)) and ensure preferred handling remains
unchanged so malformed versions cannot be carried forward.
🪄 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: Pro

Run ID: a9245140-e067-4cc0-aea3-b23a002df558

📥 Commits

Reviewing files that changed from the base of the PR and between a3731b6 and 623edea.

📒 Files selected for processing (2)
  • docs/versions1.json
  • scripts/bump-version.ts
✅ Files skipped from review due to trivial changes (1)
  • docs/versions1.json

Comment on lines +355 to +377
function readDocsVersionsJson(): DocsVersionEntry[] {
try {
const parsed = JSON.parse(readText(DOCS_VERSIONS_JSON)) as unknown;
if (!Array.isArray(parsed)) {
throw new Error("docs/versions1.json must contain an array");
}
return parsed.map((entry) => {
if (!entry || typeof entry !== "object") {
throw new Error("Invalid docs/versions1.json entry");
}
const candidate = entry as Partial<DocsVersionEntry>;
if (typeof candidate.version !== "string") {
throw new Error("Each docs/versions1.json entry must include a string version");
}
return {
preferred: candidate.preferred === true ? true : undefined,
version: candidate.version,
url:
typeof candidate.url === "string" && candidate.url.length > 0
? candidate.url
: buildDocsVersionUrl(candidate.version),
};
});
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.

⚠️ Potential issue | 🟡 Minor

Validate retained docs versions with the same semver rule.

readDocsVersionsJson() carries forward every historical entry.version, but verifyDocsVersionsJson() only checks that it is a non-empty string. A malformed existing entry like "latest" would be rewritten with a matching URL and still pass verification, so corrupted docs metadata can survive a release bump. Reusing the parseArgs() semver check here would close that gap.

Proposed fix
+const SEMVER_RE =
+  /^[0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
+
 function parseArgs(args: string[]): Options {
   ...
-  if (!/^[0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(version)) {
+  if (!SEMVER_RE.test(version)) {
     throw new Error(`Invalid semver: ${version}`);
   }
   ...
 }
-      if (typeof candidate.version !== "string") {
-        throw new Error("Each docs/versions1.json entry must include a string version");
+      if (typeof candidate.version !== "string" || !SEMVER_RE.test(candidate.version)) {
+        throw new Error("Each docs/versions1.json entry must include a valid semver version");
       }
-    if (typeof entry.version !== "string" || entry.version.length === 0) {
+    if (typeof entry.version !== "string" || !SEMVER_RE.test(entry.version)) {
       throw new Error(`docs/versions1.json entry ${index} is missing a valid version`);
     }

Also applies to: 622-657

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/bump-version.ts` around lines 355 - 377, readDocsVersionsJson
currently accepts any non-empty string for historical entry.version, allowing
malformed versions like "latest" to be preserved; update readDocsVersionsJson to
validate each candidate.version using the same semver parsing/validation used by
parseArgs() (or reuse the parseArgs semver check function) and throw an error if
the version is not a valid semver; keep the existing URL logic (use
candidate.url if valid otherwise buildDocsVersionUrl(candidate.version)) and
ensure preferred handling remains unchanged so malformed versions cannot be
carried forward.

Copy link
Copy Markdown
Member

@mikemckiernan mikemckiernan left a comment

Choose a reason for hiding this comment

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

Not an expert in the language, but lgtm! Thank you too!

@brandonpelfrey brandonpelfrey merged commit 86f94a2 into main Apr 8, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants