From 1685ccc017c1dff2c9139a4310a598e1bf355456 Mon Sep 17 00:00:00 2001 From: Chad Voegele Date: Thu, 10 Sep 2026 16:58:10 +0000 Subject: [PATCH 1/9] docs: audit cherry-pick candidates before release Signed-off-by: Chad Voegele --- .../skills/release-cherry-pick/SKILL.md | 75 +++++++++++++++++-- 1 file changed, 68 insertions(+), 7 deletions(-) diff --git a/plugins/modelopt/skills/release-cherry-pick/SKILL.md b/plugins/modelopt/skills/release-cherry-pick/SKILL.md index c0fe608b169..0b7fd00613f 100644 --- a/plugins/modelopt/skills/release-cherry-pick/SKILL.md +++ b/plugins/modelopt/skills/release-cherry-pick/SKILL.md @@ -1,6 +1,6 @@ --- name: release-cherry-pick -description: Cherry-pick merged PRs labeled for a release branch into that branch, then open a PR and apply the cherry-pick-done label. Use when asked to "cherry-pick PRs for release/X.Y.Z", "pick PRs to release branch", or "cherry-pick labeled PRs". +description: Audit merged bug-fix PRs and release NVBugs for missing cherry-pick labels, then cherry-pick labeled PRs into a release branch and open a PR. Use when asked to "cherry-pick PRs for release/X.Y.Z", "pick PRs to release branch", "verify cherry-pick labels", or "cherry-pick labeled PRs". --- # Cherry-pick PRs to a Release Branch @@ -13,7 +13,68 @@ Ask the user for the release version (e.g. `0.44.0`) if not already provided. Set `VERSION=` for use in subsequent steps. -## Step 2 — Fetch pending PRs +## Step 2 — Audit candidates for missing labels + +Before fetching the labeled queue, audit release NVBugs and recent merged PRs so bug fixes are not omitted. + +### Audit release NVBugs + +Use NVBug IDs supplied by the user or found in their release source (for example, a test-plan document or release message). If none were supplied, ask the user for the NVBug list; do not assume the GitHub queue is complete. + +For each NVBug: + +1. Open `https://nvbugspro.nvidia.com/bug/`. +2. Verify it has the exact release label `Committed_ModelOpt_`. +3. Inspect its comments for `github.com/NVIDIA/Model-Optimizer/pull/` links. Record every linked PR, not only the latest comment. +4. Verify each linked PR is merged into `main` and is a bug fix. A release-labeled NVBug is evidence for review, not by itself proof that every linked PR should be picked. + +If an NVBug lacks the expected NVBug label, report it but do not edit NVBug. If browser access is unavailable, report that the NVBug portion of the audit could not be completed and ask the user for the relevant PR links or exported comments. + +### Audit recent merged PRs + +Treat PRs merged into `main` since the release branch diverged as "recent": + +```bash +git fetch origin main release/ +BASE=$(git merge-base origin/main origin/release/) +SINCE=$(git show -s --format=%cs "$BASE") + +gh pr list \ + --repo NVIDIA/Model-Optimizer \ + --state merged \ + --base main \ + --limit 1000 \ + --json number,title,author,mergedAt,labels,url \ + | jq --arg since "${SINCE}T00:00:00Z" \ + '[.[] | select(.mergedAt >= $since)]' +``` + +Review each PR's title, body, labels, changed files, and linked issue context. Classify it as: + +- **Yes** — repairs incorrect behavior, a regression, crash, compatibility problem, or documentation defect relevant to the release. +- **No** — feature, refactor, cleanup, dependency refresh, or other change not needed to correct the release. +- **Unclear** — insufficient evidence or meaningful backport risk; ask the user. + +Do not classify a PR as a bug fix from the word `fix` alone. Deduplicate PRs found through both audits. + +### Report and label + +Present the complete audit before changing GitHub labels: + +| PR | Title | Author | NVBug(s) | Bug fix? | `cherry-pick-` present? | Recommendation | +|---|---|---|---|---|---|---| + +Use `—` when no NVBug is known. Also list NVBugs with no linked PR or a missing `Committed_ModelOpt_` label. Ask the user to confirm which recommended PRs should receive the missing label. After confirmation, apply it: + +```bash +for pr in ; do + gh pr edit "$pr" --repo NVIDIA/Model-Optimizer --add-label "cherry-pick-" +done +``` + +Do not label unmerged PRs, PRs not based on `main`, or candidates classified **Unclear** without explicit approval. Re-run the audit table after edits so it reflects the final label state. + +## Step 3 — Fetch pending PRs Use the GitHub search API to list PRs that have the cherry-pick label but not cherry-pick-done, sorted by merge date ascending: @@ -25,7 +86,7 @@ gh api "search/issues?q=repo:NVIDIA/Model-Optimizer+is:pr+is:merged+base:main+la Present the list to the user before proceeding. -## Step 3 — Set up the release branch +## Step 4 — Set up the release branch Check out `release/`, creating it from the remote if it doesn't exist locally: @@ -34,7 +95,7 @@ git fetch origin release/ git checkout release/ ``` -## Step 4 — Get merge commit SHAs +## Step 5 — Get merge commit SHAs All PRs are squash-merged, so each has a single-parent commit. Retrieve the SHA for each PR: @@ -42,7 +103,7 @@ All PRs are squash-merged, so each has a single-parent commit. Retrieve the SHA gh pr view --repo NVIDIA/Model-Optimizer --json mergeCommit --jq '.mergeCommit.oid' ``` -## Step 5 — Cherry-pick in merge order +## Step 6 — Cherry-pick in merge order Cherry-pick each commit with `-s` (DCO sign-off). GPG signing is handled automatically by the repo's git config. @@ -56,7 +117,7 @@ git cherry-pick -s git cherry-pick --continue ``` -## Step 6 — Create a PR to the release branch +## Step 7 — Create a PR to the release branch Push the cherry-picks to a new branch and open a PR targeting `release/`. The PR title lists every cherry-picked PR number. The body uses `## Cherry-picked PRs` as the only heading with one `- #` bullet per PR — no titles, no links, no extra text. @@ -78,7 +139,7 @@ EOF )" ``` -## Step 7 — Apply cherry-pick-done label +## Step 8 — Apply cherry-pick-done label Add the `cherry-pick-done` label to every PR that was successfully cherry-picked: From 2a9b1932ab52569461980039b5b769e191db8ce1 Mon Sep 17 00:00:00 2001 From: Chad Voegele Date: Fri, 11 Sep 2026 15:06:07 +0000 Subject: [PATCH 2/9] docs: refine release audit sources Signed-off-by: Chad Voegele --- .../skills/release-cherry-pick/SKILL.md | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/plugins/modelopt/skills/release-cherry-pick/SKILL.md b/plugins/modelopt/skills/release-cherry-pick/SKILL.md index 0b7fd00613f..e6832a44e16 100644 --- a/plugins/modelopt/skills/release-cherry-pick/SKILL.md +++ b/plugins/modelopt/skills/release-cherry-pick/SKILL.md @@ -19,43 +19,40 @@ Before fetching the labeled queue, audit release NVBugs and recent merged PRs so ### Audit release NVBugs -Use NVBug IDs supplied by the user or found in their release source (for example, a test-plan document or release message). If none were supplied, ask the user for the NVBug list; do not assume the GitHub queue is complete. +Use the NVBugs MCP to search for every NVBug whose **Keywords** field contains the exact keyword `Committed_ModelOpt_`. Follow pagination until no next token is returned; do not ask the user for a list. -For each NVBug: - -1. Open `https://nvbugspro.nvidia.com/bug/`. -2. Verify it has the exact release label `Committed_ModelOpt_`. -3. Inspect its comments for `github.com/NVIDIA/Model-Optimizer/pull/` links. Record every linked PR, not only the latest comment. -4. Verify each linked PR is merged into `main` and is a bug fix. A release-labeled NVBug is evidence for review, not by itself proof that every linked PR should be picked. - -If an NVBug lacks the expected NVBug label, report it but do not edit NVBug. If browser access is unavailable, report that the NVBug portion of the audit could not be completed and ask the user for the relevant PR links or exported comments. +Fetch each matching NVBug with its comments. Extract every Model-Optimizer PR link or unambiguous `PR #` reference from the comments, not only the latest comment. Verify each linked PR is merged into `main` and is a bug fix. The NVBug keyword is evidence for review, not by itself proof that every linked PR should be picked. ### Audit recent merged PRs -Treat PRs merged into `main` since the release branch diverged as "recent": +Treat PRs merged into `main` since the latest release candidate as "recent": ```bash -git fetch origin main release/ -BASE=$(git merge-base origin/main origin/release/) -SINCE=$(git show -s --format=%cs "$BASE") - -gh pr list \ +git fetch origin main release/ --tags +RC_TAG=$(git tag --merged origin/release/ \ + --list 'rc*' --sort=-version:refname | head -1) +test -n "$RC_TAG" +SINCE=$(git for-each-ref --format='%(creatordate:iso-strict)' \ + "refs/tags/$RC_TAG") + +gh search prs \ --repo NVIDIA/Model-Optimizer \ - --state merged \ + --merged \ --base main \ + --merged-at ">=$SINCE" \ --limit 1000 \ - --json number,title,author,mergedAt,labels,url \ - | jq --arg since "${SINCE}T00:00:00Z" \ - '[.[] | select(.mergedAt >= $since)]' + --json number,title,author,labels,url ``` +Assert that the GitHub result has no next-page token before continuing; abort the audit if it does. + Review each PR's title, body, labels, changed files, and linked issue context. Classify it as: - **Yes** — repairs incorrect behavior, a regression, crash, compatibility problem, or documentation defect relevant to the release. - **No** — feature, refactor, cleanup, dependency refresh, or other change not needed to correct the release. - **Unclear** — insufficient evidence or meaningful backport risk; ask the user. -Do not classify a PR as a bug fix from the word `fix` alone. Deduplicate PRs found through both audits. +Deduplicate PRs found through both audits. ### Report and label @@ -64,7 +61,7 @@ Present the complete audit before changing GitHub labels: | PR | Title | Author | NVBug(s) | Bug fix? | `cherry-pick-` present? | Recommendation | |---|---|---|---|---|---|---| -Use `—` when no NVBug is known. Also list NVBugs with no linked PR or a missing `Committed_ModelOpt_` label. Ask the user to confirm which recommended PRs should receive the missing label. After confirmation, apply it: +Use `—` when no NVBug is known. Also list NVBugs with no linked PR. Ask the user to confirm which recommended PRs should receive the missing label. After confirmation, apply it: ```bash for pr in ; do From 7d5ad9c58a7e9aa2681bd1966cf0a57b34dc91c8 Mon Sep 17 00:00:00 2001 From: Chad Voegele Date: Fri, 11 Sep 2026 15:15:59 +0000 Subject: [PATCH 3/9] docs: clarify release audit size expectation Signed-off-by: Chad Voegele --- plugins/modelopt/skills/release-cherry-pick/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modelopt/skills/release-cherry-pick/SKILL.md b/plugins/modelopt/skills/release-cherry-pick/SKILL.md index e6832a44e16..0e3df5a145f 100644 --- a/plugins/modelopt/skills/release-cherry-pick/SKILL.md +++ b/plugins/modelopt/skills/release-cherry-pick/SKILL.md @@ -44,7 +44,7 @@ gh search prs \ --json number,title,author,labels,url ``` -Assert that the GitHub result has no next-page token before continuing; abort the audit if it does. +Assert that the GitHub result has no next-page token before continuing; abort the audit if it does. A release is not normally expected to exceed 1,000 merged PRs. Review each PR's title, body, labels, changed files, and linked issue context. Classify it as: From cb6438f26f6128608d8c05f49df9022993a14708 Mon Sep 17 00:00:00 2001 From: Chad Voegele Date: Fri, 11 Sep 2026 15:17:01 +0000 Subject: [PATCH 4/9] docs: simplify NVBug audit guidance Signed-off-by: Chad Voegele --- plugins/modelopt/skills/release-cherry-pick/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modelopt/skills/release-cherry-pick/SKILL.md b/plugins/modelopt/skills/release-cherry-pick/SKILL.md index 0e3df5a145f..1f1d7305aaa 100644 --- a/plugins/modelopt/skills/release-cherry-pick/SKILL.md +++ b/plugins/modelopt/skills/release-cherry-pick/SKILL.md @@ -19,7 +19,7 @@ Before fetching the labeled queue, audit release NVBugs and recent merged PRs so ### Audit release NVBugs -Use the NVBugs MCP to search for every NVBug whose **Keywords** field contains the exact keyword `Committed_ModelOpt_`. Follow pagination until no next token is returned; do not ask the user for a list. +Use the NVBugs MCP to search for every NVBug whose **Keywords** field contains the exact keyword `Committed_ModelOpt_`. Follow pagination until no next token is returned. Fetch each matching NVBug with its comments. Extract every Model-Optimizer PR link or unambiguous `PR #` reference from the comments, not only the latest comment. Verify each linked PR is merged into `main` and is a bug fix. The NVBug keyword is evidence for review, not by itself proof that every linked PR should be picked. From 8cd7e53d9f37f62b2852d6bfcc7276631952afa0 Mon Sep 17 00:00:00 2001 From: Chad Voegele Date: Fri, 11 Sep 2026 15:25:24 +0000 Subject: [PATCH 5/9] docs: filter release audit candidates Signed-off-by: Chad Voegele --- .../skills/release-cherry-pick/SKILL.md | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/plugins/modelopt/skills/release-cherry-pick/SKILL.md b/plugins/modelopt/skills/release-cherry-pick/SKILL.md index 1f1d7305aaa..2dce871c15c 100644 --- a/plugins/modelopt/skills/release-cherry-pick/SKILL.md +++ b/plugins/modelopt/skills/release-cherry-pick/SKILL.md @@ -21,30 +21,42 @@ Before fetching the labeled queue, audit release NVBugs and recent merged PRs so Use the NVBugs MCP to search for every NVBug whose **Keywords** field contains the exact keyword `Committed_ModelOpt_`. Follow pagination until no next token is returned. -Fetch each matching NVBug with its comments. Extract every Model-Optimizer PR link or unambiguous `PR #` reference from the comments, not only the latest comment. Verify each linked PR is merged into `main` and is a bug fix. The NVBug keyword is evidence for review, not by itself proof that every linked PR should be picked. +Fetch each matching NVBug with its comments. Extract every Model-Optimizer PR link or unambiguous `PR #` reference from the comments, not only the latest comment. Keep only PRs that are merged into `main`, lack `cherry-pick-`, and are not already included in the release branch. Verify each remaining PR is a bug fix. The NVBug keyword is evidence for review, not by itself proof that every linked PR should be picked. ### Audit recent merged PRs Treat PRs merged into `main` since the latest release candidate as "recent": ```bash -git fetch origin main release/ --tags -RC_TAG=$(git tag --merged origin/release/ \ - --list 'rc*' --sort=-version:refname | head -1) +git fetch origin main "release/$VERSION" --tags +RC_TAG=$(git tag --merged "origin/release/$VERSION" \ + --list "${VERSION}rc*" --sort=-version:refname | head -1) test -n "$RC_TAG" SINCE=$(git for-each-ref --format='%(creatordate:iso-strict)' \ "refs/tags/$RC_TAG") +PATCH_STATUS=$(git cherry "origin/release/$VERSION" origin/main) + gh search prs \ --repo NVIDIA/Model-Optimizer \ --merged \ --base main \ --merged-at ">=$SINCE" \ --limit 1000 \ - --json number,title,author,labels,url + --json number,title,author,labels,url \ + -- "-label:cherry-pick-$VERSION" \ + | jq -r '.[].number' \ + | while read -r pr; do + sha=$(gh pr view "$pr" --repo NVIDIA/Model-Optimizer \ + --json mergeCommit --jq '.mergeCommit.oid') + if grep -q "^+ $sha$" <<<"$PATCH_STATUS"; then + gh pr view "$pr" --repo NVIDIA/Model-Optimizer \ + --json number,title,author,labels,url + fi + done ``` -Assert that the GitHub result has no next-page token before continuing; abort the audit if it does. A release is not normally expected to exceed 1,000 merged PRs. +`git cherry` marks patches absent from the release branch with `+`. It omits directly inherited commits and marks patch-equivalent cherry-picks with `-`, so only `+` candidates proceed. Assert that the GitHub result has no next-page token before continuing; abort the audit if it does. A release is not normally expected to exceed 1,000 merged PRs. Review each PR's title, body, labels, changed files, and linked issue context. Classify it as: From 63cbe9e48b226a525197cd592298eefccbbe2d1a Mon Sep 17 00:00:00 2001 From: Chad Voegele Date: Fri, 11 Sep 2026 15:28:31 +0000 Subject: [PATCH 6/9] docs: trim cherry-pick audit explanation Signed-off-by: Chad Voegele --- plugins/modelopt/skills/release-cherry-pick/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modelopt/skills/release-cherry-pick/SKILL.md b/plugins/modelopt/skills/release-cherry-pick/SKILL.md index 2dce871c15c..b3e739a5530 100644 --- a/plugins/modelopt/skills/release-cherry-pick/SKILL.md +++ b/plugins/modelopt/skills/release-cherry-pick/SKILL.md @@ -56,7 +56,7 @@ gh search prs \ done ``` -`git cherry` marks patches absent from the release branch with `+`. It omits directly inherited commits and marks patch-equivalent cherry-picks with `-`, so only `+` candidates proceed. Assert that the GitHub result has no next-page token before continuing; abort the audit if it does. A release is not normally expected to exceed 1,000 merged PRs. +Assert that the GitHub result has no next-page token before continuing; abort the audit if it does. A release is not normally expected to exceed 1,000 merged PRs. Review each PR's title, body, labels, changed files, and linked issue context. Classify it as: From 50c11a77813acbce25ec98a6bb28f70b03b44a8a Mon Sep 17 00:00:00 2001 From: Chad Voegele Date: Fri, 11 Sep 2026 15:29:47 +0000 Subject: [PATCH 7/9] docs: summarize recent PR audit filters Signed-off-by: Chad Voegele --- plugins/modelopt/skills/release-cherry-pick/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modelopt/skills/release-cherry-pick/SKILL.md b/plugins/modelopt/skills/release-cherry-pick/SKILL.md index b3e739a5530..45be58cac00 100644 --- a/plugins/modelopt/skills/release-cherry-pick/SKILL.md +++ b/plugins/modelopt/skills/release-cherry-pick/SKILL.md @@ -25,7 +25,7 @@ Fetch each matching NVBug with its comments. Extract every Model-Optimizer PR li ### Audit recent merged PRs -Treat PRs merged into `main` since the latest release candidate as "recent": +Audit PRs merged into `main` since the latest release candidate. Exclude PRs that already have `cherry-pick-` and changes already present on the release branch: ```bash git fetch origin main "release/$VERSION" --tags From 331a0afc36a74e1ea3932b7f4fe0c8929c1a9197 Mon Sep 17 00:00:00 2001 From: Chad Voegele Date: Fri, 11 Sep 2026 15:36:48 +0000 Subject: [PATCH 8/9] docs: standardize audit recommendations Signed-off-by: Chad Voegele --- plugins/modelopt/skills/release-cherry-pick/SKILL.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/modelopt/skills/release-cherry-pick/SKILL.md b/plugins/modelopt/skills/release-cherry-pick/SKILL.md index 45be58cac00..676ecfc5bf3 100644 --- a/plugins/modelopt/skills/release-cherry-pick/SKILL.md +++ b/plugins/modelopt/skills/release-cherry-pick/SKILL.md @@ -73,6 +73,12 @@ Present the complete audit before changing GitHub labels: | PR | Title | Author | NVBug(s) | Bug fix? | `cherry-pick-` present? | Recommendation | |---|---|---|---|---|---|---| +Use these recommendation values and sort the table in this order: + +1. **Needs label** — confirmed release-relevant bug fix. +2. **Unknown** — requires user judgment. +3. **No action needed** — not a release-relevant bug fix. + Use `—` when no NVBug is known. Also list NVBugs with no linked PR. Ask the user to confirm which recommended PRs should receive the missing label. After confirmation, apply it: ```bash From efdceb55f873838d918eec26526c8acad58d2af1 Mon Sep 17 00:00:00 2001 From: Chad Voegele Date: Fri, 11 Sep 2026 15:42:49 +0000 Subject: [PATCH 9/9] docs: make release audit checks executable Signed-off-by: Chad Voegele --- .../skills/release-cherry-pick/SKILL.md | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/plugins/modelopt/skills/release-cherry-pick/SKILL.md b/plugins/modelopt/skills/release-cherry-pick/SKILL.md index 676ecfc5bf3..fd4717f80e0 100644 --- a/plugins/modelopt/skills/release-cherry-pick/SKILL.md +++ b/plugins/modelopt/skills/release-cherry-pick/SKILL.md @@ -31,21 +31,32 @@ Audit PRs merged into `main` since the latest release candidate. Exclude PRs tha git fetch origin main "release/$VERSION" --tags RC_TAG=$(git tag --merged "origin/release/$VERSION" \ --list "${VERSION}rc*" --sort=-version:refname | head -1) -test -n "$RC_TAG" +test -n "$RC_TAG" || { + echo "No ${VERSION}rc* tag found on origin/release/$VERSION" >&2 + exit 1 +} SINCE=$(git for-each-ref --format='%(creatordate:iso-strict)' \ "refs/tags/$RC_TAG") PATCH_STATUS=$(git cherry "origin/release/$VERSION" origin/main) -gh search prs \ - --repo NVIDIA/Model-Optimizer \ - --merged \ - --base main \ - --merged-at ">=$SINCE" \ - --limit 1000 \ - --json number,title,author,labels,url \ - -- "-label:cherry-pick-$VERSION" \ - | jq -r '.[].number' \ +SEARCH_RESULTS=$( + gh search prs \ + --repo NVIDIA/Model-Optimizer \ + --merged \ + --base main \ + --merged-at ">=$SINCE" \ + --limit 1000 \ + --json number,title,author,labels,url \ + -- "-label:cherry-pick-$VERSION" +) + +if test "$(jq 'length' <<<"$SEARCH_RESULTS")" -ge 1000; then + echo "Recent-PR audit reached the 1,000-result limit" >&2 + exit 1 +fi + +jq -r '.[].number' <<<"$SEARCH_RESULTS" \ | while read -r pr; do sha=$(gh pr view "$pr" --repo NVIDIA/Model-Optimizer \ --json mergeCommit --jq '.mergeCommit.oid') @@ -56,7 +67,7 @@ gh search prs \ done ``` -Assert that the GitHub result has no next-page token before continuing; abort the audit if it does. A release is not normally expected to exceed 1,000 merged PRs. +A release is not normally expected to reach the 1,000-PR limit. Review each PR's title, body, labels, changed files, and linked issue context. Classify it as: @@ -83,7 +94,7 @@ Use `—` when no NVBug is known. Also list NVBugs with no linked PR. Ask the us ```bash for pr in ; do - gh pr edit "$pr" --repo NVIDIA/Model-Optimizer --add-label "cherry-pick-" + gh pr edit "$pr" --repo NVIDIA/Model-Optimizer --add-label "cherry-pick-$VERSION" done ```