-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
migrating from nx 15.8.5 to 17.1.3 has missing migrations #20407
Comments
Thanks for reporting this! That's an interesting flow to update your repo, and while it should work for the most part, it's not guaranteed to work. The first thing is that the migrations contained in the So, going from Nx 15.8.5 to Nx 17.1.3 means going from Angular 15.2.x to Angular 17.0.x. That's jumping two Angular major versions. The installed Angular 17.0.x package will only contain migrations for Angular v17 and the The solution is to update one major version at a time. This is what we recommend in our docs, though we should probably make it more visible and potentially call out Angular explicitly. Regarding the other three migrations, when I followed your reproduction steps, I did get all of them in the Now, in the fresh 15.8.5 workspace I used to reproduce this, I noticed the following:
I can push a fix for the If in your workspace you think the other two migrations should have generated changes and didn't do so incorrectly, please provide a reproduction so we can troubleshoot them. |
@leosvelperez |
Yeah, that's why I'd need a reproduction to see what the issue could be. Following your reproduction steps left me with what I mentioned above, where there's only one migration with an issue. I'm not saying there are no issues with the others. It's just I haven't been able to reproduce them. I know it has been a while and I apologize for the delay on getting to this. It sounds you were able to move forward, so I'll push the fix for the one I could reproduce the issue and know what happened. I appreciate the time you've put to provide the information here and if you can't find the issues, that's ok. Let us know if that's the case so we can close this. We'll keep an eye on this anyways. |
@robertIsaac I fixed the issue with running migrations out of order in #21799. That fixes the issue you faced with the I'm going to close this issue given you mentioned it might be difficult to retrieve the relevant information for the other issues you found. If you later find any relevant information, please create a new issue with the details and link back to this issue. You can tag me and I'll take a look. |
Thanks @leosvelperez for fixing that one |
hi @leosvelperez chore: [nx migration] update-17-0-0-remove-deprecated-build-optionschore: [nx migration] update-16-2-0-normalize-tsconfigs |
@robertIsaac thanks for the new info! I'm reopening this and I'll try to set some time later this week to check this. I think I know how to reproduce |
{
"compilerOptions": {
"allowJs": true,
"outDir": "../../dist/out-tsc",
"sourceMap": false,
"strict": true,
"types": [
"cypress",
"node",
"cypress-real-events",
"@testing-library/cypress",
"cypress-wait-until",
"cypress-xpath"
]
},
"extends": "../../tsconfig.base.json",
"include": ["cypress/**/*.ts", "cypress/**/*.js", "./**/cypress.config.ts"]
} that was the only one the is {
"angularCompilerOptions": {
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
},
"compileOnSave": false,
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"baseUrl": ".",
"declaration": false,
"downlevelIteration": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"exactOptionalPropertyTypes": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"lib": ["es2018", "dom"],
"module": "esnext",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"paths": {
"our-internal-libraries": ["...."]
},
"resolveJsonModule": true,
"rootDir": ".",
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "es2015"
},
"exclude": ["node_modules", "tmp"]
} |
Can you confirm the name of the tsconfig file before the migration? Was it |
yes edit: because we don't have |
Good to know. That rules out that it wasn't applied. There might be a different issue leading your colleague to remove it, but it would be something separate.
If there was no |
@robertIsaac I confirm the issue with I'm closing this one since the issues have been addressed and the fix will be released in 18.1.0. |
Thanks for fixing it, I think future migration will be much better now |
The main piece of advice is to limit the version jump to, at most, one major at a time. In the case of Angular, this is actually required due to the Angular packages only keeping migrations for a single major version. Regardless, even though we all try our best to provide a solid migration experience, migrating code it's very difficult. There are so many variations/deviations workspaces can have out there that's very difficult, if not impossible, to account for every setup and migrate it successfully. We also make mistakes, and it adds up. This risk increases the more versions a migration jumps. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
these commits are missing
Expected Behavior
these commits to exists
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
I want to explain what I was trying to do
our aim is to upgrade from angular 15 to 17, but we have some old unmerged branches that have big code changes regarding new features, and most probably we will need to run the migration for them (same happened when we upgraded from angular 13 to 15 regarding angular material legacy change, it made almost all of our unmerged branches broken)
when I'm upgrading it's very difficult to just move from one big version to another because too much changes that you can't handle and fix, so I moved one minor version at a time (to 15.9, 15.10, 16.0 ... till 17.1) and fixing all the errors (which were all fully compatible with angular 15), the problem now that
migration.json
has only the changes from nx 17.0 to nx 17.1so I cherry picked these fix commits to a new branch then ran the nx migrate directly from 15.8.5 to latest so we have one
migration.json
that include everything so after we merge the upgrade the other branch can rebase on it and run thenx migrate --run-migrations
to apply these fixes in the old branches as wellafter I finished I compared the two branches and found there are +100 difference
so I started comparing commits (since I'm using
nx migrate --run-migrations --create-commits
and found these commits missingmigration.json
)migration.json
, but was skipped for unknown reason)migration.json
)migration.json
, but was skipped for unknown reason)The text was updated successfully, but these errors were encountered: