- Update JIRA REST API URL ("rest/api/2.0.alpha1/" -> "rest/api/2/")

- Simplify release-recognizing regex
- Recognize and linkify non-Bugzilla URLs (the Bugzilla issue URLs are broken now)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1348517 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2012-06-09 23:23:58 +00:00
parent b3db6e9426
commit 6d43b52cdb
1 changed files with 6 additions and 3 deletions

View File

@ -24,7 +24,8 @@
use strict;
use warnings;
my $project_info_url = 'https://issues.apache.org/jira/rest/api/2.0.alpha1/project/LUCENE';
# JIRA REST API documentation: <http://docs.atlassian.com/jira/REST/latest/>
my $project_info_url = 'https://issues.apache.org/jira/rest/api/2/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;
@ -64,8 +65,7 @@ for (my $line_num = 0 ; $line_num <= $#lines ; ++$line_num) {
if (/\s*===+\s*(.*?)\s*===+\s*/) { # New-style release headings
$release = $1;
$release =~ s/^(?:release|lucene)\s*//i; # Trim "Release " or "Lucene " prefix
($release, $relinfo) = ($release =~ /^(\d+(?:\.(?:\d+(\-ALPHA|\-BETA)?|[xyz]))*|Trunk)\s*(.*)/i);
$relinfo =~ s/(\-ALPHA|\-BETA)//; # Trim -ALPHA or -BETA to only be in release (TODO: please fix the above regex instead!)
($release, $relinfo) = ($release =~ /^(\d+(?:\.(?:\d+))*(?:-(?:ALPHA|BETA))?|Trunk)\s*(.*)/i);
$relinfo =~ s/\s*:\s*$//; # Trim trailing colon
$relinfo =~ s/^\s*,\s*//; # Trim leading comma
($reldate, $relinfo) = get_release_date($release, $relinfo);
@ -509,6 +509,9 @@ for my $rel (@releases) {
$leading_whitespace . $issue1 . $interlude . $issue2;
~gex;
# Linkify URLs, except Bugzilla links, which don't work anymore
$item =~ s~(?<![">])(https?://(?!(?:nagoya|issues)\.apache\.org/bugzilla)\S+)~<a href="$1">$1</a>~g;
print " <li>$item</li>\n";
}
print " </$list>\n" unless ($has_release_sections and not $heading);