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

jerryshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new dcdf5503e3 [#13637] Make release re-runs safe after a partial failure 
(#13638)
dcdf5503e3 is described below

commit dcdf5503e3591b72fd25edddb4bd40cab025191c
Author: Bharath Krishna <[email protected]>
AuthorDate: Wed Oct 7 23:22:25 2026 -0700

    [#13637] Make release re-runs safe after a partial failure (#13638)
    
    ### What changes were proposed in this pull request?
    
    Two re-run hazards in the release scripts:
    
    1. **`release-build.sh`** — `twine upload` had no `--skip-existing`, so
    re-running `package` or `finalize` after a later step failed died on
    `400 File already exists`. Added to both call sites.
    2. **`publish-docker.sh`** — a `--dry-run` writes the same `docker.done`
    marker as a real run, and the skip guard only tested that the file
    existed. It now ignores a marker containing `dry_run=true`.
    
    ### Why are the changes needed?
    
    Part of #13637
    
    Both were hit preparing 1.3.1. The second fails silently — the real
    publish prints `Stage 'docker' is already complete`, exits 0, and
    dispatches nothing.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No. Release tooling only.
    
    ### How was this patch tested?
    
    The two state files differ only in the `dry_run=true` line, so the guard
    keys on exactly that, anchored:
    
    | marker written by | real run |
    |---|---|
    | `--dry-run` | ignored, stage runs |
    | a real run | skipped, unchanged |
---
 dev/release/publish-docker.sh | 4 +++-
 dev/release/release-build.sh  | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/dev/release/publish-docker.sh b/dev/release/publish-docker.sh
index 48250f2eca..75b7c06e2d 100755
--- a/dev/release/publish-docker.sh
+++ b/dev/release/publish-docker.sh
@@ -171,7 +171,9 @@ echo "Verified: $INPUT_TAG exists"
 DOCKER_STATE_DIR="${RELEASE_STATE_DIR:-$SELF/.release-state}/${INPUT_TAG}"
 DOCKER_STATE_FILE="${DOCKER_STATE_DIR}/${STATE_KEY}.done"
 
-if [[ "$DRY_RUN" == "false" ]] && [[ -f "$DOCKER_STATE_FILE" ]]; then
+# A dry-run marker records the preview, so it must not stand in for a real run.
+if [[ "$DRY_RUN" == "false" ]] && [[ -f "$DOCKER_STATE_FILE" ]] &&
+  ! grep -q '^dry_run=true$' "$DOCKER_STATE_FILE"; then
   echo ""
   echo "=== Stage '${STATE_KEY}' is already complete ==="
   cat "$DOCKER_STATE_FILE"
diff --git a/dev/release/release-build.sh b/dev/release/release-build.sh
index 429ee2212e..14565b64ff 100755
--- a/dev/release/release-build.sh
+++ b/dev/release/release-build.sh
@@ -136,6 +136,7 @@ if [[ "$1" == "finalize" ]]; then
   echo "Uploading Gravitino to PyPi"
   twine upload -u __token__  -p $PYPI_API_TOKEN \
     --repository-url https://upload.pypi.org/legacy/ \
+    --skip-existing \
     "apache_gravitino-$PYGRAVITINO_VERSION.tar.gz"
   echo "Python Gravitino package uploaded"
   rm -fr gravitino
@@ -274,6 +275,7 @@ if [[ "$1" == "package" ]]; then
     echo "Uploading Gravitino Python package $RC_PYGRAVITINO_VERSION to PyPi"
     twine upload -u __token__  -p $PYPI_API_TOKEN \
       --repository-url https://upload.pypi.org/legacy/ \
+      --skip-existing \
       "apache_gravitino-$RC_PYGRAVITINO_VERSION.tar.gz"
 
     svn co --depth=empty $RELEASE_STAGING_LOCATION svn-gravitino

Reply via email to