Skip to content

Commit 7f56bb4

Browse files
tomcallahancolings86
authored andcommitted
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.
1 parent 2bcbc3d commit 7f56bb4

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

dev-tools/es_release_notes.pl

+14-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
'other' => 'NOT CLASSIFIED',
4747
);
4848

49+
my %Area_Overrides = (
50+
':ml' => 'Machine Learning',
51+
':beats' => 'Beats Plugin',
52+
':Docs' => 'Docs Infrastructure'
53+
);
54+
4955
use JSON();
5056
use Encode qw(encode_utf8);
5157

@@ -175,8 +181,14 @@ sub fetch_issues {
175181
# uncomment for including/excluding PRs already issued in other versions
176182
# next if grep {$_->{name}=~/^v2/} @{$issue->{labels}};
177183
my %labels = map { $_->{name} => 1 } @{ $issue->{labels} };
178-
my ($header) = map { m{:([^/]+/)?(.+)} && $2 }
179-
grep {/^:/} sort keys %labels;
184+
my @area_labels = grep {/^:/} sort keys %labels;
185+
my ($header) = map { m{:[^/]+/(.+)} && $1 } @area_labels;
186+
if (scalar @area_labels > 1) {
187+
$header = "MULTIPLE AREA LABELS";
188+
}
189+
if (scalar @area_labels == 1 && exists $Area_Overrides{$area_labels[0]}) {
190+
$header = $Area_Overrides{$area_labels[0]};
191+
}
180192
$header ||= 'NOT CLASSIFIED';
181193
for (@Groups) {
182194
if ( $labels{$_} ) {

0 commit comments

Comments
 (0)