Przeglądaj źródła

Added coming annotation and breaking changes link to release notes script

Also fixed the "area" regex to only remove up to the first /
so that it doesn't remove too much in :Distributed/Snapshot/Restore

Finally, tidied
Clinton Gormley 7 lat temu
rodzic
commit
882df3156c
1 zmienionych plików z 14 dodań i 7 usunięć
  1. 14 7
      dev-tools/es_release_notes.pl

+ 14 - 7
dev-tools/es_release_notes.pl

@@ -31,9 +31,8 @@ my @Groups = (
     ">breaking",    ">breaking-java", ">deprecation", ">feature",
     ">enhancement", ">bug",           ">regression",  ">upgrade"
 );
-my %Ignore = map { $_ => 1 } (
-    ">non-issue", ">refactoring", ">docs", ">test", ":Core/Build"
-);
+my %Ignore = map { $_ => 1 }
+    ( ">non-issue", ">refactoring", ">docs", ">test", ":Core/Build" );
 
 my %Group_Labels = (
     '>breaking'      => 'Breaking changes',
@@ -70,6 +69,9 @@ sub dump_issues {
     my $issues  = shift;
 
     $version =~ s/v//;
+    my $branch = $version;
+    $branch =~ s/\.\d+$//;
+
     my ( $day, $month, $year ) = (gmtime)[ 3 .. 5 ];
     $month++;
     $year += 1900;
@@ -81,12 +83,16 @@ sub dump_issues {
 [[release-notes-$version]]
 == $version Release Notes
 
+coming[$version]
+
+Also see <<breaking-changes-$branch>>.
+
 ASCIIDOC
 
     for my $group ( @Groups, 'other' ) {
         my $group_issues = $issues->{$group} or next;
         my $group_id = $group;
-        $group_id=~s/^>//;
+        $group_id =~ s/^>//;
         print "[[$group_id-$version]]\n"
             . "[float]\n"
             . "=== $Group_Labels{$group}\n\n";
@@ -162,14 +168,15 @@ ISSUE:
     for my $issue (@issues) {
         next if $seen{ $issue->{number} } && !$issue->{pull_request};
 
-        for (@{ $issue->{labels} }) {
-            next ISSUE if $Ignore{$_->{name}};
+        for ( @{ $issue->{labels} } ) {
+            next ISSUE if $Ignore{ $_->{name} };
         }
 
         # uncomment for including/excluding PRs already issued in other versions
         # next if grep {$_->{name}=~/^v2/} @{$issue->{labels}};
         my %labels = map { $_->{name} => 1 } @{ $issue->{labels} };
-        my ($header) = map { /:.+\/(.+)/ && $1 } grep {/^:/} sort keys %labels;
+        my ($header) = map { m{:[^/]+/(.+)} && $1 }
+            grep {/^:/} sort keys %labels;
         $header ||= 'NOT CLASSIFIED';
         for (@Groups) {
             if ( $labels{$_} ) {