Skip to content

Correct the split-PR skill's stacking rules for copy-pr-bot CI - #6593

Merged
ilml merged 4 commits into
NVIDIA:mainfrom
ilml:update-split-pr-skill
Aug 18, 2026
Merged

Correct the split-PR skill's stacking rules for copy-pr-bot CI#6593
ilml merged 4 commits into
NVIDIA:mainfrom
ilml:update-split-pr-skill

Conversation

@ilml

@ilml ilml commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Corrects the mcore-split-pr skill's stacked-PR guidance to match how copy-pr-bot CI actually works:

  • Create every PR with base main; pull-request/<N> mirror refs only exist after a vetter's /ok to test, so stack (gh pr edit <child> --base pull-request/<parent>) only after vetting.
  • Never merge a PR whose base is a pull-request/* ref — the squash lands in the bot's scratch ref, not main, and the PR ends up MERGED and unreopenable.
  • Retarget dependents back to main as soon as the base PR is approved — the bot deletes the mirror ref when the base PR merges or closes, and GitHub then auto-closes every PR based on it.

Docs/skill only, no code changes.

why https://docs.github.com/en/pull-requests/how-tos/create-pull-requests/creating-stacked-pull-requests doesn't work for us at this moment?
because we can't create branches directly in megatron, we have to rely on copy-pr-bot to create/copy branches for us.

@copy-pr-bot

copy-pr-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

The skill's stacking guidance predated actually running a stacked series
through Megatron-LM's CI and was wrong or incomplete in ways that bite:

- It said to CREATE dependent PRs with base pull-request/<N>; that ref
  does not exist until a vetter runs /ok to test, so creation fails.
  Correct flow: create everything on main, vet, then retarget.
- Its only merge warning was the auto-close hazard. The worse failure is
  merging while mirror-based: GitHub merges into the bot's scratch ref,
  nothing lands on main, and the MERGED PR cannot be reopened. Rule:
  retarget to main before merging, always.
- It did not explain the copy-pr-bot trust model that stacking piggybacks
  on (vetted-snapshot refs, staleness on push, /ok to test <sha>), the
  squash-merge rebase cascade children need after each parent lands, the
  lint job checking touched core/tests files against main's formatter
  pins, or how to linearize a PR with two dependencies.

Adds a CI-model section, splits the workflow into create -> stack for
review -> merge bottom-up phases, and folds the failure modes into the
constraints.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: ilml <tolong@nvidia.com>
@ilml
ilml marked this pull request as ready for review August 18, 2026 16:34
@ilml
ilml requested a review from Phlip79 August 18, 2026 16:34
@github-actions github-actions Bot added the docs-only documentation only (docs or docstrings) label Aug 18, 2026
@ilml
ilml enabled auto-merge August 18, 2026 16:39
@ilml

ilml commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test e89c8e89bcedbcaa53c47b90b0e08bfd6dcab1cd

@copy-pr-bot

copy-pr-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

/ok to test e89c8e89bcedbcaa53c47b90b0e08bfd6dcab1cd

@ilml, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

copy-pr-bot deletes the pull-request/<N> mirror when PR N merges or
closes, and GitHub then auto-closes every PR based on that ref; such a
PR cannot be reopened while the ref is missing, so a single parent merge
can domino-close the rest of the stack faster than anyone can react.

Move the un-stacking step to the moment the parent is approved -- the
last point at which the child can safely leave the mirror -- and extend
the suggested watchdog to flag an approved parent that still has
mirror-based children.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: ilml <tolong@nvidia.com>
@ilml
ilml requested a review from wujingyue August 18, 2026 17:12

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

Could we make this PR much more concise? I think the /ok to test part is really what was missed. Other than that, #5496 (merged 1.5 months ago) seems to be sufficient.

In addition, you may want to mention why https://docs.github.com/en/pull-requests/how-tos/create-pull-requests/creating-stacked-pull-requests doesn't work for us at this moment for posterity.

The pull-request/<N> mirror refs only exist after a vetter's
/ok to test, are merged into if a mirror-based PR is merged, and are
deleted (auto-closing dependents) when the base PR merges or closes.
Create PRs on main, stack after vetting, never merge mirror-based, and
retarget dependents to main on base-PR approval.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: ilml <tolong@nvidia.com>
@ilml ilml changed the title Update split-PR skill with the real CI-driven stacking workflow Correct the split-PR skill's stacking rules for copy-pr-bot CI Aug 18, 2026
@ilml

ilml commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test be9de0a

@ilml

ilml commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Could we make this PR much more concise? I think the /ok to test part is really what was missed. Other than that, #5496 (merged 1.5 months ago) seems to be sufficient.

In addition, you may want to mention why https://docs.github.com/en/pull-requests/how-tos/create-pull-requests/creating-stacked-pull-requests doesn't work for us at this moment for posterity.

yes agree, fixed!

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

LGTM! Thanks for the PR!

Comment thread skills/mcore-split-pr/SKILL.md Outdated
@ilml
ilml added this pull request to the merge queue Aug 18, 2026

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

why https://docs.github.com/en/pull-requests/how-tos/create-pull-requests/creating-stacked-pull-requests doesn't work for us at this moment? because we can't create branches directly in megatron, we have to rely on copy-pr-bot to create/copy branches for us.

This should be added to SKILL.md so agents know.

@wujingyue
wujingyue removed this pull request from the merge queue due to a manual request Aug 18, 2026
@ilml

ilml commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a0a24c88c355072a6a90de1546f79dd6802eb92d

@copy-pr-bot

copy-pr-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

/ok to test a0a24c88c355072a6a90de1546f79dd6802eb92d

@ilml, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

Contributors cannot push branches to NVIDIA/Megatron-LM, and a PR's
base must be an upstream branch, so the documented stacked-PR flow of
basing each PR on the previous feature branch does not apply; the
copy-pr-bot pull-request/<N> mirrors are the only usable stack bases.

Also drop the Important-guidelines bullet on retargeting, which
duplicated the answer-first constraint (review feedback).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: ilml <tolong@nvidia.com>
@ilml
ilml enabled auto-merge August 18, 2026 17:48
@wujingyue

Copy link
Copy Markdown
Contributor

/ok to test a0a24c8

@ilml
ilml added this pull request to the merge queue Aug 18, 2026
Merged via the queue into NVIDIA:main with commit aeae5d7 Aug 18, 2026
45 of 46 checks passed
@ilml
ilml deleted the update-split-pr-skill branch August 18, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-only documentation only (docs or docstrings)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants