Skip to content

Add breeze commands to move a pull request between project and fork CI - #77135

Open
potiuk wants to merge 1 commit into
mainfrom
fork-ci-label-commands
Open

potiuk wants to merge 1 commit into
mainfrom
fork-ci-label-commands

Conversation

@potiuk

@potiuk potiuk commented Nov 15, 2026

Copy link
Copy Markdown
Member

Adding use project ci by hand has two gaps:

#76672 first closed the window with a pull_request_target workflow. That was dropped because the trigger is being disabled for the repository, and the window became a documented limitation.

This adds two maintainer commands, run with the maintainer's own gh credentials.

breeze ci use-project-ci <PR> does, in this order:

  1. If the head commit's CI passed is a fork CI success, sets it to pending ("Waiting for project CI (use project ci)"). This is the same status, link and description the monitor writes when it releases the pull request, so its next run changes nothing. A success that project CI earned is kept.
  2. Adds use project ci, and removes use fork ci if present.
  3. Closes and reopens the pull request to start project CI. --no-restart leaves that to the author's next push.

Because the success is withheld before the label is added, there is no moment at which the pull request carries the label and can still merge on the fork result.

breeze ci use-fork-ci <PR> removes use project ci and adds use fork ci. The monitor gates the pull request on its next run, and a CI passed that project CI earned stays.

Both commands:

  • take --github-repository and --dry-run;
  • refuse a closed pull request;
  • report what they changed.

GitHubClient gets a reopen method. The commands are documented in dev/breeze/doc/08_ci_tasks.rst, with regenerated command images. The triage guide and the design doc's note on this window are rewritten in #77133. Once both are merged, I'll update them to point to use-project-ci.

Tested:

  • dev/breeze/tests/test_fork_ci_pr_move.py (new) covers the order of the writes, the statuses that must not be withheld, label changes, a closed pull request, and the commands' arguments and errors. The reopen test is in test_fork_ci_github.py.
  • All breeze tests pass.
  • The command images were regenerated from an uncached build, and the option-group check passes.
  • Static checks pass.

Not yet run against a real pull request.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Claude Opus 5)

Generated-by: Claude Code (Claude Opus 5) following the guidelines

🤖 Generated with Claude Code

https://claude.ai/code/session_01NyQq9U7i5HhjDgrQ9qd3gq

Adding `use project ci` by hand left the pull request mergeable on its
fork result until the next monitor run, and did not start project CI.
The pull_request_target revoke that closed the gap was dropped because
that trigger is being disabled, so the maintainer's own command now
withholds the result before adding the label, then restarts the pull
request.

Generated-by: Claude Opus 5
Claude-Session: https://claude.ai/code/session_01NyQq9U7i5HhjDgrQ9qd3gq

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant