Skip to content

fix(@angular/cli): respect client-side release age settings during update resolution#33468

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:fix-update-resolver-release-age
Jun 29, 2026
Merged

fix(@angular/cli): respect client-side release age settings during update resolution#33468
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:fix-update-resolver-release-age

Conversation

@clydin

@clydin clydin commented Jun 25, 2026

Copy link
Copy Markdown
Member

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.

@clydin clydin force-pushed the fix-update-resolver-release-age branch 3 times, most recently from dc88f1f to b4ea3b0 Compare June 25, 2026 20:54
@clydin clydin marked this pull request as ready for review June 25, 2026 21:03

@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 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.

Comment thread packages/angular/cli/src/commands/update/update-resolver.ts Outdated
Comment thread packages/angular/cli/src/commands/update/update-resolver.ts Outdated
Comment thread packages/angular/cli/src/commands/update/update-resolver.ts Outdated
Comment thread packages/angular/cli/src/commands/update/update-resolver.ts Outdated
@clydin clydin force-pushed the fix-update-resolver-release-age branch from b4ea3b0 to f4ad109 Compare June 25, 2026 21:06
@clydin clydin added target: minor This PR is targeted for the next minor release action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 25, 2026
@clydin clydin requested a review from alan-agius4 June 25, 2026 21:19
Comment thread packages/angular/cli/src/package-managers/package-manager_spec.ts
Comment thread packages/angular/cli/src/package-managers/parsers.ts Outdated
Comment thread packages/angular/cli/src/package-managers/package-manager_spec.ts
expect(manifest).toEqual({ name: 'foo', version: '1.0.0' });
});
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread packages/angular/cli/src/package-managers/package-manager.ts Outdated
Comment thread packages/angular/cli/src/package-managers/package-manager.ts Outdated
Comment thread packages/angular/cli/src/commands/update/update-resolver.ts

@alan-agius4 alan-agius4 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

See comments.

Comment thread packages/angular/cli/src/package-managers/package-manager.ts
@clydin clydin force-pushed the fix-update-resolver-release-age branch from f4ad109 to 84cd6ed Compare June 26, 2026 19:12
…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.
@clydin clydin force-pushed the fix-update-resolver-release-age branch from 84cd6ed to 1e97b57 Compare June 26, 2026 23:12
@clydin clydin requested a review from alan-agius4 June 26, 2026 23:55
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 29, 2026
@alan-agius4 alan-agius4 merged commit 3a2589d into angular:main Jun 29, 2026
40 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the fix-update-resolver-release-age branch June 29, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/cli target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants