perf(cli): skip npm install during hermes update when Node manifests are unchanged (#39397 salvage) - #61580
Merged
kshitijk4poor merged 3 commits intoJul 14, 2026
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hermes updateno longer pays 30-60s+ of npm dead time on Python-only/docs-only updates: both npm install steps are skipped when none of the Node manifests changed since the last successful install.Salvages #39397 by @rodboev (cherry-picked, authorship preserved). Scope change after review: #39399's
--prefer-offlinewas dropped entirely — local 3-run benchmarks on the repo's real manifests showed the flag is noise on warm-cachenpm ci(root: 0.90s vs 0.84s avg; workspaces: 4.02s vs 4.00s avg), and it carried a stale-resolution risk on thenpm installfallback (@ethernet8023's review). All the real win is the skip itself.Changes
hermes_cli/main.py(perf(cli): skip npm install during update when lockfile is unchanged (#17268) #39397, rodboev): skip both_update_node_dependencies()install steps when the manifest digest matches the one recorded after the last successful install. Cache file keyed by PROJECT_ROOT (parallel worktrees don't collide), guarded onnode_modulesexisting, hash written only on success.hermes_cli/main.py(review follow-up): the skip key is a combined digest overpackage-lock.json+ rootpackage.json+ every workspacepackage.jsonexpanded from the rootworkspacesglobs (npm's own source of truth — on the real repo: 8 manifests incl.apps/desktop,apps/bootstrap-installer,apps/shared, nestedui-tui/packages/hermes-ink). A package.json-only edit (no npm run) defeats the skip, so thenpm installout-of-sync fallback still fires exactly when it's needed.Validation
hermes update, no Node changesnpm cix2 (~5s+ warm, 30-60s+ cold)E2E (real imports, temp HERMES_HOME): full lifecycle incl. per-root isolation; real-repo check confirms all 8 workspace manifests enter the key. 58 targeted tests green. ruff clean.
Supersedes #39397. #39399 should be closed separately as no-measured-benefit (benchmark data in review thread).