Skip to content

Link direct submissions as GitHub native stacks#362

Open
ezyang wants to merge 1 commit into
mainfrom
gh/ezyang/72/head
Open

Link direct submissions as GitHub native stacks#362
ezyang wants to merge 1 commit into
mainfrom
gh/ezyang/72/head

Conversation

@ezyang

@ezyang ezyang commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Direct ghstack pull requests already use the base-to-head branch chain required by GitHub Stacked PRs, but GitHub also requires an explicit Stack object. Discover native stack membership during submission, create or append the server-side stack, and retain merged remote prefixes when the local stack has rebased them away.

GitHub owns PR base refs after linking. Preflight divergent orders before pushing, omit redundant base updates, and require users to unstack before a destructive reorder. Stack API failures remain best-effort so repositories outside the private preview preserve existing direct-mode behavior. Stack IDs are rediscovered rather than persisted to keep ghstack stateless.

Test Plan:

lintrunner -a
uv run --frozen pytest --verbose
uv run --frozen python -m black --check src/ghstack/
uv run --frozen python -m flake8 src/ghstack/

Live-tested with draft [skip ci] PRs #190128 and #190129 in pytorch/pytorch. Verified native stack creation and ghstack-style updates, then dissolved the stack, closed the PRs, deleted the branches, and confirmed zero check runs.

Authored with assistance from OpenAI Codex.

[ghstack-poisoned]
@ezyang

ezyang commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

Stack from ghstack (oldest at bottom):

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.

1 participant