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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass --frozen-lockfile to yarn in CI environments #20022

Merged
merged 1 commit into from
Jan 16, 2018
Merged

Conversation

joshlory
Copy link
Contributor

From https://yarnpkg.com/lang/en/docs/cli/install/:

If you need reproducible dependencies, which is usually the case with the continuous integration systems, you should pass --frozen-lockfile flag.

Sample failure:

yarn install v0.23.2
[1/4] 馃攳  Resolving packages...
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

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

Adding this check LGTM.

Should we also remove our manual check for yarn.lock changes here?

# Changes to yarn.lock is a particularly common case; catch it early and
# provide a helpful error message.
if RakeUtils.git_staged_changes? apps_dir 'yarn.lock'
Dir.chdir(apps_dir) do
RakeUtils.system_stream_output('git diff yarn.lock | cat')
end
raise 'Unexpected change to apps/yarn.lock; if you changed package.json you should also have committed an updated yarn.lock file.'
end

@joshlory
Copy link
Contributor Author

I'm not confident enough yet to remove this secondary safeguard 馃槃.

@joshlory joshlory merged commit 327be7c into staging Jan 16, 2018
@joshlory joshlory deleted the ci-frozen-lockfile branch January 16, 2018 21:29
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.

None yet

2 participants