kou commented on code in PR #14396:
URL: https://github.com/apache/arrow/pull/14396#discussion_r997521213
##########
dev/archery/archery/crossbow/core.py:
##########
@@ -791,8 +793,39 @@ def from_repo(cls, repo, head=None, branch=None,
remote=None, version=None,
if email is None:
email = repo.user_email
+ version_dev_match = re.match(r".*\.dev(\d+)$", version)
+ if version_dev_match:
+ with open(f"{repo.path}/r/DESCRIPTION") as description_file:
+ description = description_file.read()
+ r_version_pattern = re.compile(r"^Version:\s*(.*)$",
+ re.MULTILINE)
+ r_version = re.findall(r_version_pattern, description)[0]
+ if r_version:
+ version_dev = int(version_dev_match[1])
+ # "1_0000_00_00 +" is for generating a greater version
+ # than YYYYMMDD. For example, 1_0000_00_01
+ # (version_dev == 1 case) is greater than 2022_10_16.
+ #
+ # Why do we need a greater version than YYYYMMDD? It's
+ # for keeping backward compatibility. We used
+ # MAJOR.MINOR.PATCH.YYYYMMDD as our nightly package
+ # version. (See also ARROW-16403). If we use "9000 +
+ # version_dev" here, a developer that used
+ # 9.0.0.20221016 can't upgrade to the later nightly
+ # package unless we release 10.0.0. Because 9.0.0.9234
+ # or something is less than 9.0.0.20221016.
+ r_version_dev = 1_0000_00_00 + version_dev
+ # version: 10.0.0.dev234
+ # r_version: 9.0.0.9000
+ # -> 9.0.0.100000234
+ r_version = re.sub(r"\.9000\Z", f".{r_version_dev}", r_version)
Review Comment:
> This version is only used for nightly builds (which are uploaded to
nightlies.a.o) and for crossbow jobs triggered manually right?
Right.
> Is there a reason we need to move to the "dev version" numbering or could
we just use `datetime` to stick with the existing YYYYMMDD numbering?
1. Consistency:
* Other our nightly packages use the "dev version":
* PyArrow wheels: https://gemfury.com/arrow-nightlies/python:pyarrow
* Conda (Apache Arrow C++/R and PyArrow):
https://anaconda.org/arrow-nightlies/repo
2. To identify the exact commit:
* If we have multiple Apache Arrow R related commits (including Apache
Arrow C++ related commits) in a day, we need to extra work to identify the
commit of a nightly package with `YYYYMMDD` version.
* If we use the "dev version", we can identify the commit of a nightly
package without extra work.
--
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]