From 702371762e6fe5180ae4b4d7f8485fd804b3b3d9 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Wed, 10 Jun 2026 08:49:35 +0000 Subject: [PATCH] fix(ci): make aztec-up verdaccio prime retry patiently The aztec-up test primes a local verdaccio registry by running 'npm i -g @aztec/aztec ...', which resolves every transitive dependency fresh from npmjs. A transient upstream/registry miss can 404 a single uncached version even when it is published (observed on merge-train CI: @aws-sdk/credential-provider-env@^3.972.46 404'd although it had been published ~13h earlier). The default retry (3 attempts, 5s apart) is too impatient to ride out the blip and dequeued the spartan-v5 merge train. Retry the prime up to 8 times with 30s backoff before failing. --- aztec-up/bootstrap.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/aztec-up/bootstrap.sh b/aztec-up/bootstrap.sh index 4618253bca97..fff3f15efdcf 100755 --- a/aztec-up/bootstrap.sh +++ b/aztec-up/bootstrap.sh @@ -112,7 +112,19 @@ EOF # This fetches all transitive dependencies from npmjs and caches them locally. # Use --prefix to avoid modifying the host system's global npm packages. echo "Priming verdaccio cache with all dependencies..." - retry "npm i -g --prefix /tmp/npm-prime @aztec/aztec@$version @aztec/cli-wallet@$version @aztec/bb.js@$version" + # npm resolves every transitive dependency fresh from npmjs (proxied through verdaccio), + # so a transient upstream/registry miss can 404 a single uncached version even when it is + # published. The default retry (3 attempts, 5s apart) is too impatient to ride out such a + # blip and has dequeued merge-train PRs. Retry for longer before giving up. + prime_cmd="npm i -g --prefix /tmp/npm-prime @aztec/aztec@$version @aztec/cli-wallet@$version @aztec/bb.js@$version" + for attempt in $(seq 1 8); do + if $prime_cmd; then + break + fi + [ "$attempt" = 8 ] && { echo "Failed to prime verdaccio cache after 8 attempts" >&2; exit 1; } + echo "Prime attempt $attempt failed; retrying in 30s..." >&2 + sleep 30 + done rm -rf /tmp/npm-prime docker build -t aztecprotocol/aztec-up-test .