Merged
Conversation
Owner
boneskull
commented
Jan 29, 2026
- feat(github): improve stack comments with PR titles and links
- feat(cmd): refactor pr command and enhance log output
Replace code-block tree with markdown nested lists containing clickable PR links. Fetch PR titles via GraphQL in a single batched request. - Add PRInfo struct and GetPRTitles for batch title fetching - Add RepoURL, PRURL, FindPRByHead client helper methods - Add GenerateAndPostStackComment convenience method - Skip comment updates when body unchanged (reduces API noise) - Render tree as nested markdown lists instead of code blocks - Bold current PR link, include '(this PR)' marker - Improve warning message with parent PR link
Refactor 'gh stack pr' to wrap 'gh pr create' interactively: - Pass through user flags after '--' (e.g., --fill, --web, --title) - Auto-draft PRs targeting non-trunk branches - Use FindPRByHead to discover newly created PRs - Improve error messages with actionable hints - Extract updateExistingPR helper for clarity Enhance 'gh stack log' to display PR URLs: - Show clickable URLs in tree view - Add URL column to porcelain output
Owner
Author
Stack
Managed by gh-stack |
There was a problem hiding this comment.
Pull request overview
This PR improves PR stack comment generation and refactors the PR creation command to use the GitHub CLI interactively.
Changes:
- Enhanced stack comments to include PR titles and clickable links using a GraphQL batch request
- Refactored
prcommand to wrapgh pr createinteractively instead of using direct API calls - Added URL output to
logcommand for better navigation
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/github/github.go | Added GetPRTitles (GraphQL batch fetch), FindPRByHead, PRURL, and RepoURL methods; added Title field to PR struct |
| internal/github/github_test.go | Added comprehensive tests for FindPRByHead method (success, not found, and error cases) |
| internal/github/comments.go | Updated GenerateStackComment to accept PR info and repo URL; added CollectPRNumbers; refactored renderTree to use markdown lists with links; updated FindStackComment to return body; added skip-if-unchanged optimization; added GenerateAndPostStackComment helper |
| internal/github/comments_test.go | Updated all tests to use new signature; added tests for PR links, branch formatting, markdown lists, fallback behavior, and bolding |
| cmd/pr.go | Refactored to use gh.ExecInteractive instead of direct API calls; added updateExistingPR helper; improved error messages; added usage examples |
| cmd/log.go | Added optional GitHub client to display PR URLs in both tree and porcelain output |
| cmd/sync.go | Updated to use batch PR title fetching and pass prInfo through the tree walk |
| internal/git/git_test.go | Added trailing newline (whitespace-only change) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add TestGetCommits, TestGetCommitsNoCommits, TestGetCommitsSingleCommit for full coverage of the new GetCommits method - Add --fill-verbose to hasBodyFlag check so we don't override user's explicit body generation request - Document GetPRTitles limitation for very large stacks (100+ PRs) - Document porcelain output format in printPorcelain function comment
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.