Skip to content

fix(@angular/cli): validate registry option is a valid URL in ng add#33302

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:feat/ng-add-validate-registry
Jun 4, 2026
Merged

fix(@angular/cli): validate registry option is a valid URL in ng add#33302
clydin merged 1 commit into
angular:mainfrom
clydin:feat/ng-add-validate-registry

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Jun 3, 2026

Ensure that the --registry option passed to ng add is parsed as a valid absolute URL.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Jun 3, 2026
Copy link
Copy Markdown

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

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 URL validation for the --registry option in the ng add command, throwing a CommandModuleError if the provided registry is not a valid URL, and adds a corresponding E2E test. The review feedback suggests enhancing this validation to ensure robust runtime type safety, specifically handling cases where registry might be parsed as an array or an empty string, and provides a code suggestion to address this.

Comment thread packages/angular/cli/src/commands/add/cli.ts
@clydin clydin force-pushed the feat/ng-add-validate-registry branch from 91f449d to 4257663 Compare June 3, 2026 22:39
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jun 3, 2026
@clydin clydin requested a review from alan-agius4 June 3, 2026 22:59
Copy link
Copy Markdown
Collaborator

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

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

LGTM, just a NIT.

@alan-agius4 alan-agius4 removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Jun 4, 2026
Comment thread packages/angular/cli/src/commands/add/cli.ts Outdated
Ensure that the --registry option passed to ng add is parsed as a valid absolute URL.
@clydin clydin force-pushed the feat/ng-add-validate-registry branch from 4257663 to fe02e73 Compare June 4, 2026 11:40
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Jun 4, 2026
@clydin clydin merged commit be25199 into angular:main Jun 4, 2026
39 checks passed
@clydin
Copy link
Copy Markdown
Member Author

clydin commented Jun 4, 2026

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

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: 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