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

sergehuber pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/unomi-tracker.git


The following commit(s) were added to refs/heads/main by this push:
     new d477650  Start 2.1.0 development and harden the release script.
d477650 is described below

commit d47765064666b74809165cef35ca4a2c49d1aba0
Author: Serge Huber <[email protected]>
AuthorDate: Sat Nov 21 15:09:47 2026 +0100

    Start 2.1.0 development and harden the release script.
    
    Bump the version after the 2.0.0 release. Wait for npm to serve a
    published package before comparing integrity, and stop treating a
    download-page match as a failure under pipefail.
---
 RELEASE.md         |  3 ++-
 package.json       |  2 +-
 scripts/release.sh | 41 +++++++++++++++++++++++++++++++++++++----
 3 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/RELEASE.md b/RELEASE.md
index 70b7b2f..c35b597 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -240,7 +240,8 @@ After the vote
 `scripts/release.sh publish X.Y.Z N --key <id>` checks the vote (72 hours, and 
the binding votes it
 asks for), writes the result email to `target/release/X.Y.Z/result-email.txt`, 
tags, moves the
 **source** and the convenience binary to `dist/release`, publishes the 
convenience `.tgz` to npm
-(same bytes as staged, no rebuild), checks that npm serves that file, writes 
the announcement to
+(same bytes as staged, no rebuild), checks that npm serves that file (it waits 
a few minutes,
+because npm accepts a publish before the registry shows it), writes the 
announcement to
 `target/release/X.Y.Z/announce-email.txt`, and says what to do by hand: JIRA 
and
 reporter.apache.org, then the download page, from one hour after the move. Then
 `scripts/release.sh finish X.Y.Z` checks downloads.apache.org, the download 
page and JIRA, removes
diff --git a/package.json b/package.json
index 41092d6..d47af2d 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
   "name": "apache-unomi-tracker",
   "repository": "apache/unomi-tracker",
   "author": "unomi <[email protected]>",
-  "version": "2.0.0",
+  "version": "2.1.0",
   "description": "A web tracker for Apache Unomi",
   "main": "dist/apache-unomi-tracker.cjs.js",
   "module": "dist/apache-unomi-tracker.esm.js",
diff --git a/scripts/release.sh b/scripts/release.sh
index eabda30..7d65d69 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -389,6 +389,23 @@ npm_integrity() {
     node -e 'const c = require("crypto"), f = require("fs"); 
console.log("sha512-" + 
c.createHash("sha512").update(f.readFileSync(process.argv[1])).digest("base64"))'
 "$1"
 }
 
+# npm accepts a publish before the registry serves the version. Prints its 
integrity once it does,
+# or nothing after about five minutes. Waiting lines go to stderr so a caller 
can capture the integrity.
+npm_published_integrity() {
+    local spec=$1 attempt=0 integrity=
+    while [ "$attempt" -lt 20 ]; do
+        attempt=$((attempt + 1))
+        integrity=$(npm view "$spec" dist.integrity 2>/dev/null || true)
+        if [ -n "$integrity" ]; then
+            printf '%s\n' "$integrity"
+            return 0
+        fi
+        printf '   waiting for npm to serve %s (%d/20)\n' "$spec" "$attempt" 
>&2
+        sleep 15
+    done
+    return 1
+}
+
 # A tag is signed by a key of the KEYS
 check_tag_signature() {
     local home=$1 tag=$2
@@ -814,9 +831,19 @@ cmd_publish() {
             tag_args=(--tag "latest-$major")
         fi
         if confirm "npm publish ${tag_args[*]+${tag_args[*]} }$file (npm's 
latest is ${latest:-none})?"; then
-            npm publish "${tag_args[@]+"${tag_args[@]}"}" "$work/$file"
-            published=$(npm view "$NPM_PACKAGE@$version" dist.integrity 
2>/dev/null || true)
-            [ "$published" = "$integrity" ] && ok "npm has 
$NPM_PACKAGE@$version, matching the staged convenience package" || fail "npm 
does not give the staged convenience package for $NPM_PACKAGE@$version 
(integrity ${published:-none})"
+            if npm publish "${tag_args[@]+"${tag_args[@]}"}" "$work/$file"; 
then
+                published=$(npm_published_integrity "$NPM_PACKAGE@$version" || 
true)
+            else
+                # A re-run while the first publish is still propagating is 
refused by npm. The version may already match.
+                published=$(npm view "$NPM_PACKAGE@$version" dist.integrity 
2>/dev/null || true)
+            fi
+            if [ "$published" = "$integrity" ]; then
+                ok "npm has $NPM_PACKAGE@$version, matching the staged 
convenience package"
+            elif [ -n "$published" ]; then
+                fail "npm has $NPM_PACKAGE@$version, but it does not match the 
staged convenience package"
+            else
+                fail "npm has not served $NPM_PACKAGE@$version yet. Do not 
publish it again. Run publish again once npm shows it."
+            fi
         fi
     fi
 
@@ -906,7 +933,13 @@ cmd_finish() {
     [ "$missing" = 0 ] && ok "$downloads/ has the source package, its 
signature and checksum" || fail "$downloads/ does not have the release yet: it 
can take an hour after the move"
 
     step "The download page"
-    if curl -fsSL https://unomi.apache.org/download.html 2>/dev/null | grep -q 
"unomi-tracker/$version/"; then
+    # Do not pipe curl into grep -q under pipefail: grep -q exits early, curl 
gets SIGPIPE,
+    # and the pipeline is treated as a failure even when the page links to the 
release.
+    local page_file
+    page_file=$(temp_dir)/download.html
+    if ! curl -fsSL -A 'Mozilla/5.0 (compatible; unomi-tracker-release/1.0)' 
-o "$page_file" https://unomi.apache.org/download.html; then
+        fail "could not download https://unomi.apache.org/download.html";
+    elif grep -F -q "unomi-tracker/$version/" "$page_file"; then
         ok "https://unomi.apache.org/download.html links to $version"
     else
         fail "https://unomi.apache.org/download.html does not link to $version 
yet: update tracker.latest in unomi-site, and publish the site"

Reply via email to