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

yarn should run with --pure-lockfile #7395

Closed
domoritz opened this issue Feb 27, 2017 · 28 comments · Fixed by travis-ci/travis-build#1858
Closed

yarn should run with --pure-lockfile #7395

domoritz opened this issue Feb 27, 2017 · 28 comments · Fixed by travis-ci/travis-build#1858
Assignees

Comments

@domoritz
Copy link

Without this option travis might overwrite the lockfile and it's hard to catch if the lockfile is out of date.

@BanzaiMan
Copy link
Contributor

It seems best to override the default command in that case.

@BanzaiMan
Copy link
Contributor

There was another person who wanted this as well.

@Daniel15 Do you have opinions on this?

@edmorley
Copy link

edmorley commented Mar 11, 2017

I was about to file an issue for this -- though I'd recommend using --frozen-lockfile instead, since it's closer to the desired effect (catch accidental config drift and quickly identify root cause). (Whereas --pure-lockfile uses yarn.lock regardless of whether it's out of date, and ignores package.json.)

The description from yarn help install...

--no-lockfile                   don't read or generate a lockfile
--pure-lockfile                 don't generate a lockfile
--frozen-lockfile               don't generate a lockfile and fail if an update is needed

@BanzaiMan BanzaiMan self-assigned this Mar 16, 2017
@BanzaiMan
Copy link
Contributor

OK. We'll move to --frozen-lockfile.

@Daniel15
Copy link

This sounds reasonable to me. @bestander @kittens What do you think?

@bestander
Copy link

Agree

@BanzaiMan
Copy link
Contributor

Reopening this since we've received some error reports and reverted the fix.

@BanzaiMan BanzaiMan reopened this Mar 23, 2017
@BanzaiMan
Copy link
Contributor

A use case travis-ci/travis-build#997 (comment) raised was that Greenkeeper trying to update dependencies.

At the moment, the only flag we use for installing yarn (when it is not available on the image) is the presence of yarn.lock, so this puts such a use case in a conundrum. Though they can override install to overcome it, I think it is best to wait until all the build images have a recent version of yarn pre-installed.

@BanzaiMan
Copy link
Contributor

On a second thought, the greenkeeper case is one where the user should override install. Eventually.

@BanzaiMan
Copy link
Contributor

BanzaiMan commented Mar 23, 2017

There was also a case where a pre-installed yarn flagged the build script to not install the latest version of yarn, where --frozen-lockfile was not available.

That should be accounted for.

@itsdouges
Copy link

itsdouges commented Mar 24, 2017

Hey!

I'm getting an error error: unknown option --frozen-lockfile' when running with docker service (turning it off makes it work!):

services:
  - docker

Any ideas?

Heres my build: https://travis-ci.org/madou/armory-back/builds/214476264

itsdouges pushed a commit to itsdouges/armory-services that referenced this issue Mar 24, 2017
@ismay
Copy link

ismay commented Mar 24, 2017

@Madou So yarn is currently broken when also using docker services on travis? Because my builds are also failing with error: unknown option --frozen-lockfile'...

See: https://travis-ci.org/forecastxl/prototype/builds/214613995

@bestander
Copy link

bestander commented Mar 24, 2017 via email

@ismay
Copy link

ismay commented Mar 24, 2017

What version do you use?

@bestander Just the version that travis installs automatically (when a yarn.lock is present)

@itsdouges
Copy link

itsdouges commented Mar 24, 2017

@bestander as @ismay said, looks like we're both using whatever travis installs.

@ismay seems like it.

when I turned it off (see: https://travis-ci.org/madou/armory-back/jobs/214557773) it got past the install dependencies stage.

weird stuff!

@ismay
Copy link

ismay commented Mar 24, 2017

@Madou Yeah. Seems like yarn --frozen-lockfile is now run by default on travis builds for repos with a yarn.lock, but apparently with an outdated version of yarn which doesn't support that option?

Can't find a reference to the version of yarn that's being used in the build log though. Also weird that enabling docker makes it fail..

@itsdouges
Copy link

in retrospect maybe its sudo: true. can't play with travis atm to find out though :-).

@BanzaiMan
Copy link
Contributor

@ismay

Seems like yarn --frozen-lockfile is now run by default on travis builds for repos with a yarn.lock, but apparently with an outdated version of yarn which doesn't support that option?

See travis-ci/travis-build#997 and the comments.

We have reverted this change, so restarting the failing jobs should work.

@itsdouges
Copy link

@BanzaiMan do you need to do something special for the jobs that use sudo? because it still isn't working.

see build I just ran: https://travis-ci.org/madou/armory-back/builds/214563501

@ismay
Copy link

ismay commented Mar 24, 2017

@BanzaiMan @Madou

We have reverted this change, so restarting the failing jobs should work.

Not for me, I've restarted the build several times, but it keeps failing. I'm not installing my own version of yarn, so the installation of yarn is being handled by travis: https://travis-ci.org/forecastxl/prototype/builds/214613995#L311

@BanzaiMan
Copy link
Contributor

@Madou @ismay I am so sorry about that. It is now deployed. Please restart your builds again.

@ismay
Copy link

ismay commented Mar 24, 2017

@BanzaiMan That did it for me, thanks for the quick fix!

@itsdouges
Copy link

Thanks @BanzaiMan !

@stale
Copy link

stale bot commented Apr 13, 2018

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Apr 13, 2018
@stale stale bot closed this as completed Apr 14, 2018
@mmermerkaya
Copy link

Can you reconsider this?

More than a year has passed and the default Yarn version has supported --frozen-lockfile for a while now.

@bestander
Copy link

bestander commented May 5, 2018 via email

@mmermerkaya
Copy link

Thanks! There's a somewhat similar issue about NPM's lock file, but I commented here because I couldn't find any other open issue about this for Yarn.

@chocolateboy
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants