Skip to content

fix(@schematics/angular): keep the workspace build version in the use-application-builder migration - #34304

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
thekhegay:fix/use-application-builder-version
Oct 12, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
thekhegay:fix/use-application-builder-version

Conversation

@thekhegay

@thekhegay thekhegay commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

PR Checklist

PR Type

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #30696

ng update @angular/cli --name=use-application-builder from 18.2 workspace goes through temporary latest CLI, and migration adds @angular/build at that CLI version with ExistingBehavior.Replace, so project gets newest major next to Angular 18

What is the new behavior?

@angular/build takes specifier of workspace @angular-devkit/build-angular, falls back to latestVersions.AngularBuild when there is none, and existing @angular/build is left alone (ExistingBehavior.Skip)

Four spec cases, three of them fail on main, one reads @angular-devkit/build-angular from dependencies

Code is what was suggested in review on #32875, which was closed only becuase CLA was never signed

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Alternative is to skip temporary CLI for --name / --migrate-only (#32942), but that changes which CLI runs every migrate-only update, so I kept fix in schematic

Closes: #30696

@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 updates the use-application-builder migration to preserve the workspace's existing version of @angular-devkit/build-angular when migrating to @angular/build, rather than always using the latest version. It also ensures that an existing @angular/build version is not overwritten by setting the dependency behavior to skip existing. Unit tests have been added to verify these scenarios. There are no review comments to address, and I have no additional feedback to provide.

…-application-builder migration

migration added `@angular/build` at version of CLI running it, so `ng update --name` on older workspace pulled newest major
now it reuses `@angular-devkit/build-angular` specifer and leaves existing `@angular/build` alone

Fixes angular#30696
@thekhegay
thekhegay force-pushed the fix/use-application-builder-version branch from 81b318e to a911ac0 Compare October 10, 2026 16:24
@thekhegay

Copy link
Copy Markdown
Contributor Author

Picked this up after #32875 was closed for CLA
migration.ts change is @alan-agius4 suggestion from review there, tests I wrote myself and nothing came from orginal branch
If credit is needed I can add Co-authored-by, but for raashish1601 it would fail cla/google same way since CLA is still unsigned

@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Oct 12, 2026
@alan-agius4
alan-agius4 merged commit 445cc76 into angular:main Oct 12, 2026
41 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

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

@thekhegay
thekhegay deleted the fix/use-application-builder-version branch October 21, 2026 09:18
@angular-automatic-lock-bot

Copy link
Copy Markdown

This pull request has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Nov 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running the optional angular build migration installs incompatible version of @angular/build

2 participants