From 514580692c21fe440e35131167229f510abd1389 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Tue, 21 Mar 2017 01:27:26 -0700 Subject: [PATCH] Add launchpad bug update support to abandon script Change-Id: If6db7c8f39665dfdef9b3936fd75e33bd9b76e03 --- doc/source/policies/bugs.rst | 13 +++++++++ tools/abandon_old_reviews.sh | 16 +++++++++++ tools/unassign_bug.py | 52 ++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 tools/unassign_bug.py diff --git a/doc/source/policies/bugs.rst b/doc/source/policies/bugs.rst index 71769064ebe..5e34eac6ff2 100644 --- a/doc/source/policies/bugs.rst +++ b/doc/source/policies/bugs.rst @@ -292,6 +292,19 @@ If the bug report is sound, move next: we rotate, tagging bugs with 'needs-attention' can be useful to quickly identify what reports need further screening/eyes on. +Check for Bugs with the 'timeout-abandon' tag: + +* Search for any bugs with the timeout abandon tag: + `Timeout abandon `_. + This tag indicates that the bug had a patch associated with it that was + automatically abandonded after a timing out with negative feedback. +* For each bug with this tag, determine if the bug is still valid and update + the status accordingly. For example, if another patch fixed the bug, ensure + it's marked as 'Fix Released'. Or, if that was the only patch for the bug and + it's still valid, mark it as 'Confirmed'. +* After ensuring the bug report is in the correct state, remove the + 'timeout-abandon' tag. + You are done! Iterate. diff --git a/tools/abandon_old_reviews.sh b/tools/abandon_old_reviews.sh index dfed108b169..0c179721cf5 100755 --- a/tools/abandon_old_reviews.sh +++ b/tools/abandon_old_reviews.sh @@ -36,12 +36,14 @@ else fi set -o errexit +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" function abandon_review { local gitid=$1 shift local msg=$@ # echo ssh review.openstack.org gerrit review $gitid --abandon --message \"$msg\" + unassign_and_new_bug $gitid if [ $DRY_RUN -eq 1 ]; then echo "Would abandon $gitid" else @@ -50,6 +52,20 @@ function abandon_review { fi } +function unassign_and_new_bug { + # unassign current assignee and set bug to 'new' status + local gitid=$1 + cm=$(ssh review.openstack.org "gerrit query $gitid --current-patch-set --format json" | jq .commitMessage) + for closes in $(echo -e $cm | grep -i "closes" | grep -i "bug" | grep -o -E '[0-9]+'); do + if [ $DRY_RUN -eq 1 ]; then + echo "Would unassign and tag 'timeout-abandon' $closes" + else + echo "Attempting to change status of bug $closes to New" + python "$DIR/unassign_bug.py" $closes + fi + done +} + PROJECTS="($( python - <