Apache DataFusion SQL Query Engine
ARROW-5939: [Release] Add support for generating vote email template separately
Sutou Kouhei00600ca3f211
diff --git a/dev/release/02-source-test.rb b/dev/release/02-source-test.rbindex cf3c887a1c..ac911cd1e3 100644--- a/dev/release/02-source-test.rb+++ b/dev/release/02-source-test.rb@@ -15,8 +15,6 @@# specific language governing permissions and limitations# under the License.-require "rexml/document"-class SourceTest < Test::Unit::TestCaseinclude GitRunnableinclude VersionDetectable@@ -42,13 +40,14 @@ class SourceTest < Test::Unit::TestCasetargets.each do |target|env["SOURCE_#{target}"] = "1"end- sh(env, @script, @release_version, "0")+ output = sh(env, @script, @release_version, "0")sh("tar", "xf", "#{@tag_name}.tar.gz")+ outputenddef test_symbolic_linkssource- Dir.chdir("#{@tag_name}") do+ Dir.chdir(@tag_name) doassert_equal([],Find.find(".").find_all {|path| File.symlink?(path)})end@@ -98,4 +97,55 @@ class SourceTest < Test::Unit::TestCaseDir.glob("dist/pyarrow-*.tar.gz"))endend++ def test_vote+ jira_url = "https://issues.apache.org/jira"+ jql_conditions = [+ "project = ARROW",+ "status in (Resolved, Closed)",+ "fixVersion = #{@release_version}",+ ]+ jql = jql_conditions.join(" AND ")+ n_resolved_issues = nil+ open("#{jira_url}/rest/api/2/search?jql=#{CGI.escape(jql)}") do |response|+ n_resolved_issues = JSON.parse(response.read)["total"]+ end+ output = source("VOTE")+ assert_equal(<<-VOTE.strip, output[/^-+$(.+?)^-+$/m, 1].strip)+To: [email protected]+Subject: [VOTE] Release Apache Arrow #{@release_version} - RC0++Hi,++I would like to propose the following release candidate (RC0) of Apache+Arrow version #{@release_version}. This is a release consiting of #{n_resolved_issues}+resolved JIRA issues[1].++This release candidate is based on commit:+#{@current_commit} [2]++The source release rc0 is hosted at [3].+The binary artifacts are hosted at [4][5][6][7].+The changelog is located at [8].++Please download, verify checksums and signatures, run the unit tests,+and vote on the release. See [9] for how to validate a release candidate.++The vote will be open for at least 72 hours.++[ ] +1 Release this as Apache Arrow #{@release_version}+[ ] +0+[ ] -1 Do not release this as Apache Arrow #{@release_version} because...++[1]: https://issues.apache.org/jira/issues/?jql=project%20%3D%20ARROW%20AND%20status%20in%20%28Resolved%2C%20Closed%29%20AND%20fixVersion%20%3D%20#{@release_version}+[2]: https://github.com/apache/arrow/tree/#{@current_commit}+[3]: https://dist.apache.org/repos/dist/dev/arrow/apache-arrow-#{@release_version}-rc0+[4]: https://bintray.com/apache/arrow/centos-rc/#{@release_version}-rc0+[5]: https://bintray.com/apache/arrow/debian-rc/#{@release_version}-rc0+[6]: https://bintray.com/apache/arrow/python-rc/#{@release_version}-rc0+[7]: https://bintray.com/apache/arrow/ubuntu-rc/#{@release_version}-rc0+[8]: https://github.com/apache/arrow/blob/#{@current_commit}/CHANGELOG.md+[9]: https://cwiki.apache.org/confluence/display/ARROW/How+to+Verify+Release+Candidates+ VOTE+ endenddiff --git a/dev/release/02-source.sh b/dev/release/02-source.shindex ca192a8be9..f70503a9f5 100755--- a/dev/release/02-source.sh+++ b/dev/release/02-source.sh@@ -21,9 +21,10 @@set -e: ${SOURCE_DEFAULT:=1}-: ${SOURCE_UPLOAD:=${SOURCE_DEFAULT}}: ${SOURCE_GLIB:=${SOURCE_DEFAULT}}: ${SOURCE_RAT:=${SOURCE_DEFAULT}}+: ${SOURCE_UPLOAD:=${SOURCE_DEFAULT}}+: ${SOURCE_VOTE:=${SOURCE_DEFAULT}}SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"SOURCE_TOP_DIR="$(cd "${SOURCE_DIR}/../../" && pwd)"@@ -38,6 +39,7 @@ rc=$2tag=apache-arrow-${version}tagrc=${tag}-rc${rc}+rc_url="https://dist.apache.org/repos/dist/dev/arrow/${tagrc}"echo "Preparing source for tag ${tag}"@@ -124,54 +126,56 @@ if [ ${SOURCE_UPLOAD} -gt 0 ]; then# clean uprm -rf tmp- rc_url="https://dist.apache.org/repos/dist/dev/arrow/${tagrc}"echo "Success! The release candidate is available here:"echo " ${rc_url}"echo ""echo "Commit SHA1: ${release_hash}"echo ""+fi++if [ ${SOURCE_VOTE} -gt 0 ]; thenecho "The following draft email has been created to send to the"echo "[email protected] mailing list"echo ""echo "---------------------------------------------------------"- # jira_url="https://issues.apache.org/jira"+ jira_url="https://issues.apache.org/jira"jql="project%20%3D%20ARROW%20AND%20status%20in%20%28Resolved%2C%20Closed%29%20AND%20fixVersion%20%3D%20${version}"n_resolved_issues=$(curl "${jira_url}/rest/api/2/search/?jql=${jql}" | jq ".total")cat <<MAIL- To: [email protected]- Subject: [VOTE] Release Apache Arrow ${version} - RC${rc}+To: [email protected]+Subject: [VOTE] Release Apache Arrow ${version} - RC${rc}- Hi,+Hi,- I would like to propose the following release candidate (RC${rc}) of Apache- Arrow version ${version}. This is a release consiting of ${n_resolved_issues}- resolved JIRA issues[1].+I would like to propose the following release candidate (RC${rc}) of Apache+Arrow version ${version}. This is a release consiting of ${n_resolved_issues}+resolved JIRA issues[1].- This release candidate is based on commit:- ${release_hash} [2]+This release candidate is based on commit:+${release_hash} [2]- The source release rc${rc} is hosted at [3].- The binary artifacts are hosted at [4][5][6][7].- The changelog is located at [8].+The source release rc${rc} is hosted at [3].+The binary artifacts are hosted at [4][5][6][7].+The changelog is located at [8].- Please download, verify checksums and signatures, run the unit tests,- and vote on the release. See [9] for how to validate a release candidate.+Please download, verify checksums and signatures, run the unit tests,+and vote on the release. See [9] for how to validate a release candidate.- The vote will be open for at least 72 hours.+The vote will be open for at least 72 hours.- [ ] +1 Release this as Apache Arrow ${version}- [ ] +0- [ ] -1 Do not release this as Apache Arrow ${version} because...+[ ] +1 Release this as Apache Arrow ${version}+[ ] +0+[ ] -1 Do not release this as Apache Arrow ${version} because...- [1]: ${jira_url}/issues/?jql=${jql}- [2]: https://github.com/apache/arrow/tree/${release_hash}- [3]: ${rc_url}- [4]: https://bintray.com/apache/arrow/centos-rc/${version}-rc${rc}- [5]: https://bintray.com/apache/arrow/debian-rc/${version}-rc${rc}- [6]: https://bintray.com/apache/arrow/python-rc/${version}-rc${rc}- [7]: https://bintray.com/apache/arrow/ubuntu-rc/${version}-rc${rc}- [8]: https://github.com/apache/arrow/blob/${release_hash}/CHANGELOG.md- [9]: https://cwiki.apache.org/confluence/display/ARROW/How+to+Verify+Release+Candidates+[1]: ${jira_url}/issues/?jql=${jql}+[2]: https://github.com/apache/arrow/tree/${release_hash}+[3]: ${rc_url}+[4]: https://bintray.com/apache/arrow/centos-rc/${version}-rc${rc}+[5]: https://bintray.com/apache/arrow/debian-rc/${version}-rc${rc}+[6]: https://bintray.com/apache/arrow/python-rc/${version}-rc${rc}+[7]: https://bintray.com/apache/arrow/ubuntu-rc/${version}-rc${rc}+[8]: https://github.com/apache/arrow/blob/${release_hash}/CHANGELOG.md+[9]: https://cwiki.apache.org/confluence/display/ARROW/How+to+Verify+Release+Candidatesecho "---------------------------------------------------------"fidiff --git a/dev/release/test-helper.rb b/dev/release/test-helper.rbindex 1dad54390c..567094402a 100644--- a/dev/release/test-helper.rb+++ b/dev/release/test-helper.rb@@ -16,7 +16,11 @@# under the License.require "English"+require "cgi/util"require "find"+require "json"+require "open-uri"+require "rexml/document"require "tempfile"require "tmpdir"