Fix incorrect stale statee during nodejs patch bump#302143
Closed
Fix incorrect stale statee during nodejs patch bump#302143
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the repo’s “npm install state” staleness detection to avoid treating Node.js patch bumps as requiring a reinstall, reducing false “node_modules is stale” signals during routine Node patch updates.
Changes:
- Update the build-side
isUpToDate()check to compare Node.js versions by major.minor instead of full semver (ignoring patch). - Update the
vscode-extras“npm up-to-date” status UI to also ignore patch-level Node.js differences.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| build/npm/installStateHash.ts | Adds a helper to compare Node versions by major.minor and uses it in isUpToDate() to ignore patch-only changes. |
| .vscode/extensions/vscode-extras/src/npmUpToDateFeature.ts | Mirrors the major.minor comparison in the status UI so it doesn’t flag staleness on patch-only Node differences. |
Comment on lines
+216
to
+217
| const majorMinor = (v: string) => { const p = v.split('.'); return p.length >= 2 ? `${p[0]}.${p[1]}` : v; }; | ||
| if (majorMinor(state.saved.nodeVersion) !== majorMinor(state.current.nodeVersion)) { |
Comment on lines
+127
to
+130
| */ | ||
| export function nodeMajorMinor(version: string): string { | ||
| const parts = version.split('.'); | ||
| return parts.length >= 2 ? `${parts[0]}.${parts[1]}` : version; |
Collaborator
|
@lramos15 I am moving this to 1.113 since it is targeting main. Please create a candidate fix if this needs to go into 1.112 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
No description provided.