From patchwork Tue Sep 13 13:20:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 9329157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 92BFC6048F for ; Tue, 13 Sep 2016 13:52:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83BF129458 for ; Tue, 13 Sep 2016 13:52:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 780FF29486; Tue, 13 Sep 2016 13:52:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CB33C29458 for ; Tue, 13 Sep 2016 13:52:05 +0000 (UTC) Received: from localhost ([::1]:49004 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjo84-0001Xv-3x for patchwork-qemu-devel@patchwork.kernel.org; Tue, 13 Sep 2016 09:52:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjne5-0002ll-IA for qemu-devel@nongnu.org; Tue, 13 Sep 2016 09:21:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjne1-0005nQ-Jc for qemu-devel@nongnu.org; Tue, 13 Sep 2016 09:21:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjne1-0005mh-CZ for qemu-devel@nongnu.org; Tue, 13 Sep 2016 09:21:01 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 063EB7F7AA; Tue, 13 Sep 2016 13:21:01 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8DDKwZc021644; Tue, 13 Sep 2016 09:20:59 -0400 From: Thomas Huth To: qemu-devel@nongnu.org Date: Tue, 13 Sep 2016 15:20:58 +0200 Message-Id: <1473772858-30881-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 13 Sep 2016 13:21:01 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2] scripts: Add a script to check for bug URLs in the git log X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , stefanha@redhat.com, Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Basic idea of this script is to check the git log for URLs to the QEMU bugtracker at launchpad.net and to figure out whether the related bug has been marked there as "Fix released" (i.e. closed) already. So this script can e.g. be used after each public release of QEMU to check whether there are any bug tickets that could be moved from "Fix committed" (or another state if the author of the patch forgot to update the bug ticket) to "Fix released". Signed-off-by: Thomas Huth --- v2: - Use xdg-open and friends to open the URLs in a browser - Some cosmetics scripts/show-fixed-bugs.sh | 91 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 scripts/show-fixed-bugs.sh diff --git a/scripts/show-fixed-bugs.sh b/scripts/show-fixed-bugs.sh new file mode 100755 index 0000000..89847bd --- /dev/null +++ b/scripts/show-fixed-bugs.sh @@ -0,0 +1,91 @@ +#!/bin/sh + +# This script checks the git log for URLs to the QEMU launchpad bugtracker +# and optionally checks whether the corresponding bugs are not closed yet. + +function show_help { + echo "Usage:" + echo " -s : Start searching at this commit" + echo " -e : End searching at this commit" + echo " -c : Check if bugs are still open" + echo " -b : Open bugs in browser" +} + +while [ $# -ge 1 ]; do + case "$1" in + -s) START="$2" ; shift ;; + -e) END="$2" ; shift ;; + -c) CHECK_IF_OPEN=1 ;; + -b) SHOW_IN_BROWSER=1 ;; + -h) show_help ; exit 0 ;; + *) echo "Unkown option $1 ... use -h for help." ; exit 1 ;; + esac + shift +done + +if [ "x$START" = "x" ]; then + START=`git tag | grep 'v[0-9]*\.[0-9]*.0$' | tail -n 2 | head -n 1` +fi +if [ "x$END" = "x" ]; then + END=`git tag | grep 'v[0-9]*\.[0-9]*.0$' | tail -n 1` +fi + +if [ "x$BROWSER" != "x" ]; then + BUGBROWSER = "$BROWSER" +elif which xdg-open > /dev/null; then + BUGBROWSER=xdg-open +elif which gnome-open > /dev/null; then + BUGBROWSER=gnome-open +elif [ `uname` = "Darwin" ]; then + BUGBROWSER=open +elif which sensible-browser > /dev/null; then + BUGBROWSER=sensible-browser +else + echo "Please set the BROWSER variable to the browser of your choice." + exit 1 +fi + +if [ "x$START" = "x" -o "x$END" = "x" ]; then + echo "Could not determine start or end revision ... Please note that this" + echo "script must be run from a checked out git repository of QEMU!" + exit 1 +fi + +echo "Searching git log for bugs in the range $START..$END" + +BUG_URLS=`git log $START..$END \ + | grep 'https://bugs.launchpad.net/\(bugs\|qemu/+bug\)/' \ + | sed 's,\(.*\)\(https://bugs.launchpad.net/\(bugs\|qemu/+bug\)/\)\([0-9]*\).*,\2\4,' \ + | sort -u` + +echo Found bug URLs: +for i in $BUG_URLS ; do echo " $i" ; done + +if [ "x$CHECK_IF_OPEN" = "x1" ]; then + echo + echo "Checking which ones are still opened..." + for i in $BUG_URLS ; do + if ! curl -s -L "$i" | grep "value status" | grep -q "Fix Released" ; then + echo " $i" + FINAL_BUG_URLS="$FINAL_BUG_URLS $i" + fi + done +else + FINAL_BUG_URLS=$BUG_URLS +fi + +if [ "x$FINAL_BUG_URLS" = "x" ]; then + echo "No open bugs found." +elif [ "x$SHOW_IN_BROWSER" = "x1" ]; then + FIRST=1 + for i in $FINAL_BUG_URLS; do + "$BUGBROWSER" "$i" + if [ $FIRST = 1 ]; then + # if it is the first entry, give the browser some time to start + # (to avoid messages like "Firefox is already running, but is + # not responding...") + sleep 4 + FIRST=0 + fi + done +fi