Skip to content

Commit eeb6f3d

Browse files
koushiro615
authored andcommitted
ARROW-5939: [Release] Add support for generating vote email template separately
Author: Sutou Kouhei <[email protected]> Closes apache#4870 from kou/release-source-vote and squashes the following commits: b98b7388d <Sutou Kouhei> Add support for generating vote email template separately
1 parent 67beb1d commit eeb6f3d

File tree

3 files changed

+91
-33
lines changed

3 files changed

+91
-33
lines changed

dev/release/02-source-test.rb

+54-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
require "rexml/document"
19-
2018
class SourceTest < Test::Unit::TestCase
2119
include GitRunnable
2220
include VersionDetectable
@@ -42,13 +40,14 @@ def source(*targets)
4240
targets.each do |target|
4341
env["SOURCE_#{target}"] = "1"
4442
end
45-
sh(env, @script, @release_version, "0")
43+
output = sh(env, @script, @release_version, "0")
4644
sh("tar", "xf", "#{@tag_name}.tar.gz")
45+
output
4746
end
4847

4948
def test_symbolic_links
5049
source
51-
Dir.chdir("#{@tag_name}") do
50+
Dir.chdir(@tag_name) do
5251
assert_equal([],
5352
Find.find(".").find_all {|path| File.symlink?(path)})
5453
end
@@ -98,4 +97,55 @@ def test_python_version
9897
Dir.glob("dist/pyarrow-*.tar.gz"))
9998
end
10099
end
100+
101+
def test_vote
102+
jira_url = "https://issues.apache.org/jira"
103+
jql_conditions = [
104+
"project = ARROW",
105+
"status in (Resolved, Closed)",
106+
"fixVersion = #{@release_version}",
107+
]
108+
jql = jql_conditions.join(" AND ")
109+
n_resolved_issues = nil
110+
open("#{jira_url}/rest/api/2/search?jql=#{CGI.escape(jql)}") do |response|
111+
n_resolved_issues = JSON.parse(response.read)["total"]
112+
end
113+
output = source("VOTE")
114+
assert_equal(<<-VOTE.strip, output[/^-+$(.+?)^-+$/m, 1].strip)
115+
116+
Subject: [VOTE] Release Apache Arrow #{@release_version} - RC0
117+
118+
Hi,
119+
120+
I would like to propose the following release candidate (RC0) of Apache
121+
Arrow version #{@release_version}. This is a release consiting of #{n_resolved_issues}
122+
resolved JIRA issues[1].
123+
124+
This release candidate is based on commit:
125+
#{@current_commit} [2]
126+
127+
The source release rc0 is hosted at [3].
128+
The binary artifacts are hosted at [4][5][6][7].
129+
The changelog is located at [8].
130+
131+
Please download, verify checksums and signatures, run the unit tests,
132+
and vote on the release. See [9] for how to validate a release candidate.
133+
134+
The vote will be open for at least 72 hours.
135+
136+
[ ] +1 Release this as Apache Arrow #{@release_version}
137+
[ ] +0
138+
[ ] -1 Do not release this as Apache Arrow #{@release_version} because...
139+
140+
[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}
141+
[2]: https://github.com/apache/arrow/tree/#{@current_commit}
142+
[3]: https://dist.apache.org/repos/dist/dev/arrow/apache-arrow-#{@release_version}-rc0
143+
[4]: https://bintray.com/apache/arrow/centos-rc/#{@release_version}-rc0
144+
[5]: https://bintray.com/apache/arrow/debian-rc/#{@release_version}-rc0
145+
[6]: https://bintray.com/apache/arrow/python-rc/#{@release_version}-rc0
146+
[7]: https://bintray.com/apache/arrow/ubuntu-rc/#{@release_version}-rc0
147+
[8]: https://github.com/apache/arrow/blob/#{@current_commit}/CHANGELOG.md
148+
[9]: https://cwiki.apache.org/confluence/display/ARROW/How+to+Verify+Release+Candidates
149+
VOTE
150+
end
101151
end

dev/release/02-source.sh

+33-29
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
set -e
2222

2323
: ${SOURCE_DEFAULT:=1}
24-
: ${SOURCE_UPLOAD:=${SOURCE_DEFAULT}}
2524
: ${SOURCE_GLIB:=${SOURCE_DEFAULT}}
2625
: ${SOURCE_RAT:=${SOURCE_DEFAULT}}
26+
: ${SOURCE_UPLOAD:=${SOURCE_DEFAULT}}
27+
: ${SOURCE_VOTE:=${SOURCE_DEFAULT}}
2728

2829
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2930
SOURCE_TOP_DIR="$(cd "${SOURCE_DIR}/../../" && pwd)"
@@ -38,6 +39,7 @@ rc=$2
3839

3940
tag=apache-arrow-${version}
4041
tagrc=${tag}-rc${rc}
42+
rc_url="https://dist.apache.org/repos/dist/dev/arrow/${tagrc}"
4143

4244
echo "Preparing source for tag ${tag}"
4345

@@ -124,54 +126,56 @@ if [ ${SOURCE_UPLOAD} -gt 0 ]; then
124126
# clean up
125127
rm -rf tmp
126128

127-
rc_url="https://dist.apache.org/repos/dist/dev/arrow/${tagrc}"
128129
echo "Success! The release candidate is available here:"
129130
echo " ${rc_url}"
130131
echo ""
131132
echo "Commit SHA1: ${release_hash}"
132133
echo ""
134+
fi
135+
136+
if [ ${SOURCE_VOTE} -gt 0 ]; then
133137
echo "The following draft email has been created to send to the"
134138
echo "[email protected] mailing list"
135139
echo ""
136140
echo "---------------------------------------------------------"
137-
# jira_url="https://issues.apache.org/jira"
141+
jira_url="https://issues.apache.org/jira"
138142
jql="project%20%3D%20ARROW%20AND%20status%20in%20%28Resolved%2C%20Closed%29%20AND%20fixVersion%20%3D%20${version}"
139143
n_resolved_issues=$(curl "${jira_url}/rest/api/2/search/?jql=${jql}" | jq ".total")
140144
cat <<MAIL
141-
142-
Subject: [VOTE] Release Apache Arrow ${version} - RC${rc}
145+
146+
Subject: [VOTE] Release Apache Arrow ${version} - RC${rc}
143147
144-
Hi,
148+
Hi,
145149
146-
I would like to propose the following release candidate (RC${rc}) of Apache
147-
Arrow version ${version}. This is a release consiting of ${n_resolved_issues}
148-
resolved JIRA issues[1].
150+
I would like to propose the following release candidate (RC${rc}) of Apache
151+
Arrow version ${version}. This is a release consiting of ${n_resolved_issues}
152+
resolved JIRA issues[1].
149153
150-
This release candidate is based on commit:
151-
${release_hash} [2]
154+
This release candidate is based on commit:
155+
${release_hash} [2]
152156
153-
The source release rc${rc} is hosted at [3].
154-
The binary artifacts are hosted at [4][5][6][7].
155-
The changelog is located at [8].
157+
The source release rc${rc} is hosted at [3].
158+
The binary artifacts are hosted at [4][5][6][7].
159+
The changelog is located at [8].
156160
157-
Please download, verify checksums and signatures, run the unit tests,
158-
and vote on the release. See [9] for how to validate a release candidate.
161+
Please download, verify checksums and signatures, run the unit tests,
162+
and vote on the release. See [9] for how to validate a release candidate.
159163
160-
The vote will be open for at least 72 hours.
164+
The vote will be open for at least 72 hours.
161165
162-
[ ] +1 Release this as Apache Arrow ${version}
163-
[ ] +0
164-
[ ] -1 Do not release this as Apache Arrow ${version} because...
166+
[ ] +1 Release this as Apache Arrow ${version}
167+
[ ] +0
168+
[ ] -1 Do not release this as Apache Arrow ${version} because...
165169
166-
[1]: ${jira_url}/issues/?jql=${jql}
167-
[2]: https://github.com/apache/arrow/tree/${release_hash}
168-
[3]: ${rc_url}
169-
[4]: https://bintray.com/apache/arrow/centos-rc/${version}-rc${rc}
170-
[5]: https://bintray.com/apache/arrow/debian-rc/${version}-rc${rc}
171-
[6]: https://bintray.com/apache/arrow/python-rc/${version}-rc${rc}
172-
[7]: https://bintray.com/apache/arrow/ubuntu-rc/${version}-rc${rc}
173-
[8]: https://github.com/apache/arrow/blob/${release_hash}/CHANGELOG.md
174-
[9]: https://cwiki.apache.org/confluence/display/ARROW/How+to+Verify+Release+Candidates
170+
[1]: ${jira_url}/issues/?jql=${jql}
171+
[2]: https://github.com/apache/arrow/tree/${release_hash}
172+
[3]: ${rc_url}
173+
[4]: https://bintray.com/apache/arrow/centos-rc/${version}-rc${rc}
174+
[5]: https://bintray.com/apache/arrow/debian-rc/${version}-rc${rc}
175+
[6]: https://bintray.com/apache/arrow/python-rc/${version}-rc${rc}
176+
[7]: https://bintray.com/apache/arrow/ubuntu-rc/${version}-rc${rc}
177+
[8]: https://github.com/apache/arrow/blob/${release_hash}/CHANGELOG.md
178+
[9]: https://cwiki.apache.org/confluence/display/ARROW/How+to+Verify+Release+Candidates
175179
MAIL
176180
echo "---------------------------------------------------------"
177181
fi

dev/release/test-helper.rb

+4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
# under the License.
1717

1818
require "English"
19+
require "cgi/util"
1920
require "find"
21+
require "json"
22+
require "open-uri"
23+
require "rexml/document"
2024
require "tempfile"
2125
require "tmpdir"
2226

0 commit comments

Comments
 (0)