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

Fixes #37134 - upgrade to node 18 and npm 8 #10016

Merged

Conversation

MariaAga
Copy link
Member

No description provided.

package.json Outdated Show resolved Hide resolved
@ekohl ekohl mentioned this pull request Jan 26, 2024
package.json Outdated Show resolved Hide resolved
@ekohl
Copy link
Member

ekohl commented Jan 26, 2024

For context, this is blocking EL9 so if we can't get this done for Foreman 3.10 we'll need to postpone that effort to 3.11. I'd really like to avoid that.

@MariaAga
Copy link
Member Author

If webpack 5 is not reverted I dont see a reason for this to not be merged really soon. Looking at the test failures now.

@MariaAga
Copy link
Member Author

@ekohl do we need npm8 for EL9?

@MariaAga MariaAga force-pushed the webpack5-module-federations-node18 branch 4 times, most recently from 61ddba9 to f3156aa Compare January 26, 2024 15:00
@ekohl
Copy link
Member

ekohl commented Jan 26, 2024

@ekohl do we need npm8 for EL9?

Most likely In EL9 they've packaged NPM 8 and we're not downgrading that to 6. So if we need NPM (and I'm pretty sure we do), we need to be on NPM 8. It is acceptable to also move our other platforms to NodeJS 16 and NPM 8 if needed (and I think we can't support both).

However, looking at the Foreman 3.10 schedule we'll have stabilization week from 2024-02-12 - 2024-02-17. The week before we have cfgmgmtcamp where both @evgeni and I will be.

Essentially that means we need to get this and the needed rebuilds done next week. I'm skeptical we can make that work, unless @ehelms steps in. Even then, getting reviews will be hard.

@evgeni
Copy link
Member

evgeni commented Jan 26, 2024

Yeah, npm8 is what we get via CentOS packages and we can't easily avoid that.

@ehelms
Copy link
Member

ehelms commented Jan 26, 2024

For clarity sake, on EL 8, we get the following:

Installing:
 nodejs                                                   x86_64                                         1:16.18.1-3.module_el8.7.0+1234+1d8589d9                                                     appstream                                          12 M
Installing dependencies:
 brotli                                                   x86_64                                         1.0.6-3.el8                                                                                  baseos                                            323 k
 openssl                                                  x86_64                                         1:1.1.1k-9.el8                                                                               baseos                                            737 k
Installing weak dependencies:
 nodejs-docs                                              noarch                                         1:16.18.1-3.module_el8.7.0+1234+1d8589d9                                                     appstream                                         9.3 M
 nodejs-full-i18n                                         x86_64                                         1:16.18.1-3.module_el8.7.0+1234+1d8589d9                                                     appstream                                         8.0 M
 npm                                                      x86_64                                         1:8.19.2-1.16.18.1.3.module_el8.7.0+1234+1d8589d9                                            appstream                                         2.0 M

If this is just a question of iterating over packages for rebuilds, I can certainly help grind through that. I would need more clarity on if theforeman/foreman-js#404 is required and if that's the only property affected by this change? IIRC we do not store the lock files for any other repository.

.github/matrix.json Outdated Show resolved Hide resolved
@MariaAga MariaAga force-pushed the webpack5-module-federations-node18 branch 3 times, most recently from 3e060e0 to b78f582 Compare January 30, 2024 19:16
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tried I could actually install it without forcing legacy peer dependencies. Are you sure it's still needed?

package.json Outdated Show resolved Hide resolved
developer_docs/foreman_dev_setup.asciidoc Outdated Show resolved Hide resolved
.npmrc Outdated Show resolved Hide resolved
@MariaAga
Copy link
Member Author

When I tried I could actually install it without forcing legacy peer dependencies. Are you sure it's still needed?

did you run npm test or compile webpack? for me tests were failing as they could not find test packages, and pf5 was chosen over pf4

@ekohl
Copy link
Member

ekohl commented Jan 31, 2024

did you run npm test or compile webpack? for me tests were failing as they could not find test packages, and pf5 was chosen over pf4

No, I didn't. I just assumed that the initial error (plainly refusing to install at all) was the only error.

Just to be clear, I'm not opposed to using it for now if it gets us on NodeJS 16 faster.

@MariaAga
Copy link
Member Author

Should we just do the jump and update to node 18 instead?

@ekohl
Copy link
Member

ekohl commented Feb 13, 2024

theforeman/foreman_ansible#693 (comment) and theforeman/foreman_discovery#621 look related, the rest of the failures look unrelated.

#10045 should resolve those. They also happen with current NodeJS.

@MariaAga MariaAga force-pushed the webpack5-module-federations-node18 branch from 39648ff to 17dc76d Compare February 15, 2024 08:33
@ekohl
Copy link
Member

ekohl commented Feb 15, 2024

All the plugin tests now pass. That means there's only the NodeJS 14 situation left.

We plan on shipping EL8 with NodeJS 14 for Foreman 3.10 so it will be nice to testing that. Otherwise you may pull in dependencies that are Node 14 incompatible.

That makes me wonder: why is this snapshot changing? Are there also effects on the end user because of this? If not, what is the test really proving?

@MariaAga
Copy link
Member Author

That makes me wonder: why is this snapshot changing? Are there also effects on the end user because of this? If not, what is the test really proving?

Node has changes how dates are in strings, so instead of , there is at now, but the date is the same and thats what we test.

@ekohl
Copy link
Member

ekohl commented Feb 16, 2024

Digging a bit deeper, it's nodejs/node#45945 but I think at runtime toLocaleString uses the browser API, not NodeJS. So it doesn't really matter for end users. Though it does matter for our tests.

Is there a way to provide a NodeJS version dependent snapshot? Would that make sense?

@MariaAga
Copy link
Member Author

We can probably do that with setting different paths for snapshots for different versions. Are we planning to test and actively support node 14 or just leave it as an option?

@ekohl
Copy link
Member

ekohl commented Feb 16, 2024

Are we planning to test and actively support node 14 or just leave it as an option?

As I said in #10016 (comment), we'll have it at least for Foreman 3.10 so I'd prefer to have testing for it too.

@MariaAga MariaAga force-pushed the webpack5-module-federations-node18 branch from 17dc76d to 89ed7ab Compare February 19, 2024 10:26
@MariaAga
Copy link
Member Author

MariaAga commented Feb 19, 2024

updated snapshots to be conditional

@ofedoren
Copy link
Member

@MariaAga, needs rebase :/

@MariaAga MariaAga force-pushed the webpack5-module-federations-node18 branch from f42c9e3 to b5169b1 Compare February 21, 2024 14:03
@@ -1,5 +1,5 @@
{
"postgresql": ["12"],
"ruby": ["2.7", "3.0"],
"node": ["14"]
"node": ["18"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be both 14 and 18 now:

Suggested change
"node": ["18"]
"node": ["14", "18"]

@MariaAga MariaAga force-pushed the webpack5-module-federations-node18 branch from b5169b1 to 55fb49d Compare February 27, 2024 10:33
ekohl
ekohl previously approved these changes Feb 27, 2024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recently I noticed we also have https://theforeman.org/contribute.html#SupportedNode.jsversions and I realized we also need to update that for Ruby. Isn't duplication great?

@ekohl
Copy link
Member

ekohl commented Feb 27, 2024

Waiting for the container build to finish, but I think this is ready to merge now.

evgeni
evgeni previously approved these changes Feb 27, 2024
developer_docs/foreman_dev_setup.asciidoc Outdated Show resolved Hide resolved
@MariaAga MariaAga dismissed stale reviews from evgeni and ekohl via bb76e86 February 27, 2024 13:16
@MariaAga MariaAga force-pushed the webpack5-module-federations-node18 branch from 55fb49d to bb76e86 Compare February 27, 2024 13:16
@evgeni evgeni merged commit 30f93cc into theforeman:develop Feb 29, 2024
51 of 54 checks passed
@ekohl
Copy link
Member

ekohl commented Mar 1, 2024

@evgeni we should pick this to 3.10 too, right?

@evgeni
Copy link
Member

evgeni commented Mar 1, 2024

@evgeni we should pick this to 3.10 too, right?

Given we publish EL9 packages that use NodeJS 18 it would be formally correct to do that, yes.

@ekohl
Copy link
Member

ekohl commented Mar 1, 2024

642f772

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants