MCPcopy Create free account
hub / github.com/apache/arrow / test_vote

Method test_vote

dev/release/02-source-test.rb:78–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76 end
77
78 def test_vote
79 github_token = File.read(@env)[/^GH_TOKEN=(.*)$/, 1]
80 uri = URI.parse("https://api.github.com/graphql")
81 n_issues_query = {
82 "query" => <<-QUERY,
83 query {
84 search(query: "repo:apache/arrow is:issue is:closed milestone:#{@release_version}",
85 type: ISSUE) {
86 issueCount
87 }
88 }
89 QUERY
90 }
91 response = Net::HTTP.post(uri,
92 n_issues_query.to_json,
93 "Content-Type" => "application/json",
94 "Authorization" => "Bearer #{github_token}")
95 n_resolved_issues = JSON.parse(response.body)["data"]["search"]["issueCount"]
96 github_repository = ENV["GITHUB_REPOSITORY"] || "apache/arrow"
97 github_api_url = "https://api.github.com"
98 verify_prs = URI("#{github_api_url}/repos/#{github_repository}/pulls" +
99 "?state=open" +
100 "&head=apache:release-#{@release_version}-rc0")
101 verify_pr_url = nil
102 headers = {
103 "Accept" => "application/vnd.github+json",
104 }
105
106 if github_token
107 headers["Authorization"] = "Bearer #{github_token}"
108 end
109 verify_prs.open(headers) do |response|
110 verify_pr_url = (JSON.parse(response.read)[0] || {})["html_url"]
111 end
112 output = source("VOTE")
113 tarball_hash = Digest::SHA512.file("artifacts/#{@archive_name}").to_s
114 assert_equal(<<-VOTE.strip, output[/^-+$(.+?)^-+$/m, 1].strip)
115To: dev@arrow.apache.org
116Subject: [VOTE] Release Apache Arrow #{@release_version} - RC0
117
118Hi,
119
120I would like to propose the following release candidate (RC0) of Apache
121Arrow version #{@release_version}. This is a release consisting of #{n_resolved_issues}
122resolved GitHub issues[1].
123
124This release candidate is based on commit:
125#{@current_commit} [2]
126
127The source release rc0 is hosted at [3].
128The binary artifacts are hosted at [4][5][6][7][8][9].
129The changelog is located at [10].
130
131Please download, verify checksums and signatures, run the unit tests,
132and vote on the release. See [11] for the SHA-512 checksum for this RC and [12]
133for how to validate a release candidate.
134
135See also a verification result on GitHub pull request [13].

Callers

nothing calls this directly

Calls 5

readMethod · 0.45
parseMethod · 0.45
bodyMethod · 0.45
openMethod · 0.45
to_sMethod · 0.45

Tested by

no test coverage detected