fix(@angular/cli): respect client-side release age settings during update resolution#33468
Open
clydin wants to merge 1 commit into
Open
fix(@angular/cli): respect client-side release age settings during update resolution#33468clydin wants to merge 1 commit into
clydin wants to merge 1 commit into
Conversation
dc88f1f to
b4ea3b0
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces support for a minimum release age gate configuration (such as minimum-release-age for pnpm, npmMinimalAgeGate for yarn, or environment variables) to filter out package versions that were published too recently. It updates the RegistryClient and PackageManager to retrieve and respect this configuration when resolving package versions, and adds corresponding tests and parsers. The review feedback suggests extracting the release age validation logic into a reusable helper function isReleaseAgeSatisfied to reduce code duplication across several functions and safely handle potential NaN values from Date.parse.
…date resolution Query the active package manager's release age gate configuration (like pnpm's `minimum-release-age` or yarn's `npmMinimalAgeGate`) and parse it into milliseconds. This config limit is passed to the `RegistryClient` in `resolveUserUpdatePlan` and is used to filter out version candidates that violate the release-age gate by checking the package's publish timestamps in the metadata `time` record. This guarantees that `ng update` resolves targeting versions that satisfy all active client-side release-age restrictions.
b4ea3b0 to
f4ad109
Compare
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.
Query the active package manager's release age gate configuration (like pnpm's
minimum-release-ageor yarn'snpmMinimalAgeGate) and parse it into milliseconds.This config limit is passed to the
RegistryClientinresolveUserUpdatePlanand is used to filter out version candidates that violate the release-age gate by checking the package's publish timestamps in the metadatatimerecord. This guarantees thatng updateresolves targeting versions that satisfy all active client-side release-age restrictions.