Skip to content

Commit

Permalink
Improve release notes script (#31833)
Browse files Browse the repository at this point in the history
Improve release notes script

The current release notes script does not handle area labels that
are not two parts, such as ":ml".  As these area labels are rare,
I have simply hard-coded a title for these area labels.  In
addition, the script will not explicitly call out instances where
multiple area labels are present on an issue.
  • Loading branch information
tomcallahan authored and colings86 committed Oct 26, 2018
1 parent 133ac01 commit 488e0fd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions dev-tools/es_release_notes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
'other' => 'NOT CLASSIFIED',
);

my %Area_Overrides = (
':ml' => 'Machine Learning',
':beats' => 'Beats Plugin',
':Docs' => 'Docs Infrastructure'
);

use JSON();
use Encode qw(encode_utf8);

Expand Down Expand Up @@ -175,8 +181,14 @@ sub fetch_issues {
# 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 { m{:([^/]+/)?(.+)} && $2 }
grep {/^:/} sort keys %labels;
my @area_labels = grep {/^:/} sort keys %labels;
my ($header) = map { m{:[^/]+/(.+)} && $1 } @area_labels;
if (scalar @area_labels > 1) {
$header = "MULTIPLE AREA LABELS";
}
if (scalar @area_labels == 1 && exists $Area_Overrides{$area_labels[0]}) {
$header = $Area_Overrides{$area_labels[0]};
}
$header ||= 'NOT CLASSIFIED';
for (@Groups) {
if ( $labels{$_} ) {
Expand Down

0 comments on commit 488e0fd

Please sign in to comment.