Skip to content

fix(global): scope vp update -g to its arguments when none are installed - #3551

Merged
fengmk2 merged 2 commits into
voidzero-dev:mainfrom
jong-kyung:fix/global-update-scoped-args
Nov 23, 2026
Merged

fengmk2 merged 2 commits into
voidzero-dev:mainfrom
jong-kyung:fix/global-update-scoped-args

Conversation

@jong-kyung

Copy link
Copy Markdown
Collaborator

vp update -g updates every global package when none of its arguments is an installed package. This happens when every argument is a local path or a package that is not installed yet:

$ vp install -g testnpm2@1.0.0      # recorded spec cleared, so 1.0.1 is wanted
$ vp update -g ./local-tool
info: Updating 2 global packages with Node.js <version>
 Updated vp-snap-local-tool to 0.0.0
 Updated testnpm2 to 1.0.1

managed_update in crates/vp_global_cli/src/cli.rs sends local paths and packages that are not installed straight to the install list. It collects only installed packages for the outdated lookup. When that collection is empty, packages.unwrap_or_default() passes an empty slice to get_outdated_packages, which reads an empty slice as "every installed package". With --latest, every global package moves to its latest version, and the new spec is recorded.

This PR skips the lookup when arguments were given but none of them is installed. vp update -g without arguments still checks every package, and vp outdated -g is unchanged. npm also limits npm update -g <name> to the named package.

When every argument to `vp update -g` was a local path or a package that is not installed, the outdated lookup received an empty list and checked every global package. Unrelated packages were then updated alongside the requested ones. The lookup is now skipped in that case.
@jong-kyung jong-kyung self-assigned this Nov 23, 2026
@jong-kyung jong-kyung added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test labels Nov 23, 2026
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T06:49:14.914001Z 939614f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 939614f782

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jong-kyung
jong-kyung marked this pull request as ready for review November 23, 2026 06:46
@fengmk2
fengmk2 merged commit 36f36a8 into voidzero-dev:main Nov 23, 2026
134 checks passed
@jong-kyung
jong-kyung deleted the fix/global-update-scoped-args branch November 23, 2026 08:01
@fengmk2 fengmk2 mentioned this pull request Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: e2e Auto run e2e tests test: install-e2e run vite install e2e test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants