Repository navigation
Add --stack option to test a GitHub PR stack - #44
Open
christophebedard wants to merge 1 commit into
Open
christophebedard wants to merge 1 commit into
christophebedard wants to merge 1 commit into
Conversation
Given a PR that is part of a GitHub PR stack, look up the whole stack and use the source branch of the top PR in the modified `ros2.repos`, since it contains the changes from all PRs of the stack. With `--comment`, post the comment on every open PR of the stack; this also works with `--test-report`. PyGithub does not support PR stacks, so query the REST API directly: https://docs.github.com/en/rest/pulls/stacks When using `--build`, ask for confirmation if the stack targets a different branch than the selected release (this check already exists for normal PRs), or if the top PR's branch is missing changes from the other PRs of the stack. `--stack` cannot be combined with `--pulls`, `--interactive`, or `--branch`: testing a PR stack along with other PRs is not supported for now. --- Example: ros2/rviz#1916 is stacked on ros2/rviz#1915 against Lyrical. Running: ``` $ GITHUB_TOKEN=... ros-ci-for-pr \ -s ros2/rviz#1915 -k rviz_ogre_vendor -t lyrical -b -c ``` Creates a gist using ros2/rviz#1916 (the top of the stack, which includes ros2/rviz#1915's changes) and comments on both ros2/rviz#1915 and ros2/rviz#1916 with the CI jobs info: * ros2/rviz#1915 (comment) * ros2/rviz#1916 (comment) Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
mjcarroll
approved these changes
Nov 15, 2026
fujitatomoya
approved these changes
Nov 16, 2026
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.
Given a PR that is part of a GitHub PR stack, look up the whole stack and use the source branch of the top PR in the modified
ros2.repos, since it contains the changes from all PRs of the stack. With--comment, post the comment on every open PR of the stack; this also works with--test-report.PyGithub does not support PR stacks, so query the REST API directly: https://docs.github.com/en/rest/pulls/stacks
When using
--build, ask for confirmation if the stack targets a different branch than the selected release (this check already exists for normal PRs), or if the top PR's branch is missing changes from the other PRs of the stack.--stackcannot be combined with--pulls,--interactive, or--branch: testing a PR stack along with other PRs is not supported for now.Example: ros2/rviz#1916 is stacked on ros2/rviz#1915 against Lyrical. Running:
Creates a gist using ros2/rviz#1916 (the top of the stack, which includes ros2/rviz#1915's changes) and comments on both ros2/rviz#1915 and ros2/rviz#1916 with the CI jobs info:
I used Claude Opus 5.5 to implement this.