Skip to content

Apache Lucene open-source search software

- 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)

Steven Rowe6d43b52cdb9d
diff --git a/lucene/site/changes/changes2html.pl b/lucene/site/changes/changes2html.pl
index e6756e3b477..7cfaf6b654e 100755
--- a/lucene/site/changes/changes2html.pl
+++ b/lucene/site/changes/changes2html.pl
@@ -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);