dev/release.sh: Add --reviewer to set reviewers
authorRichard Levitte <levitte@openssl.org>
Fri, 24 Apr 2020 09:03:28 +0000 (11:03 +0200)
committerMatt Caswell <matt@openssl.org>
Fri, 15 May 2020 10:20:31 +0000 (11:20 +0100)
Doing this is kind of contrary to how we normally do things, as this
constitutes a kind of pre-approval.  However, without this, the normal
review process will modify the reviewed commits, and render the
annotated release tag invalid, which forces the person doing the
release to re-tag manually.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11630)

dev/release.sh

index c7f19fe16d47330e5c37d8724f5de73330cfa520..7f7042fb18cf4b2753ac510008017f51c9cc02b2 100755 (executable)
@@ -24,6 +24,7 @@ Usage: release.sh [ options ... ]
                 where '{major}' and '{minor}' are the major and minor
                 version numbers.
 
                 where '{major}' and '{minor}' are the major and minor
                 version numbers.
 
+--reviewer=<id> The reviewer of the commits.
 --local-user=<keyid>
                 For the purpose of signing tags and tar files, use this
                 key (default: use the default e-mail address’ key).
 --local-user=<keyid>
                 For the purpose of signing tags and tar files, use this
                 key (default: use the default e-mail address’ key).
@@ -65,6 +66,7 @@ do_manual=false
 
 tagkey=' -s'
 gpgkey=
 
 tagkey=' -s'
 gpgkey=
+reviewers=
 
 upload_address=upload@dev.openssl.org
 
 
 upload_address=upload@dev.openssl.org
 
@@ -73,6 +75,7 @@ TEMP=$(getopt -l 'alpha,next-beta,beta,final' \
               -l 'no-upload,no-update' \
               -l 'verbose,debug' \
               -l 'local-user:' \
               -l 'no-upload,no-update' \
               -l 'verbose,debug' \
               -l 'local-user:' \
+              -l 'reviewer:' \
               -l 'force' \
               -l 'help,manual' \
               -n release.sh -- - "$@")
               -l 'force' \
               -l 'help,manual' \
               -n release.sh -- - "$@")
@@ -122,6 +125,11 @@ while true; do
         gpgkey=" -u $1"
         shift
         ;;
         gpgkey=" -u $1"
         shift
         ;;
+    --reviewer )
+        reviewers="$reviewers $1=$2"
+        shift
+        shift
+        ;;
     --force )
         force=true
         shift
     --force )
         force=true
         shift
@@ -311,6 +319,9 @@ if [ -n "$(git status --porcelain)" ]; then
     $VERBOSE "== Committing updates"
     git add -u
     git commit $git_quiet -m 'make update'
     $VERBOSE "== Committing updates"
     git add -u
     git commit $git_quiet -m 'make update'
+    if [ -n "$reviewers" ]; then
+        addrev --nopr $reviewers
+    fi
 fi
 
 # Write the version information we updated
 fi
 
 # Write the version information we updated
@@ -339,6 +350,9 @@ done
 $VERBOSE "== Comitting updates and tagging"
 git add -u
 git commit $git_quiet -m "Prepare for release of $release_text"
 $VERBOSE "== Comitting updates and tagging"
 git add -u
 git commit $git_quiet -m "Prepare for release of $release_text"
+if [ -n "$reviewers" ]; then
+    addrev --nopr $reviewers
+fi
 echo "Tagging release with tag $tag.  You may need to enter a pass phrase"
 git tag$tagkey "$tag" -m "OpenSSL $release release tag"
 
 echo "Tagging release with tag $tag.  You may need to enter a pass phrase"
 git tag$tagkey "$tag" -m "OpenSSL $release release tag"
 
@@ -436,6 +450,9 @@ done
 $VERBOSE "== Comitting updates"
 git add -u
 git commit $git_quiet -m "Prepare for $release_text"
 $VERBOSE "== Comitting updates"
 git add -u
 git commit $git_quiet -m "Prepare for $release_text"
+if [ -n "$reviewers" ]; then
+    addrev --nopr $reviewers
+fi
 
 if $do_branch; then
     $VERBOSE "== Going back to the main branch $current_branch"
 
 if $do_branch; then
     $VERBOSE "== Going back to the main branch $current_branch"
@@ -460,6 +477,9 @@ if $do_branch; then
     $VERBOSE "== Comitting updates"
     git add -u
     git commit $git_quiet -m "Prepare for $release_text"
     $VERBOSE "== Comitting updates"
     git add -u
     git commit $git_quiet -m "Prepare for $release_text"
+    if [ -n "$reviewers" ]; then
+        addrev --nopr $reviewers
+    fi
 fi
 
 # Done ###############################################################
 fi
 
 # Done ###############################################################
@@ -543,6 +563,7 @@ B<--beta> |
 B<--final> |
 B<--branch> |
 B<--local-user>=I<keyid> |
 B<--final> |
 B<--branch> |
 B<--local-user>=I<keyid> |
+B<--reviewer>=I<id> |
 B<--no-upload> |
 B<--no-update> |
 B<--verbose> |
 B<--no-upload> |
 B<--no-update> |
 B<--verbose> |
@@ -619,6 +640,14 @@ Use I<keyid> as the local user for C<git tag> and for signing with C<gpg>.
 
 If not given, then the default e-mail address' key is used.
 
 
 If not given, then the default e-mail address' key is used.
 
+=item B<--reviewer>=I<id>
+
+Add I<id> to the set of reviewers for the commits performed by this script.
+Multiple reviewers are allowed.
+
+If no reviewer is given, you will have to run C<addrev> manually, which
+means retagging a release commit manually as well.
+
 =item B<--force>
 
 Force execution.  Precisely, the check that the current branch is C<master>
 =item B<--force>
 
 Force execution.  Precisely, the check that the current branch is C<master>