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

baodi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-node.git


The following commit(s) were added to refs/heads/master by this push:
     new 81bad47  [fix][release] Skip docker build record artifacts when 
staging release (#473)
81bad47 is described below

commit 81bad47f2ca772f0724362ef12713aaaa9494a38
Author: Baodi Shi <[email protected]>
AuthorDate: Tue Mar 31 17:34:40 2026 +0800

    [fix][release] Skip docker build record artifacts when staging release 
(#473)
    
    Recent release workflow runs include auxiliary *.dockerbuild artifacts 
uploaded by docker/build-push-action. Our staging script downloaded every 
artifact from the workflow run and tried to unzip them as release packages, 
which caused stage-release.sh to fail with BadZipFile before the actual napi 
tarballs were processed.\n\nSkip *.dockerbuild artifacts in 
download-release-artifacts.py and keep the error message explicit for 
unexpected non-zip artifacts so release managers can stage 1. [...]
---
 build-support/download-release-artifacts.py | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/build-support/download-release-artifacts.py 
b/build-support/download-release-artifacts.py
index 0fcbcbb..b3f62a5 100755
--- a/build-support/download-release-artifacts.py
+++ b/build-support/download-release-artifacts.py
@@ -53,6 +53,13 @@ for artifact in data['artifacts']:
     name = artifact['name']
     url = artifact['archive_download_url']
 
+    # docker/build-push-action uploads build records as auxiliary artifacts.
+    # They are not release packages and break the staging flow if we try to
+    # unpack them alongside the platform tarballs.
+    if name.endswith('.dockerbuild'):
+        print(f'Skipping auxiliary artifact {name}')
+        continue
+
     print(f'Downloading {name} from {url}')
     artifact_response = requests.get(url, headers=headers, stream=True)
     artifact_response.raise_for_status()
@@ -65,8 +72,15 @@ for artifact in data['artifacts']:
     try:
         dest_dir = os.path.join(dest_path, name)
         Path(dest_dir).mkdir(parents=True, exist_ok=True)
-        with zipfile.ZipFile(tmp_zip_path, 'r') as z:
-            z.extractall(dest_dir)
+        try:
+            with zipfile.ZipFile(tmp_zip_path, 'r') as z:
+                z.extractall(dest_dir)
+        except zipfile.BadZipFile as exc:
+            raise RuntimeError(
+                f'Artifact {name} is not a ZIP archive. '
+                'This usually means the workflow uploaded a non-release '
+                'auxiliary artifact that should be filtered out.'
+            ) from exc
     finally:
         os.unlink(tmp_zip_path)
 
@@ -74,4 +88,4 @@ for root, dirs, files in os.walk(dest_path, topdown=False):
     for name in files:
         shutil.move(os.path.join(root, name), dest_path)
     if not os.listdir(root):
-        os.rmdir(root)
\ No newline at end of file
+        os.rmdir(root)

Reply via email to