Skip to content

chore: use lockfiles for NPM dependencies#80

Merged
zhukaihan merged 3 commits intomainfrom
codex/release-lockfiles
Mar 24, 2026
Merged

chore: use lockfiles for NPM dependencies#80
zhukaihan merged 3 commits intomainfrom
codex/release-lockfiles

Conversation

@daniel-graham-amplitude
Copy link
Contributor

@daniel-graham-amplitude daniel-graham-amplitude commented Mar 11, 2026

Applies the equivalent of amplitude/Amplitude-Swift#350 in this repository.

Changes

  • switch release workflow from inline npx -p ... installs to lockfile-based commands
  • run npm ci before semantic-release in dry-run and release steps
  • run semantic-release via npm exec
  • add root package.json + package-lock.json for deterministic dependency resolution
  • ignore node_modules/ in .gitignore where needed

Note

Medium Risk
Release automation now depends on npm ci/lockfile resolution and Node 22, so mis-specified or drifting JS deps could break publishing. Adding base64/logger as runtime gem dependencies can affect downstream dependency graphs but is otherwise straightforward.

Overview
Updates the GitHub release workflow to use a deterministic Node-based toolchain: installs Node.js 22, runs npm ci, and invokes semantic-release via npm exec instead of inline npx -p ... installs (for both dry-run and real releases).

Adds node_modules/ to .gitignore, introduces root package.json/package-lock.json to pin semantic-release-related dependencies, and declares base64 and logger as runtime dependencies in amplitude-experiment.gemspec.

Written by Cursor Bugbot for commit 5abb468. This will update automatically on new commits. Configure here.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the release workflow to use a committed npm lockfile (instead of npx -p ...) so semantic-release runs with deterministic dependency resolution.

Changes:

  • Add root package.json / package-lock.json and update release workflow to run npm ci + npm exec semantic-release.
  • Update .gitignore to exclude node_modules/.
  • Switch semantic-release execution from inline npx -p installs to local, lockfile-resolved tooling.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 3 comments.

File Description
package.json Introduces pinned npm dependencies used by the release workflow.
package-lock.json Locks the dependency graph for deterministic installs in CI (npm ci).
.gitignore Ignores node_modules/ in the repo.
.github/workflows/release.yml Runs npm ci before semantic-release and executes semantic-release via npm exec.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI commented Mar 20, 2026

@zhukaihan I've opened a new pull request, #81, to work on those changes. Once the pull request is ready, I'll request review from you.

…81)

* Initial plan

* ci: add setup-node step with Node 22 before npm ci

Co-authored-by: zhukaihan <7332407+zhukaihan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/amplitude/experiment-ruby-server/sessions/9cea838f-75a4-4b8b-98d8-1e0f6017660c

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: zhukaihan <7332407+zhukaihan@users.noreply.github.com>
* Add base64 and logger as explicit gem dependencies

Ruby 3.4+ no longer bundles these in default gems; JRuby fails with
LoadError when requiring them without a declared dependency.

Co-authored-by: Peter Zhu <zhukaihan@users.noreply.github.com>

* fix(spec): synchronize Set updates in multithreaded storage test

Ruby Set is not thread-safe; concurrent add from worker threads could
corrupt the expected set and fail equality with pull_all results.

Co-authored-by: Peter Zhu <zhukaihan@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Peter Zhu <zhukaihan@users.noreply.github.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@zhukaihan zhukaihan removed the request for review from tyiuhc March 24, 2026 22:47
@zhukaihan zhukaihan merged commit 9670572 into main Mar 24, 2026
8 checks passed
@zhukaihan zhukaihan deleted the codex/release-lockfiles branch March 24, 2026 22:48
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.

4 participants