Skip to content

build(npm): Restore optional dependency versions in lockfile - #3450

Merged
JPeer264 merged 1 commit into
masterfrom
szokeasaurusrex/fix-npm-lockfile-3.8.1
Oct 21, 2026
Merged

JPeer264 merged 1 commit into
masterfrom
szokeasaurusrex/fix-npm-lockfile-3.8.1

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Fixes the Node CI jobs, which have been failing on master since the 3.8.1 release.

The post-release bump in 11815fd removed the version field from every @sentry/cli-* optional dependency in package-lock.json. Because of that, npm ci rejects the lockfile as out of sync with package.json, which pins those dependencies to 3.8.1. The most likely cause is that scripts/post-release.sh ran npm install --package-lock-only before the 3.8.1 platform packages were available on npm.

This PR reruns the same command now that the packages are published, so each entry is set back to 3.8.1.

via @szokeasaurusrex.

--

View Junior Session [Sentry]

The post-release lockfile bump for 3.8.1 ran before the platform packages
were available on npm, so it dropped their versions and broke npm ci.

Co-Authored-By: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner October 21, 2026 12:36
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner October 21, 2026 12:36
@JPeer264
JPeer264 merged commit 2dee2dc into master Oct 21, 2026
29 checks passed
@JPeer264
JPeer264 deleted the szokeasaurusrex/fix-npm-lockfile-3.8.1 branch October 21, 2026 13:28
szokeasaurusrex added a commit that referenced this pull request Oct 22, 2026
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.

<!-- junior-request-attribution:start -->
via @szokeasaurusrex.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0C01CK9SG2%3A1792581829.701409 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0C01CK9SG2%3A1792581829.701409)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0C01CK9SG2%3A1792581829.701409/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
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