|
| 1 | +# PR Bulk Tools |
| 2 | + |
| 3 | +This contains a selection of scripts that can be used to bulk manipulate similar PRs across a defined set of repositories. |
| 4 | +The requirement for PRs to be considered _similar_ for the purpose of these scripts is that the branch they are created from have the same name. |
| 5 | + |
| 6 | +**WARNING:** |
| 7 | +These scripts do not contain much in the way of safety checks or security confirmations. |
| 8 | +You are expected to know what you are doing and should most probably conduct due diligence directly on the PRs before using these tools to approve them. |
| 9 | + |
| 10 | +## Overview |
| 11 | +This section will give a brief overview of the tools contained in this repo. |
| 12 | + |
| 13 | +The recommended workflow for PRs created by the operator templating is: |
| 14 | + |
| 15 | +1. Run `pr_diff` and check for any unexpected changes |
| 16 | +2. Periodically run `pr_status` until all PRs show 0 |
| 17 | +3. Run `pr_approve` |
| 18 | + |
| 19 | +### Common parameters |
| 20 | +With the only exception of the `repos` script all scripts in this repository take the same parameter, which is the name of the branch the PRs you want to operate on was created from. |
| 21 | + |
| 22 | +For example for a set of operator templating pull requests this will usually be in the form of `template_abd68ad` which is the fixed prefix `template_` followed by the short commit hash of the commit in the operator templating repo that it was based on. |
| 23 | + |
| 24 | +### Configuration |
| 25 | +Configuration of all these tools is done in the `repos` script. |
| 26 | +This script doesn't take any parameters. |
| 27 | +It is sourced by all the other scripts and defines the list of operator repositories that should be included in bulk operations. |
| 28 | + |
| 29 | +Edit this file if you want to exclude operators from bulk operations for some reason, or if new operators have been created that should be included. |
| 30 | + |
| 31 | +## Scripts |
| 32 | +### pr_approve |
| 33 | +Approves all pull requests and adds a `bors r+` comment to start the bors merge process. |
| 34 | + |
| 35 | +### pr_checks |
| 36 | +Shows all checks for all PRs and their current status. |
| 37 | + |
| 38 | +Checks are shown per PR, hitting `q` switches to the next PR, Ctrl-C can be used to abort the entire script. |
| 39 | + |
| 40 | +### pr_close |
| 41 | +Closes all PRs. |
| 42 | + |
| 43 | +### pr_diffs |
| 44 | +Shows the diffs for all PRs, this can be useful to double check that no unexpected changes were queued in any repository by accident. |
| 45 | + |
| 46 | +Diffs are shown per PR, hitting `q` switches to the next PR, Ctrl-C can be used to abort the entire script. |
| 47 | + |
| 48 | +### pr_status |
| 49 | +Shows an abbreviated status of all PRs. |
| 50 | + |
| 51 | +The displayed status per PR can have the following values: |
| 52 | + |
| 53 | +| Status | Meaning | |
| 54 | +|--------|------------------------------------------------| |
| 55 | +| 0 | All checks were finished and successful | |
| 56 | +| 1 | One or more checks failed or are still running | |
0 commit comments