Repository: trafficserver Updated Branches: refs/heads/master d50a3cba0 -> 4594083c9
Auto-generate CHANGELOG file Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4594083c Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4594083c Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4594083c Branch: refs/heads/master Commit: 4594083c9e4713b8247049023c223d1ed5889897 Parents: d50a3cb Author: Phil Sorber <[email protected]> Authored: Tue Jun 30 14:33:13 2015 -0600 Committer: Phil Sorber <[email protected]> Committed: Tue Jun 30 14:41:03 2015 -0600 ---------------------------------------------------------------------- Makefile.am | 7 +++-- changelog.pl | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4594083c/Makefile.am ---------------------------------------------------------------------- diff --git a/Makefile.am b/Makefile.am index f388e60..569ff3a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,6 +53,10 @@ distclean-local: doxygen: @cd doc && $(MAKE) $(AM_MAKEFLAGS) $@ +gen-changelog: + ./changelog.pl $(VERSION) > CHANGELOG-$(VERSION) + git add CHANGELOG-$(VERSION) && git commit -m "Adding CHANGELOG-$(VERSION)" + asf-dist: asf-distdir tardir=$(distdir) && $(am__tar) --mtime=./configure.ac | bzip2 -9 -c >$(distdir).tar.bz2 @$(am__remove_distdir) @@ -61,7 +65,7 @@ asf-dist-rc: asf-distdir tardir=$(distdir) && $(am__tar) --mtime=./configure.ac | bzip2 -9 -c >$(distdir)-rc$(RC).tar.bz2 @$(am__remove_distdir) -asf-distdir: +asf-distdir: gen-changelog @$(am__remove_distdir) test -d .git && git clone . $(distdir) cd $(distdir) && git submodule update --init && autoreconf -i @@ -122,4 +126,3 @@ help: echo 'install install by copying the built files to system-wide dirs' && \ echo 'install-strip same as install but then strips debugging symbols' && \ echo 'install-examples install examples by copying the built files to system-wide dirs' - http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4594083c/changelog.pl ---------------------------------------------------------------------- diff --git a/changelog.pl b/changelog.pl new file mode 100755 index 0000000..c3d0173 --- /dev/null +++ b/changelog.pl @@ -0,0 +1,92 @@ +#!/usr/bin/perl +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +use strict; +use warnings; + +use WWW::Curl::Easy; +use JSON; + +my $fixversion = shift; +my $url = "https://issues.apache.org/jira"; +my $jql = "project = TS AND status in (Resolved, Closed) AND fixVersion = $fixversion ORDER BY key ASC"; + +sub jira_search +{ + my $url = shift; + my $jql = shift; + my $index = shift; + my $endpoint = "/rest/api/2/search"; + + my $query = { + jql => $jql, + startAt => $index, + fields => [ + "summary", + "issuetype" + ] + }; + + my $req_body = to_json($query); + my $resp_body; + my $curl = WWW::Curl::Easy->new; + + $curl->setopt(CURLOPT_POST, 1); + $curl->setopt(CURLOPT_POSTFIELDS, $req_body); + $curl->setopt(CURLOPT_HTTPHEADER, ['Content-Type: application/json']); + $curl->setopt(CURLOPT_WRITEDATA, \$resp_body); + $curl->setopt(CURLOPT_URL, $url . $endpoint); + my $retcode = $curl->perform(); + if ($retcode == 0) { + my $response_code = $curl->getinfo(CURLINFO_HTTP_CODE); + return from_json($resp_body); + } + + undef; +} + +my $count = 0; +my $changelog; +my $issues; + +do +{ + $issues = jira_search($url, $jql, $count); + + foreach my $issue (@{ $issues->{issues} }) + { + if (defined($issue)) + { + push @{ $changelog->{$issue->{fields}{issuetype}{name}} }, {key => $issue->{key}, summary => $issue->{fields}{summary}}; + $count++; + } + } +} +while ($count < $issues->{total}); + +print " -*- coding: utf-8 -*-\n\n"; +print "Changes with Apache Traffic Server $fixversion\n"; + +foreach my $key (sort keys %{ $changelog }) +{ + print "\n$key:\n\n"; + foreach my $issue (@{ $changelog->{$key} }) + { + print " *) [$issue->{key}] $issue->{summary}\n\n"; + } +}
