LUCENE-3181: changes2html.pl should collect release dates from JIRA REST API

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1133646 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2011-06-09 04:03:52 +00:00
parent 557135dd9b
commit 632a0a41d1
1 changed files with 23 additions and 1 deletions

View File

@ -23,7 +23,10 @@
use strict;
use warnings;
use JSON;
use LWP::Simple;
my $project_info_url = 'https://issues.apache.org/jira/rest/api/2.0.alpha1/project/LUCENE';
my $jira_url_prefix = 'http://issues.apache.org/jira/browse/';
my $bugzilla_url_prefix = 'http://issues.apache.org/bugzilla/show_bug.cgi?id=';
my %release_dates = &setup_release_dates;
@ -648,8 +651,13 @@ sub get_release_date {
# Returns a list of alternating release names and dates, for use in populating
# the %release_dates hash.
#
# Pulls release dates via the JIRA REST API. JIRA does not list
# X.Y RCZ releases independently from releases X.Y, so the RC dates
# as well as those named "final" are included below.
#
sub setup_release_dates {
return ( '0.01' => '2000-03-30', '0.04' => '2000-04-19',
my %release_dates
= ( '0.01' => '2000-03-30', '0.04' => '2000-04-19',
'1.0' => '2000-10-04', '1.01b' => '2001-06-02',
'1.2 RC1' => '2001-10-02', '1.2 RC2' => '2001-10-19',
'1.2 RC3' => '2002-01-27', '1.2 RC4' => '2002-02-14',
@ -667,6 +675,20 @@ sub setup_release_dates {
'2.4.0' => '2008-10-06', '2.4.1' => '2009-03-09',
'2.9.0' => '2009-09-23', '2.9.1' => '2009-11-06',
'3.0.0' => '2009-11-25');
my $project_info_json = get($project_info_url);
my $project_info = decode_json($project_info_json);
for my $version (@{$project_info->{versions}}) {
if ($version->{releaseDate}) {
my $date = substr($version->{releaseDate}, 0, 10);
my $version_name = $version->{name};
$release_dates{$version->{name}} = $date;
if ($version_name =~ /^\d+\.\d+$/) {
my $full_version_name = "$version->{name}.0";
$release_dates{$full_version_name} = $date;
}
}
}
return %release_dates;
}