Skip to content

build(npm): Wait for platform packages before bumping lockfile - #3451

Open
sentry-junior[bot] wants to merge 2 commits into
masterfrom
szokeasaurusrex/post-release-wait-for-npm
Open

sentry-junior[bot] wants to merge 2 commits into
masterfrom
szokeasaurusrex/post-release-wait-for-npm

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Fixes the race in scripts/post-release.sh that broke npm ci on master after 3.8.1. #3450 repairs the lockfile itself.

For 3.8.1, the post-release commit (11815fd) landed at 11:45:08 UTC. According to the npm registry, most of the platform packages were published after that, and the last one (@sentry/cli-linux-arm64, at 11:58) came 13 minutes later. Because npm install --package-lock-only ran before those versions existed, npm wrote the optional dependencies to the lockfile without any version.

The script now:

  • Polls npm until every optionalDependencies package is available at the new version. It checks every 30s and fails after 30 minutes.
  • Runs npm install with --prefer-online, so it doesn't use cached registry metadata.
  • Checks that the lockfile has the new version for every optional dependency, and exits before committing if any are missing. A bad lockfile then shows up as a failed post-release step instead of a red master.

The package list comes from package.json, so a new platform package doesn't need any change here. The lockfile check works with both lockfile v1 (the current format) and v2/v3.

via @szokeasaurusrex.

--

View Junior Session [Sentry]

The post-release script could run before every platform package for the
new version was visible on npm. npm then dropped their versions from
package-lock.json, which broke npm ci on master after 3.8.1.

Poll npm until all optional dependencies are published, and refuse to
push a lockfile that is missing the new versions.

Co-Authored-By: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants