Created
August 3, 2021 13:49
-
-
Save CyrilRoelandteNovance/1af6a5a23112ce444bda0ca2010d3465 to your computer and use it in GitHub Desktop.
Close OpenStack bugs on Launchpad that should have been closed automatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -u | |
# Possible improvements: | |
# - Automagically set the bug status to "Fix Released" | |
# - Handle stable branches | |
old=$1 | |
new=$2 | |
project=$3 | |
usage () { | |
echo "Usage: $(basename $0) <old version> <new version> <launchpad project name>" | |
echo "" | |
echo "Show bugs fixed between <old version> and <new version> whose LP statuses have not been set to \"Fix Released\"" | |
exit 0 | |
} | |
[[ "$#" -ne "3" ]] && usage | |
bug_status () { | |
curl -s https://api.launchpad.net/devel/bugs/$1/bug_tasks \ | |
| jq -r '.entries[] | select(.bug_target_name == "'$project'").status' | |
} | |
for bugid in $(git log $old..$new | grep "^ Closes-Bug: #" | sed 's/.*#//') | |
do | |
status=$(bug_status $bugid) | |
[[ -z "$status" || "$status" == "Fix Released" ]] && continue | |
echo "https://bugs.launchpad.net/$project/+bug/$bugid (${status})" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment