Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dev/release): decouple version numbers #1762

Merged
merged 19 commits into from
Apr 29, 2024
Merged

Conversation

lidavidm
Copy link
Member

Start refactoring our release process so that we can theoretically handle different version numbers in different language subprojects.

Fixes #1490.

Comment on lines 25 to 28
VERSION_GLIB="1.0.0"
VERSION_JAVA="0.12.0"
# Because C++/Go/Python are effectively tied at the hip, they share a single
# version number. Also covers Conda/Linux packages.
# TODO: untie this so that we can have independent version #s for different drivers (at least for Postgres/SQLite)
VERSION_NATIVE="1.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GLib/Ruby can also use VERSION_NATIVE.

@lidavidm
Copy link
Member Author

@lidavidm
Copy link
Member Author

  • Python used the wrong version number.
  • Need to validate what version number the Linux packages used.

@lidavidm
Copy link
Member Author

Linux packages look right, let's see about Python...

@lidavidm
Copy link
Member Author

It appears our milestone assigner should still work

lidavidm@debian ~/C/arrow-adbc (versioning)> printf "maint-2024.05\nmaint-0.11.0" | grep -o '[0-9.]*$' | sort --version-sort
0.11.0
2024.05

@lidavidm
Copy link
Member Author

@kou I did an initial pass over the release scripts...the main thing now will be having to bump all the versions by hand post-release but I think that's OK for now

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines 304 to 306
tar xf apache-arrow-adbc-${{ steps.info.outputs.VERSION }}.tar.gz

source ./apache-arrow-adbc-${{ steps.info.outputs.VERSION }}/dev/release/versions.env

mv apache-arrow-adbc-${{ steps.info.outputs.VERSION }} adbc
mv apache-arrow-adbc-${{ steps.info.outputs.VERSION }}.tar.gz adbc/ci/linux-packages/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not related to this PR but we can remove echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT" and always use ${VERSION} instead of ${{ steps.info.outputs.VERSION }}.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's see if I did that right...

mv apache-arrow-adbc-${{ steps.info.outputs.VERSION }} adbc
mv apache-arrow-adbc-${{ steps.info.outputs.VERSION }}.tar.gz adbc/ci/linux-packages/
# Need to align the file path with the version number (and not the release)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, we use apache-arrow-adbc-YYYY.MM tag after this PR?
(VERSION is YYYY.MM and VERSION_NATIVE is 1.0.0, right?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. Though I'm undecided if it should be MM or just a counter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, well, if we add the day below then it will be a date and that sounds good to me.

dev/release/utils-prepare.sh Outdated Show resolved Hide resolved

# The release as a whole has a date-based identifier. This is used to
# identify tags, branches, and so on.
RELEASE="2024.05"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to add date too. (e.g. 2024.05.29)
We may want to publish multiple versions in a month.

dev/release/03-source.sh Outdated Show resolved Hide resolved
mv apache-arrow-adbc-${{ steps.info.outputs.VERSION }}.tar.gz adbc/ci/linux-packages/
# Need to align the file path with the version number (and not the release)
cp -r adbc apache-arrow-adbc-${VERSION_NATIVE}
tar czf adbc/ci/linux-packages/apache-arrow-adbc-${VERSION_NATIVE}.tar.gz apache-arrow-adbc-${VERSION_NATIVE}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can update ci/linux-packages/ to use apache-arrow-adbc-${RELEASE}.tar.gz instead of apache-arrow-adbc-${VERSION_NATIVE}.tar.gz.
Should I do this in this branch or in a separated PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind if you want to push to this branch!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK! I'll push to this branch!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


# The release as a whole has a date-based identifier. This is used to
# identify tags, branches, and so on.
RELEASE="2024.05.06"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. It may be better that we omit preceding 0: 2024.5.6
This is not a semantic versioning but semver https://pypi.org/project/semver/ can't parse 2024.05.06 format:

>>> import semver
>>> semver.VersionInfo.parse('1.02.03')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/semver.py", line 656, in parse
    raise ValueError("%s is not valid SemVer string" % version)
ValueError: 1.02.03 is not valid SemVer string

(Sorry. The above transcript uses old semver, 2.10.2.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! I'll take another look this afternoon

What do you think of just using a counter in that case then? (2024.1, 2024.2, 2024.3)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of just using a counter in that case then? (2024.1, 2024.2, 2024.3)

It will work too!

It may be confused but we may be able to omit the 2024. part: 1, 2, 3

We need to choose the next identifier when we publish a new release. If we use date-based identifier, it may be difficult. For example, we want to publish a next release in this year but it may be slipped to the next year.

(Should we choose the next identifier when we publish the next release?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we can always adjust the identifier at publication time so it will be OK if we have to change it. We can always make the scripts a bit more flexible in that case too so we can update the version at any time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But yeah, in that case I think having the identifier just be 1, 2, 3, makes more sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose there might be a little confusion for our first release. But after that we will have release = 2, version number = 1.1.0/0.13.0 which should be OK.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I went with "12.0.0" since this will be our 12th release.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah...the version in the docs will look a little funny. I suppose that's OK for now. We can always label the docs with a date or something later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use "12" instead of "12.0.0" because we will always use ".0.0" for the part.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done

# specific language governing permissions and limitations
# under the License.

# The release as a whole has a date-based identifier. This is used to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the "date-based" part?

@lidavidm
Copy link
Member Author

It appears the Debian build is still having issues?

https://github.com/lidavidm/arrow-adbc/actions/runs/8842860533/job/24282183949

@kou
Copy link
Member

kou commented Apr 26, 2024

Hmm. "1.0.0" not "12.0.0" as the version:

https://github.com/lidavidm/arrow-adbc/actions/runs/8842860533/job/24282184256#step:9:2483

(expected one of apache-arrow-adbc_1.0.0.orig.tar.gz, apache-arrow-adbc_1.0.0.orig.tar.bz2,

I'll take a look at it.

dev/release/versions.env Outdated Show resolved Hide resolved
@kou
Copy link
Member

kou commented Apr 26, 2024

https://github.com/lidavidm/arrow-adbc/blob/ab50f798307221e854ac0611dece70e814e3cebe/.github/workflows/packaging.yml#L300-L302

This is related.
This workflow assumes that we update versions in ci/linux-packages/{debian/changelog,yum/apache-arrow-spec.in} before tagging.

@kou
Copy link
Member

kou commented Apr 26, 2024

@lidavidm
Copy link
Member Author

Hmm, I did run 01-prepare.sh. I'll try again.

@lidavidm
Copy link
Member Author

@lidavidm
Copy link
Member Author

Hmm, no luck.

@kou
Copy link
Member

kou commented Apr 26, 2024

It should be 12-1 not 1.0.0-1.

@lidavidm
Copy link
Member Author

Don't we want 1.0.0 as the actual version number of the package?

@kou
Copy link
Member

kou commented Apr 26, 2024

diff --git a/dev/release/utils-prepare.sh b/dev/release/utils-prepare.sh
index dbbc531e5..acd5b7732 100644
--- a/dev/release/utils-prepare.sh
+++ b/dev/release/utils-prepare.sh
@@ -23,6 +23,7 @@ update_versions() {
 
   local conda_version="${VERSION_NATIVE}"
   local csharp_version="${VERSION_CSHARP}"
+  local linux_version="${RELEASE}"
   local rust_version="${VERSION_CSHARP}"
   case ${type} in
     release)
@@ -30,7 +31,6 @@ update_versions() {
       local docs_version="${RELEASE}"
       local glib_version="${VERSION_NATIVE}"
       local java_version="${VERSION_JAVA}"
-      local linux_version="${VERSION_NATIVE}"
       local py_version="${VERSION_NATIVE}"
       local r_version="${VERSION_R}"
       ;;
@@ -39,7 +39,6 @@ update_versions() {
       local docs_version="${RELEASE} (dev)"
       local glib_version="${VERSION_NATIVE}-SNAPSHOT"
       local java_version="${VERSION_JAVA}-SNAPSHOT"
-      local linux_version="${VERSION_NATIVE}-SNAPSHOT"
       local py_version="${VERSION_NATIVE}dev"
       local r_version="${VERSION_R}.9000"
       ;;

@lidavidm
Copy link
Member Author

I'll give it a shot.

@lidavidm
Copy link
Member Author

@kou
Copy link
Member

kou commented Apr 26, 2024

Ah, we will use RELEASE as package version because .deb/.rpm use source archive's version (apache-arrow-adbc-${RELEASE}.tar.gz) as their package version.

@lidavidm
Copy link
Member Author

Ok, sounds good!

@lidavidm
Copy link
Member Author

Looks like it passed. That was quicker than I expected. Thanks for the help @kou!

02-sign.sh worked: https://github.com/lidavidm/arrow-adbc/releases/tag/apache-arrow-adbc-12-rc0

I just pushed some other fixes after grepping for uses of $version or ${version} that were left over.

I expect during the release I will have to adjust some things on the fly, but that's OK.

dev/release/utils-prepare.sh Outdated Show resolved Hide resolved
@lidavidm lidavidm merged commit 7402f9a into apache:main Apr 29, 2024
55 checks passed
@lidavidm lidavidm deleted the versioning branch April 29, 2024 02:14
cocoa-xu pushed a commit to meowcraft-dev/arrow-adbc that referenced this pull request May 8, 2024
Start refactoring our release process so that we can theoretically
handle different version numbers in different language subprojects.

Fixes apache#1490.

---------

Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: 1.0.0 libraries release (tracking issue)
2 participants