Bug 1452159 periodic file update clears out old reviews r=jlorenzo
authorSimon Fraser <sfraser@mozilla.com>
Mon, 09 Apr 2018 11:18:06 +0100
changeset 457291 8924788c2d5b98b965b592cc28c4307cb81ee5f2
parent 457290 e7478c64d4d9cef3ebe48d1f64c87b2bf39530f1
child 457292 0385d9f3f878c6eb5006083a6824a14acf10807b
push id153
push userfmarier@mozilla.com
push dateTue, 10 Apr 2018 02:28:40 +0000
reviewersjlorenzo
bugs1452159
milestone61.0a1
Bug 1452159 periodic file update clears out old reviews r=jlorenzo 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.