kou commented on a change in pull request #12212:
URL: https://github.com/apache/arrow/pull/12212#discussion_r797017363



##########
File path: dev/release/test-helper.rb
##########
@@ -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_minor_version = 
@release_version.split(".")[0]+"."+@release_version.split(".")[1]
     @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_minor_version = @next_major_version + "."+ 
@next_version.split(".")[1]

Review comment:
       ditto.

##########
File path: ci/scripts/util_update_docs_versions.py
##########
@@ -0,0 +1,71 @@
+# Licensed to the Apache Software Foundation (ASF) under one

Review comment:
       Why do you want to put this file under `ci/scripts/` not `dev/release/`?
   I think that this is only used for release. So `dev/release/` is suitable.

##########
File path: dev/release/utils-prepare.sh
##########
@@ -155,4 +155,10 @@ update_versions() {
   find . -name "*.bak" -exec rm {} \;
   git add .
   popd
+
+  pushd "${ARROW_DIR}"
+  python "./ci/scripts/util_update_docs_versions.py" . "${version}" 
"${r_version}"
+  git add r/pkgdown/assets/versions.json
+  git add docs/source/_static/versions.json
+  popd

Review comment:
       I think that we should only update `versions.json`s only when `${type}` 
is `release`.
   

##########
File path: dev/release/test-helper.rb
##########
@@ -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_minor_version = 
@release_version.split(".")[0]+"."+@release_version.split(".")[1]

Review comment:
       This is not a minor version. This is a "major + minor" version.
   How about (backward) "compatible" version?
   
   ```ruby
   @release_compatible_version = @release_version.split(".")[0, 2]).join(".")
   ```

##########
File path: dev/release/test-helper.rb
##########
@@ -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_minor_version = 
@release_version.split(".")[0]+"."+@release_version.split(".")[1]
     @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_minor_version = @next_major_version + "."+ 
@next_version.split(".")[1]
     @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_minor_version = 
@previous_version.split(".")[0]+"."+@previous_version.split(".")[1]

Review comment:
       ditto.

##########
File path: dev/release/utils-prepare.sh
##########
@@ -155,4 +155,10 @@ update_versions() {
   find . -name "*.bak" -exec rm {} \;
   git add .
   popd
+
+  pushd "${ARROW_DIR}"
+  python "./ci/scripts/util_update_docs_versions.py" . "${version}" 
"${r_version}"

Review comment:
       We should ensure using Python 3 not Python 2 because Python2's `json` 
puts a trailing space after comma: https://bugs.python.org/issue16333
   
   ```suggestion
     ${PYTHON:-python3} "./ci/scripts/util_update_docs_versions.py" . 
"${version}" "${r_version}"
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to