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

[6078] Bump ruby to 3.2.2 #3633

Merged
merged 10 commits into from
Nov 15, 2023

Conversation

darokel
Copy link
Contributor

@darokel darokel commented Sep 29, 2023

Context

https://trello.com/c/VZxyXLG0/6078-update-ruby-and-node-to-latest-stable-versions

Changes proposed in this pull request

  • Bumps ruby to 3.2.2 in all the relevant areas

@sonarcloud
Copy link

sonarcloud bot commented Sep 29, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@carlosmartinez
Copy link
Collaborator

yarn is a pretty annoying thing to be failing in the build here. should we upgrade node simultaneously?

@darokel
Copy link
Contributor Author

darokel commented Oct 2, 2023

@carlosmartinez yeah tried that but still got some issues, I'll leave notes here before I wonder too deep:

Our node version is currently blocking this upgrade. ruby:3.2.2-alpine3.17 contains Node 18.x which has a breaking change causing our current webpack version to fail with:

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/register-trainee-teachers/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/register-trainee-teachers/node_modules/webpack/lib/NormalModule.js:417:16)
    at /register-trainee-teachers/node_modules/webpack/lib/NormalModule.js:452:10
    at /register-trainee-teachers/node_modules/webpack/lib/NormalModule.js:323:13
    at /register-trainee-teachers/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /register-trainee-teachers/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/register-trainee-teachers/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /register-trainee-teachers/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

This is a cascading problem because the @rails/webpacker library is now retired and the last version available is what we currently have (we also have to pin the webpack-dev-server to a specific version to match). This is incompatible with the latest version of webpack and the webpack-dev-server which contains a fix to the initial problem mentioned above (context).

There is a higher version available for @rails/webpacker which i think addresses this issue https://www.npmjs.com/package/@rails/webpacker/v/6.0.0-rc.6 but it's a release candidate and there is an upgrade guide which we may have to do https://github.com/rails/webpacker/blob/master/docs/v6_upgrade.md.

A couple of options:

  • Try to upgrade to the release candidate to see if it unblocks the ruby upgrade
  • Get rid of webpacker and replace with esbuild so we can use the latest node (and also be able to bump ruby)
  • Find a higer ruby image which contains a compatible version of node (16.x) (given it's end of life it might be a bit difficult)

Additional context:

@carlosmartinez
Copy link
Collaborator

@darokel shall we close this for now?

@darokel
Copy link
Contributor Author

darokel commented Oct 3, 2023

Closing as we're sorting out the elephant in the room first

@darokel darokel closed this Oct 3, 2023
@darokel darokel reopened this Nov 13, 2023
@darokel darokel force-pushed the 6078-update-ruby-and-node-to-latest-stable-versions-ruby branch from c4a5e69 to 3b15d51 Compare November 13, 2023 12:04
@darokel darokel changed the base branch from main to 6172-replace-webpacker-with-esbuild November 13, 2023 12:04
@d-a-v-e d-a-v-e force-pushed the 6172-replace-webpacker-with-esbuild branch from 8699b8a to 7c92807 Compare November 13, 2023 14:23
@darokel darokel force-pushed the 6078-update-ruby-and-node-to-latest-stable-versions-ruby branch from 323d749 to 63e7047 Compare November 13, 2023 14:39
Base automatically changed from 6172-replace-webpacker-with-esbuild to main November 13, 2023 18:35
@darokel darokel force-pushed the 6078-update-ruby-and-node-to-latest-stable-versions-ruby branch 3 times, most recently from 918dd18 to 17bb974 Compare November 14, 2023 10:49
@darokel darokel requested review from carlosmartinez, RMcVelia and a team November 14, 2023 10:49
@darokel darokel force-pushed the 6078-update-ruby-and-node-to-latest-stable-versions-ruby branch from 17bb974 to 12d80ab Compare November 14, 2023 10:55
Copy link

sonarcloud bot commented Nov 14, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@darokel darokel merged commit 545adfd into main Nov 15, 2023
32 checks passed
@darokel darokel deleted the 6078-update-ruby-and-node-to-latest-stable-versions-ruby branch November 15, 2023 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants