Skip to content

Fix npm update failing for version manager installs#166

Merged
gtsiolis merged 1 commit intomainfrom
george/des-185
Mar 24, 2026
Merged

Fix npm update failing for version manager installs#166
gtsiolis merged 1 commit intomainfrom
george/des-185

Conversation

@gtsiolis
Copy link
Member

Follow up from #124.
Fix DES-185.

@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

Warning

Rate limit exceeded

@gtsiolis has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 26 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: f5931e66-0103-4ecf-a57e-516f1eede753

📥 Commits

Reviewing files that changed from the base of the PR and between 578a251 and 10fdf16.

📒 Files selected for processing (5)
  • internal/update/install_method.go
  • internal/update/install_method_test.go
  • internal/update/npm.go
  • internal/update/update.go
  • test/integration/update_test.go
📝 Walkthrough

Walkthrough

Removed local npm project detection and related tests; update flow now always runs a global npm install (npm install -g @localstack/lstk@latest) and updateNPM no longer accepts a project directory parameter.

Changes

Cohort / File(s) Summary
Helper removal
internal/update/install_method.go
Deleted the unexported npmProjectDir function that walked parent directories to locate node_modules/package.json.
Unit test updates
internal/update/install_method_test.go
Removed TestNpmProjectDir and its filesystem cases; added an asdf-managed Node.js global path case to TestClassifyPath; dropped unused imports.
npm update implementation
internal/update/npm.go
Changed updateNPM signature to remove projectDir param and always construct/run a global npm install -g @localstack/lstk@latest command.
Update application flow
internal/update/update.go
Removed logic that computed projectDir via npmProjectDir and branch between local/global install; now always emits the global-install note and calls updateNPM(ctx, sink).
Integration test
test/integration/update_test.go
Renamed TestUpdateNPMLocalInstallTestUpdateNPMInstall; added pre-check to skip if global binary exists; replaced local-install assertions with a single check for "npm install -g".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • silv-io
  • carole-lavillonniere
  • anisaoshafi
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix npm update failing for version manager installs' directly matches the changeset's primary objective: removing the npmProjectDir logic that was causing issues with version manager installs and simplifying npm updates to always use global installation.
Description check ✅ Passed The description references a related PR (#124) and an issue (DES-185) that the changeset addresses, which is relevant context for understanding the fix's purpose.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch george/des-185

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@anisaoshafi anisaoshafi left a comment

Choose a reason for hiding this comment

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

Thanks for simplifying this, and making it easier to maintain 👏🏼

@gtsiolis
Copy link
Member Author

Thanks for taking a look, @anisaoshafi! 🌮

@gtsiolis gtsiolis merged commit 273738e into main Mar 24, 2026
8 checks passed
@gtsiolis gtsiolis deleted the george/des-185 branch March 24, 2026 21:07
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