Bug 1452159 - Periodic file update clears out old reviews. r=jlorenzo, a=release
authorSimon Fraser <sfraser@mozilla.com>
Mon, 09 Apr 2018 11:18:06 +0100
changeset 806002 8f05d10a47978d7b770fdda5de69fd67445553a9
parent 806001 1d67d6de4783c0683c87a924d51cc9bece88f6c0
child 806003 fe272f41ed069ec44f37b5fd7f1b8ad7c4cd41a8
push id112832
push userbballo@mozilla.com
push dateFri, 08 Jun 2018 21:11:22 +0000
reviewersjlorenzo, release
bugs1452159
milestone60.0.2
Bug 1452159 - Periodic file update clears out old reviews. r=jlorenzo, a=release Summary: the periodic file updates keep adding new reviews, and it's easy to fall behind. This adjusts the script so it clears out any previous submissions that are still awaiting review. Reviewers: jlorenzo Reviewed By: jlorenzo Bug #: 1452159 Differential Revision: https://phabricator.services.mozilla.com/D872
taskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh
--- a/taskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh
+++ b/taskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh
@@ -403,16 +403,27 @@ function push_repo {
   if ! ARC=$(which arc)
   then
     return 1
   fi
   if [ -z "${REVIEWERS}" ]
   then
     return 1
   fi
+
+  # Clean up older review requests
+  # Turn  Needs Review D624: No bug, Automated HSTS ...
+  # into D624
+  for diff in $($ARC list | grep "Needs Review" | grep -E "Automated HSTS|Automated HPKP|Automated blocklist" | awk 'match($0, /D[0-9]+[^: ]/, arr) { print arr[0] }')
+  do
+    echo "Removing old request $diff"
+    # There is no 'arc abandon', see bug 1452082
+    echo '{"transactions": [{"type":"abandon"}], "objectIdentifier": "'"${diff}"'"}' | arc call-conduit differential.revision.edit
+  done
+
   $ARC diff --verbatim --reviewers "${REVIEWERS}"
 }
 
 
 
 # Main
 
 # Parse our command-line options.