From eed2628cff1bb22610540af066e6abb336acd49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 10 Sep 2018 13:50:18 +0300 Subject: [PATCH] Rewrite issue listing script Rewrote the script in python and leveraged the dictionary CSV processor to prevent field number mismatches. Combined the two scripts into one so that all user-facing issues that are fixed can be easily shown in the release notes. --- .../{list_fixed_bugs.sh => list_fixed.sh} | 2 +- Documentation/list_fixed_issues.sh | 14 --------- Documentation/process.pl | 22 -------------- Documentation/process.py | 30 +++++++++++++++++++ 4 files changed, 31 insertions(+), 37 deletions(-) rename Documentation/{list_fixed_bugs.sh => list_fixed.sh} (58%) delete mode 100755 Documentation/list_fixed_issues.sh delete mode 100755 Documentation/process.pl create mode 100755 Documentation/process.py diff --git a/Documentation/list_fixed_bugs.sh b/Documentation/list_fixed.sh similarity index 58% rename from Documentation/list_fixed_bugs.sh rename to Documentation/list_fixed.sh index 6c8ed1b73..72d9e4858 100755 --- a/Documentation/list_fixed_bugs.sh +++ b/Documentation/list_fixed.sh @@ -11,4 +11,4 @@ fi DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" version=$1 -curl -s "https://jira.mariadb.org/sr/jira.issueviews:searchrequest-csv-current-fields/temp/SearchRequest.csv?jqlQuery=project+%3D+MXS+AND+issuetype+%3D+Bug+AND+status+%3D+Closed+AND+fixVersion+%3D+$version" | $DIR/process.pl +curl -s "https://jira.mariadb.org/sr/jira.issueviews:searchrequest-csv-all-fields/temp/SearchRequest.csv?jqlQuery=project+%3D+MXS+AND+status+%3D+Closed+AND+fixVersion+%3D+$version" | $DIR/process.py diff --git a/Documentation/list_fixed_issues.sh b/Documentation/list_fixed_issues.sh deleted file mode 100755 index 9cab8dd8d..000000000 --- a/Documentation/list_fixed_issues.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - - -if [ $# -ne 1 ] -then - echo "USAGE: $0 VERSION" - exit 1 -fi - -# Script location -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -version=$1 -curl -s "https://jira.mariadb.org/sr/jira.issueviews:searchrequest-csv-current-fields/temp/SearchRequest.csv?jqlQuery=project+%3D+MXS+AND+issuetype+%21%3D+Bug+AND+status+%3D+Closed+AND+fixVersion+%3D+$version" | $DIR/process.pl diff --git a/Documentation/process.pl b/Documentation/process.pl deleted file mode 100755 index 69a3107c4..000000000 --- a/Documentation/process.pl +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env perl - -# Discard the CSV headers -<>; - -while (<>) -{ - # Replace commas that are inside double quotes - while (s/("[^"]*),([^"]*")/$1$2/g) - { - ; - } - # Replace the double quotes themselves - s/"//g; - - # Split the line and grab the issue number and description - my @parts = split(/,/); - my $issue = @parts[1]; - my $desc = @parts[0]; - - print "* [$issue](https://jira.mariadb.org/browse/$issue) $desc\n"; -} diff --git a/Documentation/process.py b/Documentation/process.py new file mode 100755 index 000000000..ae8a895e8 --- /dev/null +++ b/Documentation/process.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 + +import sys +import csv + +bugs = [] +new_features = [] + +for row in csv.DictReader(sys.stdin): + if row['Issue Type'] == 'Bug': + bugs.append(row) + elif row['Issue Type'] == 'New Feature': + new_features.append(row) + +if len(new_features) > 0: + print("## New Features") + print() + + for f in new_features: + print("* [" + f['Issue key'] + "](https://jira.mariadb.org/browse/" + f['Issue key'] + ") " + f['Summary']) + print() + + +print("## Bug fixes") +print() + +for b in bugs: + print("* [" + b['Issue key'] + "](https://jira.mariadb.org/browse/" + b['Issue key'] + ") " + b['Summary']) + +print()