Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
351e550
Initial script
thisisnic Jan 20, 2022
dad218b
Get argv numbers right
thisisnic Jan 20, 2022
5d608cc
Add line to prep script to source versions script
thisisnic Jan 20, 2022
2bea442
add git add
thisisnic Jan 20, 2022
906b355
Add some updates to test
thisisnic Jan 21, 2022
18bf6c2
Add code to extract updated URL R
thisisnic Jan 21, 2022
b92a78c
Remove extra code
thisisnic Jan 21, 2022
310be18
Add tests for the main docs version update
thisisnic Jan 21, 2022
c2ca8a2
Add dev version in main docs
thisisnic Jan 21, 2022
10af3ec
Ruby test nudging
thisisnic Jan 21, 2022
8cd73e2
Missing comma
thisisnic Jan 21, 2022
3bbabbc
Missing 9000
thisisnic Jan 21, 2022
e3a705f
Fix r versions hunks
thisisnic Jan 21, 2022
30ad000
Add brackets
thisisnic Jan 21, 2022
94f57a3
syntax
thisisnic Jan 21, 2022
628dd42
reorg spacing
thisisnic Jan 22, 2022
89b1c8e
Only look at minor not patch
thisisnic Jan 22, 2022
8cfb97d
missing @
thisisnic Jan 22, 2022
07872bf
remove redundant block
thisisnic Jan 22, 2022
be56cbd
yup
thisisnic Jan 22, 2022
0a38ed5
Add newline to file
thisisnic Jan 22, 2022
bf3230c
Add newline at end of file
thisisnic Jan 26, 2022
33a6f7a
Remove extraneous line
thisisnic Jan 26, 2022
0b5772b
Update test
thisisnic Jan 26, 2022
e9d989d
Add newline at end of Python versions file
thisisnic Jan 26, 2022
5ef27e9
Rename minor -> compatible
thisisnic Feb 2, 2022
fdec477
Only run when it's a release
thisisnic Feb 2, 2022
ba7c432
Move script
thisisnic Feb 2, 2022
96d3edf
linter
thisisnic Feb 2, 2022
4076b9e
typo
thisisnic Feb 2, 2022
18a77cf
extra brackets
thisisnic Feb 2, 2022
5f9a84d
Remove extra parens
thisisnic Feb 2, 2022
3e96af8
typo
thisisnic Feb 2, 2022
9641b9f
remove extras
thisisnic Feb 2, 2022
ca195b2
Add missing bit
thisisnic Feb 2, 2022
5a5cc3e
bracket
thisisnic Feb 2, 2022
d852cda
Add missing changes back in
thisisnic Feb 2, 2022
0f447f0
remove line
thisisnic Feb 2, 2022
8f0c375
Add back in
thisisnic Feb 2, 2022
54d0a8d
Fix wrong variable
kou Feb 3, 2022
abd0c5e
Add missing trailing /
kou Feb 3, 2022
2cd9f4b
Add dev version
kou Feb 3, 2022
fb4e32b
Fix versions.json generation
kou Feb 3, 2022
49887eb
Use "utils" and "-" to follow naming convention
kou Feb 3, 2022
6d61478
Add dev/release/**/*.py to lint targets
kou Feb 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dev/archery/archery/utils/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ def python_linter(src, fix=False):
"python/pyarrow/**/*.pxd",
"python/pyarrow/**/*.pxi",
"python/examples/**/*.py",
"dev/archery/**/*.py"]
"dev/archery/**/*.py",
"dev/release/**/*.py"]
files = [setup_py]
for pattern in patterns:
files += list(map(str, Path(src.path).glob(pattern)))
Expand Down
29 changes: 29 additions & 0 deletions dev/release/01-prepare-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,21 @@ def test_version_pre_tag
"+ url \"https://www.apache.org/dyn/closer.lua?path=arrow/arrow-#{@release_version}/apache-arrow-#{@release_version}.tar.gz\""],
],
},
{
path: "docs/source/_static/versions.json",
hunks: [
[
"- \"name\": \"#{@release_compatible_version} (dev)\",",
"+ \"name\": \"#{@next_compatible_version} (dev)\",",
"- \"name\": \"#{@previous_compatible_version} (stable)\",",
"+ \"name\": \"#{@release_compatible_version} (stable)\",",
"+ {",
"+ \"name\": \"#{@previous_compatible_version}\",",
"+ \"version\": \"#{@previous_compatible_version}/\"",
"+ },",
]
]
},
{
path: "js/package.json",
hunks: [
Expand Down Expand Up @@ -225,6 +240,20 @@ def test_version_pre_tag
"+\# arrow #{@release_version}"],
],
},
{
path: "r/pkgdown/assets/versions.json",
hunks: [
[ "- \"name\": \"#{@previous_version}.9000 (dev)\",",
"+ \"name\": \"#{@release_version}.9000 (dev)\",",
"- \"name\": \"#{@previous_version} (release)\",",
"+ \"name\": \"#{@release_version} (release)\",",
"+ {",
"+ \"name\": \"#{@previous_version}\",",
"+ \"version\": \"#{@previous_compatible_version}/\"",
"+ },"
]
]
}
]

Dir.glob("java/**/pom.xml") do |path|
Expand Down
3 changes: 3 additions & 0 deletions dev/release/test-helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ def detect_versions
@snapshot_version = cpp_cmake_lists.read[/ARROW_VERSION "(.+?)"/, 1]
@snapshot_major_version = @snapshot_version.split(".")[0]
@release_version = @snapshot_version.gsub(/-SNAPSHOT\z/, "")
@release_compatible_version = @release_version.split(".")[0, 2].join(".")
@so_version = compute_so_version(@release_version)
@next_version = @release_version.gsub(/\A\d+/) {|major| major.succ}
@next_major_version = @next_version.split(".")[0]
@next_compatible_version = @next_version.split(".")[0, 2].join(".")
@next_snapshot_version = "#{@next_version}-SNAPSHOT"
@next_so_version = compute_so_version(@next_version)
r_description = top_dir + "r" + "DESCRIPTION"
@previous_version = r_description.read[/^Version: (.+?)\.9000$/, 1]
@previous_compatible_version = @previous_version.split(".")[0, 2].join(".")
end

def compute_so_version(version)
Expand Down
11 changes: 11 additions & 0 deletions dev/release/utils-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,15 @@ update_versions() {
find . -name "*.bak" -exec rm {} \;
git add .
popd

case ${type} in
release)
pushd "${ARROW_DIR}"
${PYTHON:-python3} "dev/release/utils-update-docs-versions.py" . "${version}" "${r_version}"
git add r/pkgdown/assets/versions.json
git add docs/source/_static/versions.json
popd
;;
esac

}
68 changes: 68 additions & 0 deletions dev/release/utils-update-docs-versions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# 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.

import json
import sys

dir_path = sys.argv[1]
version = sys.argv[2]
r_version = sys.argv[3]

main_versions_path = dir_path + "/docs/source/_static/versions.json"
r_versions_path = dir_path + "/r/pkgdown/assets/versions.json"

# Update main docs version script

with open(main_versions_path) as json_file:
old_versions = json.load(json_file)

split_version = version.split(".")
major_minor = split_version[0] + "." + split_version[1]
dev_version = str(int(split_version[0]) + 1) + ".0"
previous_major_minor = old_versions[1]["name"].split(" ")[0]

# Create new versions
new_versions = [
{'name': dev_version + " (dev)", 'version': 'dev/'},
{'name': major_minor + " (stable)", 'version': ''},
{'name': previous_major_minor, 'version': f'{previous_major_minor}/'},
*old_versions[2:],
]
with open(main_versions_path, 'w') as json_file:
json.dump(new_versions, json_file, indent=4)
json_file.write("\n")

# Update R package version script

with open(r_versions_path) as json_file:
old_r_versions = json.load(json_file)

# update release to oldrel
old_r_versions[1]["name"] = old_r_versions[1]["name"].split(" ")[0]
old_rel_split = old_r_versions[1]["name"].split(".")
old_r_versions[1]["version"] = old_rel_split[0] + "." + old_rel_split[1] + "/"

# update dev to release
old_r_versions[0]["name"] = r_version + " (release)"
old_r_versions[0]["version"] = ""

# add new dev version
new_r_version = [{'name': r_version + ".9000" + " (dev)", 'version': 'dev/'}]
new_r_version.extend(old_r_versions)
with open(r_versions_path, 'w') as json_file:
json.dump(new_r_version, json_file, indent=4)
json_file.write("\n")
6 changes: 5 additions & 1 deletion docs/source/_static/versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[
{
"name": "7.0 (dev)",
"version": "dev/"
},
{
"name": "6.0 (stable)",
"version": ""
Expand All @@ -23,4 +27,4 @@
"name": "1.0",
"version": "1.0/"
}
]
]