Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): improve running migrations for older workspaces #15174

Merged

Conversation

leosvelperez
Copy link
Member

@leosvelperez leosvelperez commented Feb 22, 2023

Current Behavior

Starting on Nx 15.7.0, Nx DevKit generators can only write to project.json files. When it comes to migrations, workspaces in older versions that are using the config format v1 and are migrating to a version lower than 15.7.0 have issues with any migration generators written with Nx DevKit and using updateProjectConfiguration. In those cases an error is thrown because the project.json file (expected by latest Nx) doesn't exist. This happens because migrations are always run with the latest version of Nx.
Workspaces migrating to a version lower than 13.9.0 don't get @nrwl/tao version bumped which is a package needed for those versions.
Workspaces using an Nx version older than 14.0.0 when migrating to a version higher than 14.0.0 don't get any package update unless the package is explicitly set in the command nx migrate @nrwl/workspace@<version>.

Expected Behavior

Migrating a workspace to an older version than 15.7.0 should succeed. In those cases, the migrations would be run with the local installation of Nx.
The @nrwl/tao package should be updated when migrating to an older version of Nx where that package is required.
Migrating running nx migrate latest should work regardless of the version, explicitly specifying the package to update Nx should not be required.

Related Issue(s)

Fixes #15063
Fixes #15141

@leosvelperez leosvelperez self-assigned this Feb 22, 2023
@vercel
Copy link

vercel bot commented Feb 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 23, 2023 at 6:29PM (UTC)

@leosvelperez leosvelperez marked this pull request as ready for review February 22, 2023 15:43
@AgentEnder
Copy link
Member

Can we pin to latest 15.6.X instead of the local version?

@leosvelperez leosvelperez marked this pull request as draft February 23, 2023 09:09
@leosvelperez leosvelperez force-pushed the core/migrate-support-older-workspaces branch from 0619cf5 to b7ef4af Compare February 23, 2023 18:17
@leosvelperez leosvelperez changed the title fix(core): use local installation of nx to run migrations in versions older than 15.7.0 fix(core): improve running migrations for older workspaces Feb 23, 2023
@leosvelperez leosvelperez marked this pull request as ready for review February 23, 2023 19:33
@FrozenPandaz FrozenPandaz merged commit 096905c into nrwl:master Feb 23, 2023
@leosvelperez leosvelperez deleted the core/migrate-support-older-workspaces branch February 23, 2023 20:25
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migration from nx 13 to nx 15.1.1 and angular 13 to angular 14 Failed to migrate from 12.2.0 to 13.4.1
3 participants