Add sync command, CLI entry point, and test infrastructure#333
Merged
Add sync command, CLI entry point, and test infrastructure#333
Conversation
Owner
Author
|
Stack from ghstack (oldest at bottom): |
ezyang
added a commit
that referenced
this pull request
May 9, 2026
Summary: - Add `ghstack sync` command that syncs PR descriptions from GitHub back to local commit messages - Add CLI entry point (`src/ghstack/cli.py`) with click-based commands for all ghstack operations - Add pytest infrastructure (`conftest.py`) to run `.py.test` files as tests - Add test prelude (`src/ghstack/test_prelude.py`) with helpers for writing integration tests - Add basic sync test (`test/sync/basic.py.test`) verifying PR description sync functionality The sync command fetches PR titles and bodies from GitHub and updates the corresponding local commit messages, stripping the stack list from the body while preserving trailers like ghstack-source-id and Pull-Request. Test Plan: - New test file `test/sync/basic.py.test` verifies the sync functionality works correctly - Test covers both direct and non-direct modes - Verifies PR titles update commit subjects - Verifies PR bodies update commit bodies - Verifies stack lists are stripped from commit messages - Verifies trailers are preserved ghstack-source-id: 02111a1 ghstack-comment-id: 4413312087 Pull-Request: #333
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
ghstack synccommand that syncs PR descriptions from GitHub back to local commit messagessrc/ghstack/cli.py) with click-based commands for all ghstack operationsconftest.py) to run.py.testfiles as testssrc/ghstack/test_prelude.py) with helpers for writing integration teststest/sync/basic.py.test) verifying PR description sync functionalityThe sync command fetches PR titles and bodies from GitHub and updates the corresponding local commit messages, stripping the stack list from the body while preserving trailers like ghstack-source-id and Pull-Request.
Test Plan:
test/sync/basic.py.testverifies the sync functionality works correctly