Skip to content

The open-source app everyone uses to manage agents at work

fix(release): add npm publish crash diagnostics (#10041)

Dotta4e8cd757eb69
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ee36208e47..d46cf1fb59 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -78,6 +78,16 @@ jobs:
GITHUB_ACTIONS: "true"
run: ./scripts/release.sh canary --skip-verify
+ - name: Dump npm debug logs
+ if: failure()
+ run: |
+ shopt -s nullglob
+ for f in "$HOME"/.npm/_logs/*.log; do
+ echo "===== $f ====="
+ tail -n 300 "$f" | sed -E \
+ -e 's#((authorization|_authToken|_auth|node_auth_token|npm_token)"?[[:space:]]*[:=][[:space:]]*"?)(Bearer[[:space:]]+)?[^",[:space:]]+#\1***REDACTED***#Ig'
+ done
+
- name: Push canary tag
run: |
tag="$(git tag --points-at HEAD | grep '^canary/v' | head -1)"
@@ -184,6 +194,16 @@ jobs:
fi
./scripts/release.sh "${args[@]}"
+ - name: Dump npm debug logs
+ if: failure()
+ run: |
+ shopt -s nullglob
+ for f in "$HOME"/.npm/_logs/*.log; do
+ echo "===== $f ====="
+ tail -n 300 "$f" | sed -E \
+ -e 's#((authorization|_authToken|_auth|node_auth_token|npm_token)"?[[:space:]]*[:=][[:space:]]*"?)(Bearer[[:space:]]+)?[^",[:space:]]+#\1***REDACTED***#Ig'
+ done
+
- name: Push stable tag
run: |
tag="$(git tag --points-at HEAD | grep '^v' | head -1)"
diff --git a/scripts/acpx-patch-packaging.test.mjs b/scripts/acpx-patch-packaging.test.mjs
index d51ca8e7ef..8aa45833af 100644
--- a/scripts/acpx-patch-packaging.test.mjs
+++ b/scripts/acpx-patch-packaging.test.mjs
@@ -36,7 +36,8 @@ test("bundled package staging materializes publishConfig entrypoints", () => {
test("bundled package dry runs preview without querying published versions", () => {
assert.match(releaseScript, /run_bundled_npm_pack pack --pack-destination "\$publish_dir"/);
assert.match(releaseLib, /BUNDLED_NPM_PACK_VERSION="10\.9\.7"/);
- assert.match(releaseLib, /BUNDLED_NPM_PUBLISH_VERSION="11\.16\.0"/);
+ assert.match(releaseLib, /BUNDLED_NPM_PUBLISH_VERSION="11\.18\.0"/);
assert.match(releaseLib, /npx --yes "npm@\$BUNDLED_NPM_PACK_VERSION"/);
assert.match(releaseLib, /npx --yes "npm@\$BUNDLED_NPM_PUBLISH_VERSION"/);
+ assert.match(releaseLib, /"\$@" --loglevel verbose/);
});
diff --git a/scripts/release-lib.sh b/scripts/release-lib.sh
index 927c36a96e..a0e2852d75 100644
--- a/scripts/release-lib.sh
+++ b/scripts/release-lib.sh
@@ -311,14 +311,14 @@ package_publish_tool() {
}
BUNDLED_NPM_PACK_VERSION="10.9.7"
-BUNDLED_NPM_PUBLISH_VERSION="11.16.0"
+BUNDLED_NPM_PUBLISH_VERSION="11.18.0"
run_bundled_npm_pack() {
npx --yes "npm@$BUNDLED_NPM_PACK_VERSION" "$@"
}
run_bundled_npm_publish() {
- npx --yes "npm@$BUNDLED_NPM_PUBLISH_VERSION" "$@"
+ npx --yes "npm@$BUNDLED_NPM_PUBLISH_VERSION" "$@" --loglevel verbose
}
run_package_publish() {
diff --git a/scripts/release-lib.test.mjs b/scripts/release-lib.test.mjs
index e98128d8d6..15bf289df4 100644
--- a/scripts/release-lib.test.mjs
+++ b/scripts/release-lib.test.mjs
@@ -91,7 +91,7 @@ exit 1
set -euo pipefail
printf 'npx %s\n' "$*" >> "$FAKE_CALL_LOG"
[ "$1" = "--yes" ] && shift
-[ "$1" = "[email protected]" ] && shift
+[ "$1" = "[email protected]" ] && shift
exec npm "$@"
`,
);
@@ -145,8 +145,11 @@ test("publish_package_to_npm uses trusted-publishing-capable npm for bundled dep
const result = runPublishHelper({ pnpmMode: "success", publishTool: "npm" });
assert.equal(result.status, 0);
- assert.match(result.calls, /^npx --yes npm@11\.16\.0 publish --tag canary --access public$/m);
- assert.match(result.calls, /^npm publish --tag canary --access public$/m);
+ assert.match(
+ result.calls,
+ /^npx --yes npm@11\.18\.0 publish --tag canary --access public --loglevel verbose$/m,
+ );
+ assert.match(result.calls, /^npm publish --tag canary --access public --loglevel verbose$/m);
assert.doesNotMatch(result.calls, /^pnpm publish/m);
});