]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
script: add backport-resolve-issue
authorNathan Cutler <ncutler@suse.com>
Wed, 21 Aug 2019 14:49:26 +0000 (16:49 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 27 Aug 2019 12:42:37 +0000 (14:42 +0200)
commit70ebffca56ace571982c23f4e9a4776575d5268c
treeab299a12afb0ca1ae83c29efbd8a9709b157f2ab
parent88662a4e319446eb75249d646dc586e4414201e7
script: add backport-resolve-issue

This script processes GitHub backport PRs, checking for proper cross-linking
with a Redmine Backport tracker issue and, if a PR is merged and properly
cross-linked, it can optionally resolve the tracker issue and correctly
populate the "Target version" field.

The script takes a single positional argument, which is optional. If the
argument is an integer, it is assumed to be a GitHub backport PR ID (e.g. "28549").
In this mode ("single PR mode") the script processes a single GitHub backport
PR and terminates.

If the argument is not an integer, or is missing, it is assumed to be a
commit (SHA1 or tag) to start from. If no positional argument is given, it
defaults to the tag "BRI", which might have been added by the last run of the
script. This mode is called "scan merge commits mode".

In both modes, the script scans a local git repo, which is assumed to be
in the current working directory. In single PR mode, the script will work
only if the PR's merge commit is present in the current branch of the local
git repo. In scan merge commits mode, the script starts from the given SHA1
or tag, taking each merge commit in turn and attempting to obtain the GitHub
PR number for each.

For each GitHub PR, the script interactively displays all relevant information
(NOTE: this includes displaying the GitHub PR and Redmine backport issue in
web browser tabs!) and prompts the user for her preferred disposition.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
src/script/backport-resolve-issue [new file with mode: 0755]