You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by xu...@apache.org on 2024/10/15 06:08:16 UTC

(hudi-rs) branch main updated: docs: add step-by-step release guide (#66)

This is an automated email from the ASF dual-hosted git repository.

xushiyan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hudi-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new dfb28d0  docs: add step-by-step release guide (#66)
dfb28d0 is described below

commit dfb28d04dc5a88e210154fd529dd1f1c4f69b5e3
Author: Shiyan Xu <27...@users.noreply.github.com>
AuthorDate: Mon Oct 14 20:08:12 2024 -1000

    docs: add step-by-step release guide (#66)
---
 release/README.md               | 171 ++++++++++++++++++++++++++++++++++++++++
 release/bump_version_in_main.sh | 122 ++++++++++++++++++++++++++++
 2 files changed, 293 insertions(+)

diff --git a/release/README.md b/release/README.md
new file mode 100644
index 0000000..27c88db
--- /dev/null
+++ b/release/README.md
@@ -0,0 +1,171 @@
+<!--
+  ~ 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.
+-->
+
+# Release Guide
+
+## Start a tracking issue
+
+```markdown
+*This issue is for tracking tasks of releasing `hudi-rs` {version}.*
+
+## Tasks
+
+### Issues
+
+- [ ] All remaining issues in the [milestone](https://github.com/apache/hudi-rs/milestone/1) should be closed.
+
+> ![IMPORTANT]
+> Blockers to highlight
+
+- [ ] https://github.com/apache/hudi-rs/issues/41
+- [ ] https://github.com/apache/hudi-rs/issues/42
+
+### GitHub
+
+- [ ] Bump version
+- [ ] Push release tag
+
+### ASF
+
+- [ ] Create an ASF release
+- [ ] Upload artifacts to the SVN dist repo
+- [ ] Start VOTE in dev email list
+
+> ![IMPORTANT]
+> Proceed from here only after VOTE passes.
+
+### Official release
+
+- [ ] Push the release git tag
+- [ ] Publish artifacts to SVN RELEASE branch
+- [ ] Send `ANNOUNCE` email to dev and user email lists
+```
+
+## GitHub work
+
+> ![NOTE]
+> We adhere to [Semantic Versioning](https://semver.org/), and create a release branch for each major or minor release.
+
+### Bump version in main branch
+
+Execute the below script that creates a branch with the new version changes committed. Submit a PR using that.
+
+```shell
+./release/bump_version_in_main.sh
+```
+
+### Bump version in release branch
+
+For a major or minor release, create a release branch in the format of `release/[0-9]+.[0-9]+.x` matching the target
+release version. For example, if it's `0.2.0`, cut a branch named `release/0.2.x`, if it's `1.0.0`, cut a branch
+named `release/1.0.x`.
+
+For a patch release, don't cut a new branch, use its base release branch. For example, if it's `0.3.1`, cherry-pick
+fixes to `release/0.3.x`.
+
+Create and merge a PR to bump the major or minor version on the `main` branch. For example, if the current version
+is `0.3.0`, bump it to `0.4.0` or `1.0.0`.
+
+On the release branch, bump the version to indicate pre-release by pushing a commit.
+
+- If it is meant for internal testing, go with `alpha.1`, `alpha.2`, etc
+- If it is meant for public testing, go with `beta.1`, `beta.2`, etc
+- If it is ready for voting, go with `rc.1`, `rc.2`, etc
+
+```shell
+cargo set-version 0.2.0-rc.1 --manifest-path crates/hudi/Cargo.toml
+```
+
+### Testing
+
+Once the "bump version" commit is pushed, CI will be triggered and all tests need to pass before proceed to the next.
+
+### Push tag
+
+> ![IMPORTANT]
+> The version in the code should be the target release version.
+
+Push a tag to the commit that matches to the version in the form of `release-*`. For example,
+
+- If the release is `0.1.0-rc.1`, the tag should `release-0.1.0-rc.1`
+- If the release is `2.0.0-beta.2`, the tag should `release-2.0.0-beta.2`
+
+> ![CAUTION]
+> Pushing a matching tag to the upstream (apache) branch will trigger CI to publish the artifacts to crates.io and
+> pypi.org, which, if successful, is irreversible. Same versions are not allowed to publish more than once.
+
+Once the CI completes, check crates.io and pypi.org for the new release artifacts.
+
+## ASF work
+
+### Upload source release
+
+Run the below script to create source release artifacts.
+
+```shell
+./release/create_src_release.sh
+```
+
+Upload source release artifacts to SVN (dev).
+
+```shell
+./release/upload_src_release_to_dev.sh
+```
+
+### Start a `[VOTE]` thread
+
+```text
+[VOTE] hudi-rs 0.1.0, release candidate #2
+
+Hi everyone,
+
+Please review and vote on hudi-rs 0.1.0-rc.2 as follows:
+
+[ ] +1, Approve the release
+[ ] -1, Do not approve the release (please provide specific comments)
+
+The complete staging area is available for you to review:
+
+* Release tracking issue is up-to-date [1]
+* Categorized changelog for this release [2]
+* Source release has been deployed to dist.apache.org [3]
+* Source release can be verified using this script [4]
+* Source code commit is tagged as "release-0.1.0-rc.2" [5]
+* Source code commit CI has passed [6]
+* Python artifacts have been published to pypi.org [7]
+* Rust artifacts have been published to crates.io [8]
+
+The vote will be open for at least 72 hours. It is adopted by majority
+approval, with at least 3 PMC affirmative votes.
+
+Thanks,
+Release Manager
+
+[1] https://github.com/apache/hudi-rs/issues/62
+[2] https://github.com/apache/hudi-rs/issues/62#issuecomment-2224322166
+[3] https://dist.apache.org/repos/dist/dev/hudi/hudi-rs-0.1.0-rc.2/
+[4] https://github.com/apache/hudi-rs/blob/7b2d199c180bf36e2fac5e03559fffbfe00bf5fe/release/verify_src_release.sh
+[5] https://github.com/apache/hudi-rs/releases/tag/release-0.1.0-rc.2
+[6] https://github.com/apache/hudi-rs/actions/runs/9901188924
+[7] https://pypi.org/project/hudi/0.1.0rc2/
+[8] https://crates.io/crates/hudi/0.1.0-rc.2
+```
+
+### After VOTE passes
+
diff --git a/release/bump_version_in_main.sh b/release/bump_version_in_main.sh
new file mode 100644
index 0000000..c99447d
--- /dev/null
+++ b/release/bump_version_in_main.sh
@@ -0,0 +1,122 @@
+#!/bin/bash
+#
+# 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.
+#
+
+bump_version() {
+    local current_version=$1
+    local bump_type=$2
+
+    IFS='.' read -ra version_parts <<< "$current_version"
+    local major=${version_parts[0]}
+    local minor=${version_parts[1]}
+    local patch=${version_parts[2]}
+
+    case $bump_type in
+        major)
+            major=$((major + 1))
+            minor=0
+            patch=0
+            ;;
+        minor)
+            minor=$((minor + 1))
+            patch=0
+            ;;
+        *)
+            echo "Error: Invalid bump type. Use 'major' or 'minor'."
+            exit 1
+            ;;
+    esac
+
+    echo "$major.$minor.$patch"
+}
+
+# Check if cargo-edit is installed
+if ! cargo set-version --version &> /dev/null; then
+    echo "Error: cargo-edit is not installed. Please install it with 'cargo install cargo-edit'."
+    exit 1
+fi
+
+# Check if current branch is main
+current_branch=$(git rev-parse --abbrev-ref HEAD)
+if [ "$current_branch" != "main" ]; then
+    echo "Error: Not on main branch. Please checkout the main branch before running this script."
+    exit 1
+fi
+
+# Define the crate to update
+crate="crates/hudi"
+
+# Prompt user for bump type
+read -p "Enter bump type (major/minor): " bump_type
+
+# Validate bump type
+if [[ "$bump_type" != "major" && "$bump_type" != "minor" ]]; then
+    echo "Error: Invalid bump type. Use 'major' or 'minor'."
+    exit 1
+fi
+
+# Get the current version
+current_version=$(cargo pkgid --manifest-path "$crate/Cargo.toml" | cut -d# -f2)
+
+if [ -z "$current_version" ]; then
+    echo "Error: Unable to find current version for $crate"
+    exit 1
+fi
+
+echo "Current version of $crate: $current_version"
+
+# Calculate new version
+new_version=$(bump_version "$current_version" "$bump_type")
+
+echo "New version for $crate: $new_version"
+
+# Update version using cargo set-version
+cargo set-version "$new_version" --manifest-path "$crate/Cargo.toml"
+
+if [ $? -ne 0 ]; then
+    echo "Error: Failed to update version for $crate"
+    exit 1
+fi
+
+echo "Updated version of $crate to $new_version"
+
+# Create a new branch
+branch_name="bump-$new_version"
+git checkout -b "$branch_name"
+
+if [ $? -ne 0 ]; then
+    echo "Error: Failed to create new branch $branch_name"
+    exit 1
+fi
+
+echo "Created new branch: $branch_name"
+
+# Commit the changes
+git add .
+commit_message="build(release): bump version to $new_version"
+git commit -m "$commit_message"
+
+if [ $? -ne 0 ]; then
+    echo "Error: Failed to commit changes"
+    exit 1
+fi
+
+echo "Changes committed with message: $commit_message"
+
+echo "Version bump complete. New branch '$branch_name' created with updated versions."