You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@hamilton.apache.org by "skrawcz (via GitHub)" <gi...@apache.org> on 2025/10/11 18:28:44 UTC
[PR] Adds script to help promote RC artifacts [hamilton]
skrawcz opened a new pull request, #1408:
URL: https://github.com/apache/hamilton/pull/1408
This should only move apache-hamilton* artifacts.
## Changes
- adds to scripts
## How I tested this
- did release with it
## Notes
## Checklist
- [ ] PR has an informative and human-readable title (this will be pulled into the release notes)
- [ ] Changes are limited to a single goal (no scope creep)
- [ ] Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
- [ ] Any _change_ in functionality is tested
- [ ] New functions are documented (with a description, list of inputs, and expected output)
- [ ] Placeholder code is flagged / future TODOs are captured in comments
- [ ] Project documentation has been updated if adding/changing functionality.
--
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: notifications-unsubscribe@hamilton.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Adds script to help promote RC artifacts & modifies packages for future source releases [hamilton]
Posted by "zilto (via GitHub)" <gi...@apache.org>.
zilto commented on code in PR #1408:
URL: https://github.com/apache/hamilton/pull/1408#discussion_r2444880386
##########
scripts/apache_release_helper.py:
##########
@@ -139,10 +142,96 @@ def sign_artifacts(archive_name: str) -> Optional[list[str]]:
return files
+def _modify_wheel_for_apache_release(original_wheel: str, new_wheel_path: str):
+ """Helper to modify the wheel for apache release.
+
+ # Flit somehow builds something incorrectly.
+ # 1. change PKG-INFO's first line to be `Metadata-Version: 2.4`
+ # 2. make sure the second line is `Name: apache-hamilton`
+ # 3. remove the `Import-Name: hamilton` line from PKG-INFO.
+
+ :param original_wheel: Path to the original wheel.
+ :param new_wheel_path: Path to the new wheel to create.
+ """
+ with tempfile.TemporaryDirectory() as tmpdir:
+ # Unzip the wheel
+ with zipfile.ZipFile(original_wheel, "r") as zip_ref:
+ zip_ref.extractall(tmpdir)
+
+ # Find the .dist-info directory
+ dist_info_dirs = glob.glob(os.path.join(tmpdir, "*.dist-info"))
+ if not dist_info_dirs:
+ raise ValueError(f"Could not find .dist-info directory in {original_wheel}")
+ dist_info_dir = dist_info_dirs[0]
+ pkg_info = os.path.join(dist_info_dir, "PKG-INFO")
+
+ _modify_pkg_info_file(pkg_info)
+
+ # Create the new wheel
+ with zipfile.ZipFile(new_wheel_path, "w", zipfile.ZIP_DEFLATED) as zip_ref:
+ for root, _, files in os.walk(tmpdir):
+ for file in files:
+ zip_ref.write(
+ os.path.join(root, file), os.path.relpath(os.path.join(root, file), tmpdir)
+ )
+
+
+def _modify_pkg_info_file(pkg_info_path: str):
+ """
+ Flit somehow builds something incorrectly.
+ 1. change PKG-INFO's first line to be `Metadata-Version: 2.4`
+ 2. make sure the second line is `Name: apache-hamilton`
+ 3. remove the `Import-Name: hamilton` line from PKG-INFO.
+ """
+ with open(pkg_info_path, "r") as f:
+ lines = f.readlines()
+
+ new_lines = []
+ for i, line in enumerate(lines):
+ if i == 0:
+ new_lines.append("Metadata-Version: 2.4\n")
+ elif i == 1:
+ new_lines.append("Name: apache-hamilton\n")
+ elif line.strip() == "Import-Name: hamilton":
+ continue # Skip this line
+ else:
+ new_lines.append(line)
+
+ with open(pkg_info_path, "w") as f:
+ f.writelines(new_lines)
+
+
+def _modify_tarball_for_apache_release(original_tarball: str, new_tarball_path: str):
+ """Helper to modify the tarball for apache release.
+
+ # Flit somehow builds something incorrectly.
+ # 1. change PKG-INFO's first line to be `Metadata-Version: 2.4`
+ # 2. make sure the second line is `Name: apache-hamilton`
+ # 3. remove the `Import-Name: hamilton` line from PKG-INFO.
+
+ :param original_tarball: Path to the original tarball.
+ :param new_tarball_path: Path to the new tarball to create.
+ """
+ with tempfile.TemporaryDirectory() as tmpdir:
+ # Extract the tarball
+ with tarfile.open(original_tarball, "r:gz") as tar:
+ tar.extractall(path=tmpdir)
+
+ # Modify the PKG-INFO file
+ # The extracted tarball has a single directory inside.
+ extracted_dir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
+ pkg_info_path = os.path.join(extracted_dir, "PKG-INFO")
+
+ _modify_pkg_info_file(pkg_info_path)
+
+ # Create the new tarball
+ with tarfile.open(new_tarball_path, "w:gz") as tar:
+ tar.add(extracted_dir, arcname=os.path.basename(extracted_dir))
+
+
def create_release_artifacts(version) -> list[str]:
"""Creates the source tarball, GPG signature, and checksums using `python -m build`."""
- print("Creating release artifacts with 'python -m build'...")
- files_to_upload = []
+ print("Creating release artifacts with 'flit build'...")
Review Comment:
should we remove the `print` and use `echo` in the `.sh` script instead?
##########
scripts/apache_release_helper.py:
##########
@@ -180,29 +268,23 @@ def create_release_artifacts(version) -> list[str]:
# copy the tarball to be apache-hamilton-{version.lower()}-incubating.tar.gz
new_tar_ball = f"dist/apache-hamilton-{version.lower()}-incubating.tar.gz"
- shutil.copy(tarball_path[0], new_tar_ball)
+ # shutil.copy(tarball_path[0], new_tar_ball)
Review Comment:
remove line
--
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: notifications-unsubscribe@hamilton.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Adds script to help promote RC artifacts & modifies packages for future source releases [hamilton]
Posted by "skrawcz (via GitHub)" <gi...@apache.org>.
skrawcz commented on code in PR #1408:
URL: https://github.com/apache/hamilton/pull/1408#discussion_r2464564657
##########
scripts/promote_rc.sh:
##########
@@ -0,0 +1,107 @@
+#!/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.
+
+# This script moves a release candidate from the dev repository to the release repository.
+
+set -e
+
+DRY_RUN=false
+POSITIONAL_ARGS=()
+
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ --dry-run)
+ DRY_RUN=true
+ shift # past argument
+ ;;
+ *)
+ POSITIONAL_ARGS+=("$1") # save positional arg
+ shift # past argument
+ ;;
+ esac
+done
+
+set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
+
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 [--dry-run] <version> <rc_num>"
+ echo "Example: $0 --dry-run 1.2.3 0"
+ exit 1
+fi
+
+VERSION=$1
+RC_NUM=$2
+PROJECT_SHORT_NAME="hamilton"
+
+# Source and destination URLs
+SOURCE_URL="https://dist.apache.org/repos/dist/dev/incubator/${PROJECT_SHORT_NAME}/${VERSION}-RC${RC_NUM}"
+DEST_URL="https://dist.apache.org/repos/dist/release/incubator/${PROJECT_SHORT_NAME}/${VERSION}"
+
+if [ "$DRY_RUN" = true ]; then
+ echo "Performing a dry run. No changes will be made."
+else
+ echo "This script will copy the release candidate from dev to release."
+ echo "Source: ${SOURCE_URL}"
+ echo "Destination: ${DEST_URL}"
+ echo " "
+
+ read -p "Are you sure you want to continue? (y/n) " -n 1 -r
+ echo
+ if [[ ! $REPLY =~ ^[Yy]$ ]]
+ then
+ echo "Aborting."
+ exit 1
+ fi
+fi
+
+# Create the release directory
+if [ "$DRY_RUN" = true ]; then
+ echo "DRY RUN: svn mkdir --parents -m \"Creating directory for Apache ${PROJECT_SHORT_NAME} ${VERSION}\" \"${DEST_URL}\""
+else
+ svn mkdir --parents -m "Creating directory for Apache ${PROJECT_SHORT_NAME} ${VERSION}" "${DEST_URL}"
+fi
+
+# Get the list of files in the source directory
+FILES=$(svn list "${SOURCE_URL}")
+
+for FILE in $FILES; do
+ if [[ "$FILE" == apache-hamilton* ]]; then
+ SOURCE_FILE_URL="${SOURCE_URL}/${FILE}"
+ DEST_FILE_URL="${DEST_URL}/${DEST_FILE_NAME}"
+
+ if [ "$DRY_RUN" = true ]; then
+ echo "DRY RUN: svn cp \"${SOURCE_FILE_URL}\" \"${DEST_FILE_URL}\" -m \"Promote Apache ${PROJECT_SHORT_NAME} ${VERSION}: ${DEST_FILE_NAME}\""
+ else
+ echo "Moving ${FILE} to ${DEST_FILE_URL}"
+ svn mv "${SOURCE_FILE_URL}" "${DEST_FILE_URL}" -m "Promote Apache ${PROJECT_SHORT_NAME} ${VERSION}: ${DEST_FILE_NAME}"
Review Comment:
```suggestion
svn cp "${SOURCE_FILE_URL}" "${DEST_FILE_URL}" -m "Promote Apache ${PROJECT_SHORT_NAME} ${VERSION}: ${DEST_FILE_NAME}"
```
--
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: notifications-unsubscribe@hamilton.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Adds script to help promote RC artifacts & modifies packages for future source releases [hamilton]
Posted by "skrawcz (via GitHub)" <gi...@apache.org>.
skrawcz commented on code in PR #1408:
URL: https://github.com/apache/hamilton/pull/1408#discussion_r2464563676
##########
scripts/promote_rc.sh:
##########
@@ -0,0 +1,107 @@
+#!/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.
+
+# This script moves a release candidate from the dev repository to the release repository.
+
+set -e
+
+DRY_RUN=false
+POSITIONAL_ARGS=()
+
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ --dry-run)
+ DRY_RUN=true
+ shift # past argument
+ ;;
+ *)
+ POSITIONAL_ARGS+=("$1") # save positional arg
+ shift # past argument
+ ;;
+ esac
+done
+
+set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
+
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 [--dry-run] <version> <rc_num>"
+ echo "Example: $0 --dry-run 1.2.3 0"
+ exit 1
+fi
+
+VERSION=$1
+RC_NUM=$2
+PROJECT_SHORT_NAME="hamilton"
+
+# Source and destination URLs
+SOURCE_URL="https://dist.apache.org/repos/dist/dev/incubator/${PROJECT_SHORT_NAME}/${VERSION}-RC${RC_NUM}"
+DEST_URL="https://dist.apache.org/repos/dist/release/incubator/${PROJECT_SHORT_NAME}/${VERSION}"
+
+if [ "$DRY_RUN" = true ]; then
+ echo "Performing a dry run. No changes will be made."
+else
+ echo "This script will copy the release candidate from dev to release."
+ echo "Source: ${SOURCE_URL}"
+ echo "Destination: ${DEST_URL}"
+ echo " "
+
+ read -p "Are you sure you want to continue? (y/n) " -n 1 -r
+ echo
+ if [[ ! $REPLY =~ ^[Yy]$ ]]
+ then
+ echo "Aborting."
+ exit 1
+ fi
+fi
+
+# Create the release directory
+if [ "$DRY_RUN" = true ]; then
+ echo "DRY RUN: svn mkdir --parents -m \"Creating directory for Apache ${PROJECT_SHORT_NAME} ${VERSION}\" \"${DEST_URL}\""
+else
+ svn mkdir --parents -m "Creating directory for Apache ${PROJECT_SHORT_NAME} ${VERSION}" "${DEST_URL}"
+fi
+
+# Get the list of files in the source directory
+FILES=$(svn list "${SOURCE_URL}")
+
+for FILE in $FILES; do
+ if [[ "$FILE" == apache-hamilton* ]]; then
+ SOURCE_FILE_URL="${SOURCE_URL}/${FILE}"
+ DEST_FILE_URL="${DEST_URL}/${DEST_FILE_NAME}"
+
+ if [ "$DRY_RUN" = true ]; then
+ echo "DRY RUN: svn mv \"${SOURCE_FILE_URL}\" \"${DEST_FILE_URL}\" -m \"Promote Apache ${PROJECT_SHORT_NAME} ${VERSION}: ${DEST_FILE_NAME}\""
Review Comment:
```suggestion
echo "DRY RUN: svn cp \"${SOURCE_FILE_URL}\" \"${DEST_FILE_URL}\" -m \"Promote Apache ${PROJECT_SHORT_NAME} ${VERSION}: ${DEST_FILE_NAME}\""
```
--
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: notifications-unsubscribe@hamilton.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Adds script to help promote RC artifacts & modifies packages for future source releases [hamilton]
Posted by "skrawcz (via GitHub)" <gi...@apache.org>.
skrawcz commented on code in PR #1408:
URL: https://github.com/apache/hamilton/pull/1408#discussion_r2464566683
##########
scripts/apache_release_helper.py:
##########
@@ -139,10 +142,96 @@ def sign_artifacts(archive_name: str) -> Optional[list[str]]:
return files
+def _modify_wheel_for_apache_release(original_wheel: str, new_wheel_path: str):
+ """Helper to modify the wheel for apache release.
+
+ # Flit somehow builds something incorrectly.
+ # 1. change PKG-INFO's first line to be `Metadata-Version: 2.4`
+ # 2. make sure the second line is `Name: apache-hamilton`
+ # 3. remove the `Import-Name: hamilton` line from PKG-INFO.
+
+ :param original_wheel: Path to the original wheel.
+ :param new_wheel_path: Path to the new wheel to create.
+ """
+ with tempfile.TemporaryDirectory() as tmpdir:
+ # Unzip the wheel
+ with zipfile.ZipFile(original_wheel, "r") as zip_ref:
+ zip_ref.extractall(tmpdir)
+
+ # Find the .dist-info directory
+ dist_info_dirs = glob.glob(os.path.join(tmpdir, "*.dist-info"))
+ if not dist_info_dirs:
+ raise ValueError(f"Could not find .dist-info directory in {original_wheel}")
+ dist_info_dir = dist_info_dirs[0]
+ pkg_info = os.path.join(dist_info_dir, "PKG-INFO")
+
+ _modify_pkg_info_file(pkg_info)
+
+ # Create the new wheel
+ with zipfile.ZipFile(new_wheel_path, "w", zipfile.ZIP_DEFLATED) as zip_ref:
+ for root, _, files in os.walk(tmpdir):
+ for file in files:
+ zip_ref.write(
+ os.path.join(root, file), os.path.relpath(os.path.join(root, file), tmpdir)
+ )
+
+
+def _modify_pkg_info_file(pkg_info_path: str):
+ """
+ Flit somehow builds something incorrectly.
+ 1. change PKG-INFO's first line to be `Metadata-Version: 2.4`
+ 2. make sure the second line is `Name: apache-hamilton`
+ 3. remove the `Import-Name: hamilton` line from PKG-INFO.
+ """
+ with open(pkg_info_path, "r") as f:
+ lines = f.readlines()
+
+ new_lines = []
+ for i, line in enumerate(lines):
+ if i == 0:
+ new_lines.append("Metadata-Version: 2.4\n")
+ elif i == 1:
+ new_lines.append("Name: apache-hamilton\n")
+ elif line.strip() == "Import-Name: hamilton":
+ continue # Skip this line
+ else:
+ new_lines.append(line)
+
+ with open(pkg_info_path, "w") as f:
+ f.writelines(new_lines)
+
+
+def _modify_tarball_for_apache_release(original_tarball: str, new_tarball_path: str):
+ """Helper to modify the tarball for apache release.
+
+ # Flit somehow builds something incorrectly.
+ # 1. change PKG-INFO's first line to be `Metadata-Version: 2.4`
+ # 2. make sure the second line is `Name: apache-hamilton`
+ # 3. remove the `Import-Name: hamilton` line from PKG-INFO.
+
+ :param original_tarball: Path to the original tarball.
+ :param new_tarball_path: Path to the new tarball to create.
+ """
+ with tempfile.TemporaryDirectory() as tmpdir:
+ # Extract the tarball
+ with tarfile.open(original_tarball, "r:gz") as tar:
+ tar.extractall(path=tmpdir)
+
+ # Modify the PKG-INFO file
+ # The extracted tarball has a single directory inside.
+ extracted_dir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
+ pkg_info_path = os.path.join(extracted_dir, "PKG-INFO")
+
+ _modify_pkg_info_file(pkg_info_path)
+
+ # Create the new tarball
+ with tarfile.open(new_tarball_path, "w:gz") as tar:
+ tar.add(extracted_dir, arcname=os.path.basename(extracted_dir))
+
+
def create_release_artifacts(version) -> list[str]:
"""Creates the source tarball, GPG signature, and checksums using `python -m build`."""
- print("Creating release artifacts with 'python -m build'...")
- files_to_upload = []
+ print("Creating release artifacts with 'flit build'...")
Review Comment:
I think this is closer to the code -- so no difference?
--
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: notifications-unsubscribe@hamilton.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Adds script to help promote RC artifacts & modifies packages for future source releases [hamilton]
Posted by "skrawcz (via GitHub)" <gi...@apache.org>.
skrawcz commented on code in PR #1408:
URL: https://github.com/apache/hamilton/pull/1408#discussion_r2464566150
##########
scripts/apache_release_helper.py:
##########
@@ -139,10 +142,96 @@ def sign_artifacts(archive_name: str) -> Optional[list[str]]:
return files
+def _modify_wheel_for_apache_release(original_wheel: str, new_wheel_path: str):
+ """Helper to modify the wheel for apache release.
+
+ # Flit somehow builds something incorrectly.
+ # 1. change PKG-INFO's first line to be `Metadata-Version: 2.4`
+ # 2. make sure the second line is `Name: apache-hamilton`
+ # 3. remove the `Import-Name: hamilton` line from PKG-INFO.
+
+ :param original_wheel: Path to the original wheel.
+ :param new_wheel_path: Path to the new wheel to create.
+ """
+ with tempfile.TemporaryDirectory() as tmpdir:
+ # Unzip the wheel
+ with zipfile.ZipFile(original_wheel, "r") as zip_ref:
+ zip_ref.extractall(tmpdir)
+
+ # Find the .dist-info directory
+ dist_info_dirs = glob.glob(os.path.join(tmpdir, "*.dist-info"))
+ if not dist_info_dirs:
+ raise ValueError(f"Could not find .dist-info directory in {original_wheel}")
+ dist_info_dir = dist_info_dirs[0]
+ pkg_info = os.path.join(dist_info_dir, "PKG-INFO")
+
+ _modify_pkg_info_file(pkg_info)
+
+ # Create the new wheel
+ with zipfile.ZipFile(new_wheel_path, "w", zipfile.ZIP_DEFLATED) as zip_ref:
+ for root, _, files in os.walk(tmpdir):
+ for file in files:
+ zip_ref.write(
+ os.path.join(root, file), os.path.relpath(os.path.join(root, file), tmpdir)
+ )
+
+
+def _modify_pkg_info_file(pkg_info_path: str):
+ """
+ Flit somehow builds something incorrectly.
+ 1. change PKG-INFO's first line to be `Metadata-Version: 2.4`
+ 2. make sure the second line is `Name: apache-hamilton`
+ 3. remove the `Import-Name: hamilton` line from PKG-INFO.
+ """
+ with open(pkg_info_path, "r") as f:
+ lines = f.readlines()
+
+ new_lines = []
+ for i, line in enumerate(lines):
+ if i == 0:
+ new_lines.append("Metadata-Version: 2.4\n")
+ elif i == 1:
+ new_lines.append("Name: apache-hamilton\n")
+ elif line.strip() == "Import-Name: hamilton":
+ continue # Skip this line
+ else:
+ new_lines.append(line)
+
+ with open(pkg_info_path, "w") as f:
+ f.writelines(new_lines)
+
+
+def _modify_tarball_for_apache_release(original_tarball: str, new_tarball_path: str):
+ """Helper to modify the tarball for apache release.
+
+ # Flit somehow builds something incorrectly.
+ # 1. change PKG-INFO's first line to be `Metadata-Version: 2.4`
+ # 2. make sure the second line is `Name: apache-hamilton`
+ # 3. remove the `Import-Name: hamilton` line from PKG-INFO.
+
+ :param original_tarball: Path to the original tarball.
+ :param new_tarball_path: Path to the new tarball to create.
+ """
+ with tempfile.TemporaryDirectory() as tmpdir:
+ # Extract the tarball
+ with tarfile.open(original_tarball, "r:gz") as tar:
+ tar.extractall(path=tmpdir)
+
+ # Modify the PKG-INFO file
+ # The extracted tarball has a single directory inside.
+ extracted_dir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
+ pkg_info_path = os.path.join(extracted_dir, "PKG-INFO")
+
+ _modify_pkg_info_file(pkg_info_path)
+
+ # Create the new tarball
+ with tarfile.open(new_tarball_path, "w:gz") as tar:
+ tar.add(extracted_dir, arcname=os.path.basename(extracted_dir))
+
+
def create_release_artifacts(version) -> list[str]:
"""Creates the source tarball, GPG signature, and checksums using `python -m build`."""
- print("Creating release artifacts with 'python -m build'...")
- files_to_upload = []
+ print("Creating release artifacts with 'flit build'...")
Review Comment:
🤷
--
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: notifications-unsubscribe@hamilton.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Adds script to help promote RC artifacts & modifies packages for future source releases [hamilton]
Posted by "skrawcz (via GitHub)" <gi...@apache.org>.
skrawcz commented on code in PR #1408:
URL: https://github.com/apache/hamilton/pull/1408#discussion_r2464564304
##########
scripts/promote_rc.sh:
##########
@@ -0,0 +1,107 @@
+#!/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.
+
+# This script moves a release candidate from the dev repository to the release repository.
+
+set -e
+
+DRY_RUN=false
+POSITIONAL_ARGS=()
+
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ --dry-run)
+ DRY_RUN=true
+ shift # past argument
+ ;;
+ *)
+ POSITIONAL_ARGS+=("$1") # save positional arg
+ shift # past argument
+ ;;
+ esac
+done
+
+set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
+
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 [--dry-run] <version> <rc_num>"
+ echo "Example: $0 --dry-run 1.2.3 0"
+ exit 1
+fi
+
+VERSION=$1
+RC_NUM=$2
+PROJECT_SHORT_NAME="hamilton"
+
+# Source and destination URLs
+SOURCE_URL="https://dist.apache.org/repos/dist/dev/incubator/${PROJECT_SHORT_NAME}/${VERSION}-RC${RC_NUM}"
+DEST_URL="https://dist.apache.org/repos/dist/release/incubator/${PROJECT_SHORT_NAME}/${VERSION}"
+
+if [ "$DRY_RUN" = true ]; then
+ echo "Performing a dry run. No changes will be made."
+else
+ echo "This script will copy the release candidate from dev to release."
+ echo "Source: ${SOURCE_URL}"
+ echo "Destination: ${DEST_URL}"
+ echo " "
+
+ read -p "Are you sure you want to continue? (y/n) " -n 1 -r
+ echo
+ if [[ ! $REPLY =~ ^[Yy]$ ]]
+ then
+ echo "Aborting."
+ exit 1
+ fi
+fi
+
+# Create the release directory
+if [ "$DRY_RUN" = true ]; then
+ echo "DRY RUN: svn mkdir --parents -m \"Creating directory for Apache ${PROJECT_SHORT_NAME} ${VERSION}\" \"${DEST_URL}\""
+else
+ svn mkdir --parents -m "Creating directory for Apache ${PROJECT_SHORT_NAME} ${VERSION}" "${DEST_URL}"
+fi
+
+# Get the list of files in the source directory
+FILES=$(svn list "${SOURCE_URL}")
+
+for FILE in $FILES; do
+ if [[ "$FILE" == apache-hamilton* ]]; then
+ SOURCE_FILE_URL="${SOURCE_URL}/${FILE}"
+ DEST_FILE_URL="${DEST_URL}/${DEST_FILE_NAME}"
+
+ if [ "$DRY_RUN" = true ]; then
+ echo "DRY RUN: svn cp \"${SOURCE_FILE_URL}\" \"${DEST_FILE_URL}\" -m \"Promote Apache ${PROJECT_SHORT_NAME} ${VERSION}: ${DEST_FILE_NAME}\""
+ else
+ echo "Moving ${FILE} to ${DEST_FILE_URL}"
Review Comment:
```suggestion
echo "Copying ${FILE} to ${DEST_FILE_URL}"
```
--
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: notifications-unsubscribe@hamilton.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Adds script to help promote RC artifacts & modifies packages for future source releases [hamilton]
Posted by "skrawcz (via GitHub)" <gi...@apache.org>.
skrawcz commented on code in PR #1408:
URL: https://github.com/apache/hamilton/pull/1408#discussion_r2464562679
##########
scripts/apache_release_helper.py:
##########
@@ -180,29 +268,23 @@ def create_release_artifacts(version) -> list[str]:
# copy the tarball to be apache-hamilton-{version.lower()}-incubating.tar.gz
new_tar_ball = f"dist/apache-hamilton-{version.lower()}-incubating.tar.gz"
- shutil.copy(tarball_path[0], new_tar_ball)
+ # shutil.copy(tarball_path[0], new_tar_ball)
Review Comment:
```suggestion
```
--
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: notifications-unsubscribe@hamilton.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Adds script to help promote RC artifacts & modifies packages for future source releases [hamilton]
Posted by "skrawcz (via GitHub)" <gi...@apache.org>.
skrawcz merged PR #1408:
URL: https://github.com/apache/hamilton/pull/1408
--
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: notifications-unsubscribe@hamilton.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org