Fixed es_release_notes.pl script to work with the new github labels

It also now ignores docs, test, non-issue, refactoring, and build
This commit is contained in:
Clinton Gormley 2018-02-15 20:30:43 +01:00
parent d90a440bf7
commit f54cb567b6

View file

@ -28,24 +28,23 @@ my $User_Repo = 'elastic/elasticsearch/';
my $Issue_URL = "http://github.com/${User_Repo}issues/"; my $Issue_URL = "http://github.com/${User_Repo}issues/";
my @Groups = ( my @Groups = (
"breaking", "breaking-java", "deprecation", "feature", ">breaking", ">breaking-java", ">deprecation", ">feature",
"enhancement", "bug", "regression", "upgrade", "non-issue", "build", ">enhancement", ">bug", ">regression", ">upgrade"
"docs", "test"
); );
my %Ignore = map { $_ => 1 } (
">non-issue", ">refactoring", ">docs", ">test", ":Core/Build"
);
my %Group_Labels = ( my %Group_Labels = (
breaking => 'Breaking changes', '>breaking' => 'Breaking changes',
'breaking-java' => 'Breaking Java changes', '>breaking-java' => 'Breaking Java changes',
build => 'Build', '>deprecation' => 'Deprecations',
deprecation => 'Deprecations', '>feature' => 'New features',
docs => 'Docs', '>enhancement' => 'Enhancements',
feature => 'New features', '>bug' => 'Bug fixes',
enhancement => 'Enhancements', '>regression' => 'Regressions',
bug => 'Bug fixes', '>upgrade' => 'Upgrades',
regression => 'Regressions', 'other' => 'NOT CLASSIFIED',
test => 'Tests',
upgrade => 'Upgrades',
"non-issue" => 'Non-issue',
other => 'NOT CLASSIFIED',
); );
use JSON(); use JSON();
@ -86,7 +85,9 @@ ASCIIDOC
for my $group ( @Groups, 'other' ) { for my $group ( @Groups, 'other' ) {
my $group_issues = $issues->{$group} or next; my $group_issues = $issues->{$group} or next;
print "[[$group-$version]]\n" my $group_id = $group;
$group_id=~s/^>//;
print "[[$group_id-$version]]\n"
. "[float]\n" . "[float]\n"
. "=== $Group_Labels{$group}\n\n"; . "=== $Group_Labels{$group}\n\n";
@ -161,10 +162,14 @@ ISSUE:
for my $issue (@issues) { for my $issue (@issues) {
next if $seen{ $issue->{number} } && !$issue->{pull_request}; next if $seen{ $issue->{number} } && !$issue->{pull_request};
for (@{ $issue->{labels} }) {
next ISSUE if $Ignore{$_->{name}};
}
# 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 { substr( $_, 1 ) } grep {/^:/} sort keys %labels; my ($header) = map { /:.+\/(.+)/ && $1 } grep {/^:/} sort keys %labels;
$header ||= 'NOT CLASSIFIED'; $header ||= 'NOT CLASSIFIED';
for (@Groups) { for (@Groups) {
if ( $labels{$_} ) { if ( $labels{$_} ) {