⚡ Sangsakala Proxy 🏠 Home
Skip to content

fix(@angular/cli): validate dist-tags and manifest caching under modern yarn - #34637

Open
clydin wants to merge 2 commits into
angular:mainfrom
clydin:fix/registry-manifest-validation-followup
Open

clydin wants to merge 2 commits into
angular:mainfrom
clydin:fix/registry-manifest-validation-followup

Conversation

@clydin

@clydin clydin commented Nov 2, 2026

Copy link
Copy Markdown
Member

Modern yarn (yarn npm info) silently falls back to the latest version with exit code 0 not
only when a requested SemVer version or range is unmet, but also when a requested dist-tag does
not exist. Previously, getRegistryManifest only checked valid SemVer ranges, allowing unknown
dist-tags to resolve to latest.

Include dist-tags in modern yarn's requested --fields and add parseYarnModernManifest to
verify that non-range version specifiers exist in dist-tags and resolve to the returned
manifest version before stripping dist-tags from the result.

Move the SemVer range validation inside #fetchAndParse's parser callback so rejected fallback
manifests are cached directly as null rather than storing the mismatched manifest object, and
scope includePrerelease to wildcard (*) specifiers so unmet major or x-ranges do not accept
prerelease latest fallbacks.

…rn yarn

Modern yarn (`yarn npm info`) silently falls back to the `latest` version with exit code 0 not
only when a requested SemVer version or range is unmet, but also when a requested dist-tag does
not exist. Previously, `getRegistryManifest` only checked valid SemVer ranges, allowing unknown
dist-tags to resolve to `latest`.

Include `dist-tags` in modern yarn's requested `--fields` and add `parseYarnModernManifest` to
verify that non-range version specifiers exist in `dist-tags` and resolve to the returned
manifest version before stripping `dist-tags` from the result.

Move the SemVer range validation inside `#fetchAndParse`'s parser callback so rejected fallback
manifests are cached directly as `null` rather than storing the mismatched manifest object, and
scope `includePrerelease` to wildcard (`*`) specifiers so unmet major or x-ranges do not accept
prerelease `latest` fallbacks.
… keys

The resolved-version manifest cache entry was stored using an unquoted `name@version` key while lookups on hosts that require shell quoting used a quoted key, so the entry was never reused. Both keys are now derived from the unquoted specifier.
@clydin clydin added the target: patch This PR is targeted for the next patch release label Nov 2, 2026
@clydin
clydin marked this pull request as ready for review November 2, 2026 22:23
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Nov 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request improves package manifest retrieval and caching, specifically addressing modern Yarn's behavior of silently falling back to the latest version when a requested version, range, or dist-tag does not exist. It introduces a new parseYarnModernManifest parser to validate dist-tags and strip them from the returned manifest, updates PackageManager.getRegistryManifest to validate version ranges, and implements a stable cache key generator (#getManifestCacheKey) to handle environments requiring shell quoting. Comprehensive unit tests have been added to verify these changes. There are no review comments to assess, and I have no additional feedback to provide.

@clydin
clydin requested a review from alan-agius4 November 2, 2026 22:25
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer action: merge The PR is ready for merge by the caretaker labels Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews area: @angular/cli target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants