Skip to content

fix(@angular/cli): discover migrations and schematics from installed packages when omitted by registry metadata - #33718

Closed
alan-agius4 wants to merge 3 commits into
angular:mainfrom
alan-agius4:fix-update-github-packages-migrations-fallback
Closed

fix(@angular/cli): discover migrations and schematics from installed packages when omitted by registry metadata#33718
alan-agius4 wants to merge 3 commits into
angular:mainfrom
alan-agius4:fix-update-github-packages-migrations-fallback

Conversation

@alan-agius4

@alan-agius4 alan-agius4 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

This PR resolves issues where private package registries (such as GitHub Packages) strip custom non-npm metadata properties (ng-update and schematics) from their remote registry API responses.

1. ng update (#33717)

2. ng add (#33060)

  • Removes the early skip condition based on registry metadata so ng add always installs the target package to inspect its physical manifest on disk (packages/angular/cli/src/commands/add/cli.ts).

@alan-agius4
alan-agius4 force-pushed the fix-update-github-packages-migrations-fallback branch from f2f94fc to 5942e69 Compare July 31, 2026 13:31
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jul 31, 2026
@alan-agius4
alan-agius4 requested a review from dgp1130 July 31, 2026 13:38
@alan-agius4
alan-agius4 marked this pull request as ready for review July 31, 2026 13:38

@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 refactors the ng add command to streamline package installation and cleanup, and introduces a fallback mechanism in the ng update command to resolve migrations from installed package.json files when they are omitted from the update plan. Feedback on the changes highlights an inefficient install-uninstall-reinstall cycle for built-in schematics during cleanup, suggesting that we avoid cleaning up temporary dependencies if they are part of BUILT_IN_SCHEMATICS.

@alan-agius4
alan-agius4 force-pushed the fix-update-github-packages-migrations-fallback branch 3 times, most recently from 930915a to a6b9487 Compare July 31, 2026 13:52
…mitted by registry metadata

Private package registries such as GitHub Packages frequently strip out custom non-npm metadata properties (e.g., ng-update or schematics) from their remote API responses. Previously, this caused ng update to skip migration execution during updates from those registries, even though ng update --migrate-only worked correctly.

This commit adds a post-installation disk-fallback check in ng update: for any updated packages that were not scheduled for migrations from registry metadata, the CLI inspects node_modules/<package>/package.json on disk after installation. If an ng-update.migrations collection is found, it is automatically added to the migration queue and executed.

Closes angular#33717
…nifest on disk for schematics

Private package registries such as GitHub Packages frequently strip out custom non-npm metadata properties (such as schematics and ng-add) from their remote API responses. Previously, ng add skipped confirming and installing a package if the registry metadata did not report hasSchematics, causing ng add to fail on first run.

This commit removes the early skip condition based on registry metadata so ng add always installs the target package to inspect its physical manifest on disk. If no schematics are found after installation, the CLI cleanly removes the temporary dependency.

Closes angular#33060
@alan-agius4
alan-agius4 force-pushed the fix-update-github-packages-migrations-fallback branch from a6b9487 to c957ded Compare July 31, 2026 14:09
@angular angular deleted a comment from gemini-code-assist Bot Jul 31, 2026
Comment thread packages/angular/cli/src/commands/update/cli.ts
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this pull request Jul 31, 2026
- Add JSDoc to `resolveFallbackMigrations` in `ng update` documenting why the post-installation disk check is needed for fallback migrations (private registries like GitHub Packages stripping custom non-npm metadata).
- Avoid cleaning up temporary dependencies during `ng add` if they are part of `BUILT_IN_SCHEMATICS`, preventing an inefficient install-uninstall-reinstall cycle.

TAG=agy
CONV=b92ba928-67b0-4f4b-a79a-ce19e5098641
@alan-agius4
alan-agius4 force-pushed the fix-update-github-packages-migrations-fallback branch from 853624e to 8f5c175 Compare July 31, 2026 17:32
@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 Jul 31, 2026
… when omitted by registry metadata

TAG=agy
CONV=b92ba928-67b0-4f4b-a79a-ce19e5098641
@alan-agius4
alan-agius4 force-pushed the fix-update-github-packages-migrations-fallback branch from 8f5c175 to 78a2b68 Compare July 31, 2026 17:51
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

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

alan-agius4 added a commit that referenced this pull request Jul 31, 2026
…mitted by registry metadata (#33718)

Private package registries such as GitHub Packages frequently strip out custom non-npm metadata properties (e.g., ng-update or schematics) from their remote API responses. Previously, this caused ng update to skip migration execution during updates from those registries, even though ng update --migrate-only worked correctly.

This commit adds a post-installation disk-fallback check in ng update: for any updated packages that were not scheduled for migrations from registry metadata, the CLI inspects node_modules/<package>/package.json on disk after installation. If an ng-update.migrations collection is found, it is automatically added to the migration queue and executed.

Closes #33717

PR Close #33718
alan-agius4 added a commit that referenced this pull request Jul 31, 2026
…nifest on disk for schematics (#33718)

Private package registries such as GitHub Packages frequently strip out custom non-npm metadata properties (such as schematics and ng-add) from their remote API responses. Previously, ng add skipped confirming and installing a package if the registry metadata did not report hasSchematics, causing ng add to fail on first run.

This commit removes the early skip condition based on registry metadata so ng add always installs the target package to inspect its physical manifest on disk. If no schematics are found after installation, the CLI cleanly removes the temporary dependency.

Closes #33060

PR Close #33718
alan-agius4 added a commit that referenced this pull request Jul 31, 2026
…nifest on disk for schematics (#33718)

Private package registries such as GitHub Packages frequently strip out custom non-npm metadata properties (such as schematics and ng-add) from their remote API responses. Previously, ng add skipped confirming and installing a package if the registry metadata did not report hasSchematics, causing ng add to fail on first run.

This commit removes the early skip condition based on registry metadata so ng add always installs the target package to inspect its physical manifest on disk. If no schematics are found after installation, the CLI cleanly removes the temporary dependency.

Closes #33060

PR Close #33718
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.

ng update does not execute migrations for GitHub Packages packages although --migrate-only works and migration exists in build

2 participants