From 3428dc20a45695dbe52eb57f3fc8738f74a65cfc Mon Sep 17 00:00:00 2001 From: Tom Callahan Date: Mon, 9 Jul 2018 15:32:10 -0400 Subject: [PATCH] Improve release notes script (#31833) 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. --- dev-tools/es_release_notes.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dev-tools/es_release_notes.pl b/dev-tools/es_release_notes.pl index 93a4ba74f64..4ea7e124598 100755 --- a/dev-tools/es_release_notes.pl +++ b/dev-tools/es_release_notes.pl @@ -46,6 +46,12 @@ my %Group_Labels = ( 'other' => 'NOT CLASSIFIED', ); +my %Area_Overrides = ( + ':ml' => 'Machine Learning', + ':beats' => 'Beats Plugin', + ':Docs' => 'Docs Infrastructure' +); + use JSON(); use Encode qw(encode_utf8); @@ -175,8 +181,14 @@ ISSUE: # 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{:[^/]+/(.+)} && $1 } - 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{$_} ) {