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.
This commit is contained in:
Tom Callahan 2018-07-09 15:32:10 -04:00 committed by GitHub
parent de273651ae
commit 3428dc20a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 2 deletions

View File

@ -46,6 +46,12 @@ my %Group_Labels = (
'other' => 'NOT CLASSIFIED', 'other' => 'NOT CLASSIFIED',
); );
my %Area_Overrides = (
':ml' => 'Machine Learning',
':beats' => 'Beats Plugin',
':Docs' => 'Docs Infrastructure'
);
use JSON(); use JSON();
use Encode qw(encode_utf8); use Encode qw(encode_utf8);
@ -175,8 +181,14 @@ ISSUE:
# uncomment for including/excluding PRs already issued in other versions # uncomment for including/excluding PRs already issued in other versions
# next if grep {$_->{name}=~/^v2/} @{$issue->{labels}}; # next if grep {$_->{name}=~/^v2/} @{$issue->{labels}};
my %labels = map { $_->{name} => 1 } @{ $issue->{labels} }; my %labels = map { $_->{name} => 1 } @{ $issue->{labels} };
my ($header) = map { m{:[^/]+/(.+)} && $1 } my @area_labels = grep {/^:/} sort keys %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'; $header ||= 'NOT CLASSIFIED';
for (@Groups) { for (@Groups) {
if ( $labels{$_} ) { if ( $labels{$_} ) {