From 88404b918044b335d8052c46e348c104526a3e08 Mon Sep 17 00:00:00 2001 From: Tom Callahan Date: Thu, 5 Jul 2018 12:10:45 -0400 Subject: [PATCH 1/2] 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 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/dev-tools/es_release_notes.pl b/dev-tools/es_release_notes.pl index 93a4ba74f643b..3e5c11e505aa9 100755 --- a/dev-tools/es_release_notes.pl +++ b/dev-tools/es_release_notes.pl @@ -32,7 +32,7 @@ ">enhancement", ">bug", ">regression", ">upgrade" ); my %Ignore = map { $_ => 1 } - ( ">non-issue", ">refactoring", ">docs", ">test", ">test-failure", ":Core/Build" ); + ( ">non-issue", ">refactoring", ">docs", ">test", ":Core/Build", ">test-failure" ); my %Group_Labels = ( '>breaking' => 'Breaking changes', @@ -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); @@ -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{:[^/]+/(.+)} && $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{$_} ) { From 0702ace2476b34a8d0762296b52d591e5901d8c1 Mon Sep 17 00:00:00 2001 From: Tom Callahan Date: Thu, 5 Jul 2018 13:04:08 -0400 Subject: [PATCH 2/2] remove unneeded change --- dev-tools/es_release_notes.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-tools/es_release_notes.pl b/dev-tools/es_release_notes.pl index 3e5c11e505aa9..4ea7e124598ec 100755 --- a/dev-tools/es_release_notes.pl +++ b/dev-tools/es_release_notes.pl @@ -32,7 +32,7 @@ ">enhancement", ">bug", ">regression", ">upgrade" ); my %Ignore = map { $_ => 1 } - ( ">non-issue", ">refactoring", ">docs", ">test", ":Core/Build", ">test-failure" ); + ( ">non-issue", ">refactoring", ">docs", ">test", ">test-failure", ":Core/Build" ); my %Group_Labels = ( '>breaking' => 'Breaking changes',