-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix Travis CI not detecting uncommitted changes to package-lock.json #13462
Conversation
From https://docs.npmjs.com/cli/ci.html:
Do we just need to be handling the failing exit? |
TIL. Moving the command to |
`npm run check-local-changes` was not detecting uncommited changes to `package-lock.json` because Travis CI was set to ignore nonzero exit codes coming from `npm ci`
a5f8c07
to
1254bb9
Compare
I don't think we want that in |
Can we land lock file changes first? :) |
@ntwb From those texts, it begs the question then: Why isn't it currently failing, if |
I created #13613 to test the above, it is working as expected for me with the current The job errors when there is a change in $ nvm install --latest-npm
Found '/home/travis/build/WordPress/gutenberg/.nvmrc' with version <lts/*>
Downloading and installing node v10.15.1...
Local cache found: $NVM_DIR/.cache/bin/node-v10.15.1-linux-x64/node-v10.15.1-linux-x64.tar.xz
Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v10.15.1-linux-x64/node-v10.15.1-linux-x64.tar.xz
Now using node v10.15.1 (npm v6.4.1)
Attempting to upgrade to the latest working version of npm...
0: command not found
0: command not found
* Installing latest `npm`; if this does not work on your node version, please report a bug!
/home/travis/.nvm/versions/node/v10.15.1/bin/npm -> /home/travis/.nvm/versions/node/v10.15.1/lib/node_modules/npm/bin/npm-cli.js
/home/travis/.nvm/versions/node/v10.15.1/bin/npx -> /home/travis/.nvm/versions/node/v10.15.1/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.7.0
added 52 packages from 7 contributors, removed 13 packages and updated 41 packages in 6.522s
* npm upgraded to: v6.7.0
0.66s$ npm ci
npm ERR! cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm ERR!
npm ERR!
npm ERR! Invalid: lock file's lerna@3.4.3 does not satisfy lerna@3.10.7
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /home/travis/.npm/_logs/2019-01-31T10_59_39_229Z-debug.log
The command "npm ci" failed and exited with 1 during .
Your build has been stopped. I tried to add I'm not sure why the original issue where this issue was detected did not work, but in my testing which was to use only a modified |
From readings of the documentation and prior testing, it seems like this should already be working as intended, or at least the change proposed here would likely not have an impact. The specific fix to |
Fixes issue identified in #12378 (comment).
npm run check-local-changes
was not detecting uncommited changes topackage-lock.json
because Travis CI was set to usenpm ci
instead ofnpm install
.Having Travis cache
node_modules
ensures that there is no regression of CI performance, see #13103 (comment).