[CDX-610] fix react-compat ci failing - #57
Conversation
There was a problem hiding this comment.
Code Review
This PR fixes the react-compat CI workflow by switching from npm ci to npm install --package-lock=false, correctly addressing the root cause: npm ci fails when the local tarball dependency is regenerated on each CI run and no longer matches the committed lock file hash.
Inline comments: 1 discussion added
Overall Assessment:
| - name: Install fixture deps | ||
| working-directory: test/react-compat/${{ matrix.react-major }} | ||
| run: npm ci --no-audit --no-fund | ||
| run: npm install --no-audit --no-fund --package-lock=false |
There was a problem hiding this comment.
Important Issue: Switching to npm install --package-lock=false resolves the immediate npm ci failure, but it fully bypasses lock-file pinning for all transitive dependencies (not just the local tarball). This means every CI run resolves the latest versions of all deps from the registry, which can introduce silent breakages from transitive dependency upgrades.
A more precise fix would be to use npm install --no-audit --no-fund (without --package-lock=false) and ensure the fixture package-lock.json files do not commit a resolved entry for the local tarball path. Alternatively, you can keep --package-lock=false but add a --prefer-offline flag and a caching step so at least the registry packages are stable between runs.
If the intent is specifically to avoid npm ci failing due to the regenerated tarball hash, consider using npm ci --ignore-scripts combined with a separate npm install <local-tarball> step, or patching the lock file before running npm ci (e.g., npm install --package-lock-only to regenerate the lock file before npm ci).
The current change is pragmatic and unblocks CI, but the lack of lock-file enforcement for transitive deps reduces reproducibility for a test matrix that exists specifically to catch subtle compatibility issues.
There was a problem hiding this comment.
Good point. But this is not an issue here cause we are using exact versions of a libraries so everything will be fine
There was a problem hiding this comment.
Pull request overview
Adjusts the React compatibility GitHub Actions matrix workflow to avoid fixture dependency installation failures when testing against a locally packed @constructor-io/constructorio-ui-components tarball.
Changes:
- Switches fixture dependency installation from
npm citonpm installin thereact-compatworkflow. - Adds a flag to disable lockfile usage during fixture installs.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - name: Install fixture deps | ||
| working-directory: test/react-compat/${{ matrix.react-major }} | ||
| run: npm ci --no-audit --no-fund | ||
| run: npm install --no-audit --no-fund --package-lock=false |
There was a problem hiding this comment.
npm install still reads the lock file and enforces its integrity hashes. So it fails with the same EINTEGRITY error as npm ci when the tarball hash doesn't match.
Pull Request Checklist
Before you submit a pull request, please make sure you have to following:
PR Type
What kind of change does this PR introduce?
react-compattest