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

[IOCOM-181] Migrate node 18 #141

Merged
merged 12 commits into from
Apr 27, 2023
Merged

[IOCOM-181] Migrate node 18 #141

merged 12 commits into from
Apr 27, 2023

Conversation

Garma00
Copy link
Contributor

@Garma00 Garma00 commented Apr 26, 2023

List of Changes

Motivation and Context

End of life Node 18

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@github-actions
Copy link

Jira Pull Request Link

This Pull Request refers to the following Jira issue IOCOM-181

Copy link
Contributor

@arcogabbo arcogabbo left a comment

Choose a reason for hiding this comment

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

LGTM apart a detail.

src/index.ts Outdated
@@ -109,7 +109,8 @@ const withSpidAuthMiddleware = (
res: express.Response,
next: express.NextFunction
): void => {
passport.authenticate("spid", async (err, user) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
passport.authenticate("spid", async (err: any, user: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the types can be inserted here.

Choose a reason for hiding this comment

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

Passport types are not that good. If you go and see all strategies it's a mess of any types for callbacks and fullfill functions. I would just not throw away too much time searching the types. The were inplicit any before, now they are explicit. There's not too much difference.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can use unknown instead of any. It's compatible with the current implementation and we don't have to disable the linter.

Copy link

@michaeldisaro michaeldisaro left a comment

Choose a reason for hiding this comment

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

LGTM

src/index.ts Outdated
@@ -109,7 +109,8 @@ const withSpidAuthMiddleware = (
res: express.Response,
next: express.NextFunction
): void => {
passport.authenticate("spid", async (err, user) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
passport.authenticate("spid", async (err: any, user: any) => {

Choose a reason for hiding this comment

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

Passport types are not that good. If you go and see all strategies it's a mess of any types for callbacks and fullfill functions. I would just not throw away too much time searching the types. The were inplicit any before, now they are explicit. There's not too much difference.

Copy link
Contributor

@BurnedMarshal BurnedMarshal left a comment

Choose a reason for hiding this comment

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

Some small changes

src/index.ts Outdated
@@ -109,7 +109,8 @@ const withSpidAuthMiddleware = (
res: express.Response,
next: express.NextFunction
): void => {
passport.authenticate("spid", async (err, user) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
passport.authenticate("spid", async (err: any, user: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use unknown instead of any. It's compatible with the current implementation and we don't have to disable the linter.

yarn.lock Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

We can upgrade the yarn.lock more selectively. The only required upgrade are:

typescript@^4.9.5
node-redis-mock@^0.2.14 // remove
mock-redis-client@^0.91.13 // remove
io-ts@2.2.20, io-ts@^2.2.16
io-ts-types@^0.5.16
  version "0.5.19" // upgrade
fp-ts@2.13.1, fp-ts@^2.11.0
"@types/node@~18.13.0"
"@pagopa/ts-commons@^11.0.0"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BurnedMarshal During those migrations to Node 18 we are regenerating the yarn.lock in order to upgrade all the libraries, I would do the same here for consistency, what's your take?

Copy link
Contributor

@BurnedMarshal BurnedMarshal Apr 27, 2023

Choose a reason for hiding this comment

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

Ok. But it's a risky operation. Can we run locally this library (using the docker compose) and try to complete a login process?
Even delete this folder (unused now).

@sonarcloud
Copy link

sonarcloud bot commented Apr 27, 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

Copy link
Contributor

@BurnedMarshal BurnedMarshal left a comment

Choose a reason for hiding this comment

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

LGTM

@Garma00 Garma00 merged commit 5b36b89 into master Apr 27, 2023
@Garma00 Garma00 deleted the migrate-node branch April 27, 2023 14:09
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.

4 participants