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

dashorst pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit a036e30c78029e2b9e49af0791612d00d5505719
Author: Martijn Dashorst <[email protected]>
AuthorDate: Sun Nov 1 13:36:32 2026 +0100

    Determine the staging repository that the release deploy created
    
    release.sh took the staging repository id from rc-list, keeping every
    orgapachewicket repository that was not CLOSED. That is not necessarily
    the repository the deploy uploaded to: any other open Wicket staging
    repository matched as well, and when its id sorted first, that id went
    into rc-close, release-vote.txt, promote-$version.sh and
    revert-$version.sh. With several open Wicket repositories the variable
    held several ids, with none it was empty, and the script carried on in
    both cases.
    
    The deploy runs through maven-deploy-plugin from the Apache parent pom,
    so Nexus creates the staging repository implicitly and neither the
    deploy output nor release.sh learns its id. rc-list shows only the id,
    the state and the description, and every implicitly created repository
    has the same description, "Implicitly created (auto staging).", so
    there is no description to match on either. release.sh now lists the
    Wicket staging repositories before release:prepare and again after
    release:perform, and takes the one repository that appeared in
    between. When none appeared, or more than one, it stops before closing
    anything or generating the vote mail, and shows the repositories it saw
    before and after the deploy. A failing rc-list or rc-close stops the
    script as well; before, a failed rc-close went unnoticed.
    
    Explicit staging, opening a repository with rc-open and deploying into
    it by id, would name the repository up front, but it changes how
    release:perform deploys and needs the Wicket staging profile id. The
    comparison leaves the deploy as it is.
    
    GitHub issue #1749
    
    Generated-by: Claude Code (Claude Opus 5.5)
---
 release.sh | 48 +++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 45 insertions(+), 3 deletions(-)

diff --git a/release.sh b/release.sh
index d7f52a3f2e..2843c73074 100755
--- a/release.sh
+++ b/release.sh
@@ -40,6 +40,13 @@ xpath /pom:project/pom:version/text()
 EOF
 }
 
+function list_wicket_staging_repositories {
+    local output
+    output=$(mvn --batch-mode 
org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-list 
-DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https) \
+        || { >&2 echo "$output"; return 1; }
+    echo "$output" | awk '$1 == "[INFO]" && $2 ~ /^orgapachewicket-[0-9]+$/ { 
print $2 }' | sort
+}
+
 function getJdkToolchain {
     xmllint ~/.m2/toolchains.xml --xpath 
"/toolchains/toolchain[provides/version/text() = 
'$JAVA_VERSION']/configuration/jdkHome/text()"
 }
@@ -493,6 +500,10 @@ git commit -am "Changes to notice files"
 echo "Clean all projects"
 mvn -q clean -Pall
 
+echo "Listing the Wicket staging repositories that exist before the deploy"
+staging_repos_before=$(list_wicket_staging_repositories) \
+    || fail "Unable to list the staging repositories at 
https://repository.apache.org";
+
 # package and assemble the release
 echo "Prepare the release"
 mvn --batch-mode release:prepare -X -l $log -DpreparationGoals="clean" 
-Dtag=$tag -Daether.connector.basic.parallelPut=false -Papache-release,release
@@ -506,11 +517,42 @@ if [ $? -ne 0 ] ; then
     fail "ERROR: mvn release:perform was not successful"
 fi
 
-# Determine the staging repository and close it after deploying the release to 
the staging area
-stagingrepoid=$(mvn 
org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-list 
-DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https | 
grep -v "CLOSED" | grep -Eo "orgapachewicket-[0-9]+")
+# Nexus creates the staging repository implicitly, and the deploy output 
doesn't name it
+staging_repos_after=$(list_wicket_staging_repositories) \
+    || fail "Unable to list the staging repositories at 
https://repository.apache.org";
+stagingrepoid=$(comm -13 <(echo "$staging_repos_before") <(echo 
"$staging_repos_after") | grep .)
+
+case $(echo "$stagingrepoid" | grep -c .) in
+    1)
+        ;;
+    0)
+        fail "The deploy did not create a new Wicket staging repository at 
https://repository.apache.org
+
+Wicket staging repositories before the deploy:
+${staging_repos_before:-  (none)}
+
+Wicket staging repositories after the deploy:
+${staging_repos_after:-  (none)}
+
+When a Wicket staging repository is still open from an earlier attempt, Nexus 
can
+deploy into it instead of creating a new one. Drop the repository that holds 
the
+$version artifacts at https://repository.apache.org/#stagingRepositories and 
run
+release.sh again."
+        ;;
+    *)
+        fail "The deploy created more than one Wicket staging repository at 
https://repository.apache.org:
+
+$stagingrepoid
+
+Either the artifacts of $version are split over them, or another Wicket 
release was
+staged at the same time. Drop the repositories of $version at
+https://repository.apache.org/#stagingRepositories and run release.sh again."
+        ;;
+esac
 
 echo "Closing staging repository with id $stagingrepoid"
-mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-close 
-DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org 
-DserverId=apache.releases.https -Ddescription="Release has been built, 
awaiting vote"
+mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-close 
-DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org 
-DserverId=apache.releases.https -Ddescription="Release has been built, 
awaiting vote" \
+    || fail "Unable to close staging repository $stagingrepoid"
 
 generate_promotion_script
 generate_rollback_script

Reply via email to