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

Nodejs 20 Upgrade #3

Open
Arique1104 opened this issue Nov 16, 2023 · 13 comments · May be fixed by StateVoicesNational/Spoke#2316 or StateVoicesNational/Spoke#2319
Open

Nodejs 20 Upgrade #3

Arique1104 opened this issue Nov 16, 2023 · 13 comments · May be fixed by StateVoicesNational/Spoke#2316 or StateVoicesNational/Spoke#2319
Assignees

Comments

@Arique1104
Copy link
Collaborator

Arique1104 commented Nov 16, 2023

Update the Nodejs version to 18 to avoid Twilio deprecation.
Stephanie & Daniel

@Arique1104
Copy link
Collaborator Author

Updated code: https://github.com/MoveOnOrg/Spoke/pull/2310

@Arique1104
Copy link
Collaborator Author

If nothing breaks at version 18, please stretch to Nodejs version 20

@Arique1104
Copy link
Collaborator Author

Learning goals:

  • @slyarbo2 will continue to test Node18 update on their local and then create a pull request to that StateVoicesNational/Spoke instance for approval!

@dwbond
Copy link
Collaborator

dwbond commented Nov 17, 2023

Setting the 20 stretch goal aside and focusing on 18

upgrade procedure:

  1. change package.json engine for node and npm, and .nvmrc
  2. install new node version with nvm (node version manager) nvm install v18.18.2 (and make it the default with nvm alias default v18.18.2)
  3. update new packages with npm (node package manager) npm update
  4. see if any issues can be automatically resolved with npm audit fix
  5. force available automatic updates with npm audit fix --force
  6. dependency adventures!
  7. tests
  8. save newly updated packages to package.json with npm update --save

package audit output https://pastebin.com/SmiraX5H

@Arique1104
Copy link
Collaborator Author

  • Package upgrades that cause conflicts.
  • Successfully updated 800 packages.
  • Attempt to pass all the test cases on all the stuff that is supposed to be smooth sailing.
  • To what extent does this work with current updates?
  • How to tackle the next errors afterwards?

@dwbond
Copy link
Collaborator

dwbond commented Nov 17, 2023

Output from yarn install flags dependency issues https://pastebin.com/gezGMu8V

@dwbond
Copy link
Collaborator

dwbond commented Nov 17, 2023

full changes, upgraded to main for easier merging (Stephanie was running a pre- 13.1 version + seems to have been pushing to an inaccessible Github account) https://github.com/StateVoicesNational/Dispatch/tree/node18

@dwbond
Copy link
Collaborator

dwbond commented Nov 17, 2023

Test case output does not run successfully

https://pastebin.com/5FeCTnn0

@Arique1104
Copy link
Collaborator Author

Arique1104 commented Nov 17, 2023

BLOCKER FOR FINISHING NODE18 UPDATE: StateVoicesNational#6

@Arique1104
Copy link
Collaborator Author

What did you learn?

  • We upgrade all the packages: tun of warnings
  • Load it up on the browser and it seems to be okay??
  • Our whole frontend framework needs to be updated from v4 to v5. Could be a heavy lift! CSS class renaming and fun stuff like that.
  • AWS they are not supporting the SD service for next year.
  • Smaller packages that are not able to "forced fixed" requiring manual intervention.
  • All test cases are failing currently....that's breaking also. Looking at version 18 specific test suite!

Priorities for tomorrow:

  • Creating the issue tickets for what needs to be updated. Starting their issue with NODE UPDATE: name-of-update-needed
  • Prioritize the No Fix Available and then group the fix available updates as one ticket.

There are a variety of different references for the Node that we are using.

@Arique1104
Copy link
Collaborator Author

  • Get two remaining replacements from error messages into issues
  • Prioritize npm--force on a separate branch to review what breaks.

@dwbond
Copy link
Collaborator

dwbond commented Nov 19, 2023

npm audit fix --force changes a whole heckuva lot of files, highlights the previously noted unresolvable issues with e.g. apollo and graphql with additional notes (some of which say themselves could be fixed with an npm audit fix --force, suggesting they may need to be fix force'ed on a package-by-package basis (yes I did try running it a second time)

pushed to previous node18 branch

full output from npm audit fix --force: https://pastebin.com/GcgYTJd3
full output after audit fix, from yarn install (significantly fewer warnings, along the lines as described above): https://pastebin.com/PSxjmzNu

@Arique1104 Arique1104 linked a pull request Dec 1, 2023 that will close this issue
7 tasks
@Arique1104 Arique1104 changed the title Nodejs 18 Upgrade Nodejs 20 Upgrade Dec 4, 2023
@Arique1104
Copy link
Collaborator Author

  • Below is the block of commands I ran to successfully upgrade to Nodejs20
  • Going to nodejs20 instead of 21 because it would introduce too many breaking changes. But upgrading to nodejs20, would give Spoke some breathing room for Twilio.
  • There still needs to be more QA to ensure that all parts of the code was properly updated.
10245  rm -rf Spoke_Hackathon_Fork
10246  ls
10247  cd ..
10248  rm -rf node-update
10249  ls
10250  mkdir node-update
10251  cd node-update
10252  ls
10253  gh repo clone StateVoicesNational/Spoke_Hackathon_Fork
10254  ls
10255  cd Spoke_Hackathon_Fork
10256  git checkout -b node20-update-II
10257  node -v
10258  npm -v
10259  npm outdated
10260  npm install
10261  npm outdated
10262  git status
10263  git add .
10264  git commit -m "Ran npm install and got a yarn.lock file update.  Keeping to learning purposes"
10265  npm audit
10266  npm ls
10267  npm outdated --depth
10268  npm install @babel/cli 7.23.4 --save
10269  npm install @babel/cli@7.23.4 --save
10270  git status
10271  git add .
10272  git commit -m "Adds @babel/cli@7.23.4 to dependencies"
10273  npm ls @babel/cli@7.23.4
10274  npm ls @babel/cli@7.23.4 --depth
10275  npm ls @babel/core
10276  npm install @babel/core@7.23.4 --save
10277  git status
10278  git add .
10279  git status"\n"
10280  git status
10281  git add .
10282  git commit -m "Removes web-cli from optional dependencies"
10283  git status
10284  npm ls @babel/traverse
10285  npm install @babel/traverse@7.23.2 --save
10286  git status
10287  git add .
10288  git commit -m "Adds babel/traverse version 7.23.2 to package and yarn lock"
10289  git push origin node20-update-II
10290  npm audit fix
10291  git status
10292  git add .
10293  git commit -m "Ran npm audit fix"
10294  git push origin node20-update-II
10295  npm audit
10296  npm outdated --depth
10297  npm use
10298  npm install
10299  npm un react-dnd@11.1.3
10300  git status
10301  npm uninstall react-dnd@7.7.0
10302  npm install react-dnd@11.1.3 --save
10303  npm install react-dnd@7.7.0
10304  npm install react-dnd@7.7.0 --save
10305  npm install
10306  git add .
10307  git commit -m "Adds react-dnd version 7.7.0 to dependencies"
10308  git push origin node20-update-II
10309  npm outdated
10310  npm ls @babel/core
10311  npm audit
10312* npm ls @cypress/request
10313* npm install @cypress/request@2.88.12 --save
10314  npm ls @cypress/request
10315  npm up @cypress/request
10316  git status
10317  yarn dev
10318  cp .env.example .env
10319  yarn dev
10320  npm install node@20.0.0 --save
10321  npm install npm@9.6.4
10322  git status
10323  git add .
10324  history
10325  git status
10326  yarn dev
10327  npm ls aws-sdk --all
10328  npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/action-handlers/mobilecommons-signup.js
10329  git status
10330  git add .
10331  git commit -m "Updates mobilecommons-signup to remove aws-sdk which is deprecated"
10332  yarn dev
10333  git push origin node20-update-II
10334  npm install @babel/plugin-transform-class-properties
10335  git add .
10336  git commit -m "Adds babel/plugin-transform-class-properties to project dependencies"
10337  yarn dev
10338  git push origin node20-update-II
10339  npm install @babel/plugin-transform-nullish-coalescing-operator --save
10340  git add .
10341  git commit -m "Adds @babel/plugin-transform-nullish-coalescing-operator to project dependencies"
10342  yarn dev
10343  git push origin node20-update-II
10344  npm install @babel/plugin-transform-optional-chaining
10345  git add .
10346  git commit -m "Adds @babel/plugin-transform-optional-chaining into project dependencies"
10347  yarn dev
10348  git push origin node20-update-II
10349  npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/action-handlers/revere-signup.js
10350  git status
10351  git add .
10352  git commit -m "Upgrades aws-sdk to version 3 standards"
10353  yarn dev
10354  history
10355  npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/contact-loaders/csv-s3-upload/index.js
10356  yarn dev
10357  git status
10358  git add .
10359  git commit -m "Upgrades csv-s3-upload index file to use version 3 aws"
10360  git push origin node20-update-II
10361  npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/contact-loaders/s3-pull/index.js
10362  yarn dev
10363  history
10364  npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/workers/jobs.js
10365  yarn dev
10366  git status
10367  git add .
10368  git commit -m "Updates jobs.js to version 3 standards of aws - beginning of breaking change"
10369  npm install @aws-sdk/client-lambda --save
10370  yarn dev
10371  history
10372  git add .
10373  git commit -m "Adds @aws-sdk/client-lambda to dependencies"
10374  yarn dev
10375  npm install @aws-sdk/s3-request-presigner --save
10376  git add .
10377  git commit -m "Adds aws-sdk/s3-request-predesigner to dependencies"
10378  yarn dev
10379  npm install @aws-sdk/client-s3 --save
10380  git add .
10381  git commit -m "Adds @aws-sdk/client-s3 to project dependencies"
10382  yarn dev
10383  npm install @aws-sdk/client-sqs --save
10384  yarn dev
10385  git add .
10386  git commit -m "Adds aws-sdk/client-sqs - end of breaking changes"
10387  git push origin node20-update-II
10388  npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/contact-loaders/s3-pull/index.js
10389  yarn dev
10390  git status
10391  git add .
10392  git commit -m "Upgrades s3-pull index file to use version 3 of aws"
10393  git push origin node20-update-II
10394  npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/extensions/job-runners/lambda-async/index.js
10395  yarn dev
10396  git status
10397  git add .
10398  git commit -m "updates lambda-async index.js to use version 3 aws-sdk"
10399  git push origin node20-update-II
10400  npm install @aws-sdk/client-lambda --save
10401  git status
10402  npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/src/server/telemetry.js
10403  yarn dev
10404  git add .
10405  git commit -m "Updates telemetry.js to version 3 of aws-sdk"
10406  npm install @aws-sdk/client-cloudwatch --save
10407  git status
10408  git push origin node20-update-II
10409  git status
10410  git commit -m "Updates telemetry to use cloudwatch events and client cloud watch"
10411  git push origin node20-update-II
10412  git add .
10413  git commit -m "Adds aws-sdk/client-cloudwatch to project dependencies"
10414  yarn dev
10415  npm install @aws-sdk/client-cloudwatch-events --save
10416  git add .
10417  git commit -m "Adds @aws-sdk/client-cloudwatch-events to project dependencies"
10418  yarn dev
10419  npx aws-sdk-js-codemod -t v2-to-v3 /Users/ariqueaguilar/node-update/Spoke_Hackathon_Fork/lambda.js
10420  yarn dev
10421  git status
10422  git add .
10423  git commit -m "Upgrades lambda.js to version 3 of aws-sdk"
10424  git push origin node20-update-II
10425  yarn dev
10426  npm outdated
10427  history
10428  nvm install 20.0.0
10429  nvm alias default 20.0.0
10430  git status
10431  npm install
10432  node -v
10433  npm -v
10434  git add .
10435  yarn dev
10436  git status
10437  git add .
10438  git status
10439  git commit -m "Updates node engine to v 20.0.0 and npm to v 9.6.4"
10440  git status
10441  git add .
10442  git commit -m "Ran npm install"
10443  git push origin node20-update-II

@Arique1104 Arique1104 linked a pull request Dec 4, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
3 participants