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

chore: Upgrades lockfile to version 3 #567

Merged
merged 5 commits into from
Apr 9, 2024
Merged

Conversation

tuliomir
Copy link
Collaborator

@tuliomir tuliomir commented Mar 28, 2024

Summary

This PR continues the work made on #501 and upgrades the application lockfile, dealing with incompatibilities that arise from the upgrade.

Prior to this PR, the npm install command could only be run on Node 14. If a developer tried to tun npm install on Node 20 the whole lockfile would be rebuilt and compatibility errors would occur if any other dependency was changed.

Steps description

We were not able to upgrade this file previous to #555 because of an incompatibility in one of the subdependencies of the React Router.

The first step was to only upgrade the lockfile version without changing any of its dependencies, which was done using npm install --lockfile-version 3 command. ( e603860 )

The next step was to actually run npm install on Node 20, which prompted many changes to the lockfile to respect the new environment. This command was previously run only on Node 14. ( 813bf7f ).

As a consequence, the pot translation files failed and had to be updated using make update_pot ( 5e362c4 )

Lastly, react-scripts began to fail all jest tests, because react-scripts v4 requires Jest v26 and our React 18 tests require Jest v29. We tried using the SKIP_PREFLIGHT_CHECK=true flag to allow the version mismatch not to break the CI, but it utimately broke the test run itself. Another approach would be to rewrite the tests using an older version of the react testing library.

Since the tests were still on a stub implementation that do not improve our quality control, they were disabled until we can upgrade react-scripts, as described on #441. ( 704148f )

Acceptance Criteria

  • package-lock.json should be upgraded to v3
  • Running npm install on a development environment should not change the contents of package-lock.json

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@tuliomir tuliomir added the dependencies Pull requests that update a dependency file label Mar 28, 2024
@tuliomir tuliomir self-assigned this Mar 28, 2024
@tuliomir tuliomir force-pushed the chore/update-lockfile branch 2 times, most recently from e150bc0 to 491cd4d Compare April 3, 2024 15:56
The @testing-library/[email protected] dep
had to be removed because of an
incompatibility with react-scripts
locale/texts.pot Show resolved Hide resolved
@tuliomir tuliomir merged commit 4480277 into master Apr 9, 2024
1 check passed
@tuliomir tuliomir deleted the chore/update-lockfile branch April 9, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants