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

fix: force CI to freeze yarn lockfile #2

Merged
merged 3 commits into from
Feb 5, 2020
Merged

Conversation

amcgee
Copy link
Member

@amcgee amcgee commented Feb 5, 2020

Running yarn install does not respect the local lock-file, since it can overwrite it if there's a version mismatch somewhere. Running yarn install --frozen-lockfile. This is a bit of a misconfiguration of yarn's defaults, in my opinion, but we should at least do the right thing in CI

@amcgee amcgee requested a review from varl February 5, 2020 16:15
@amcgee
Copy link
Member Author

amcgee commented Feb 5, 2020

In our repos we might want to set this to the default in .yarnrc too, as mui has

@varl
Copy link
Contributor

varl commented Feb 5, 2020

In our repos we might want to set this to the default in .yarnrc too, as mui has

Good point. We could add that to a preset in d2-style as well.

@amcgee amcgee merged commit c68cdb9 into dhis2:master Feb 5, 2020
@amcgee amcgee deleted the patch-2 branch February 5, 2020 17:14
@k0pernikus
Copy link

@varl @amcgee I don't recommend using the setting in .yarnrc. Rather use it as a flag via yarn install --frozen-lockfile.

If your package.json and yarn.lock become out of sync, there's no command available to sync them again when you have it in the .yarnrc file. (You'd think yarn install --force would do that, but that's not the case.) You'd have to edit the .yarnrc temporarly, run yarn install, and reenable the setting in the .yarnrc. It's a messy process and can cause quite a few headaches. (I've been there.)

See this issue: yarnpkg/yarn#4570

@amcgee
Copy link
Member Author

amcgee commented Feb 13, 2020

Thanks @k0pernikus for the heads-up! We're still using --frozen-lockfile here as well.

@varl
Copy link
Contributor

varl commented Feb 14, 2020

Thanks @k0pernikus, indeed I would expect that --force to override .yarnrc. There is benefit to being explicit about what flags are passed to the commands as well, so we are keeping --frozen-lockfile here. 👍

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

Successfully merging this pull request may close these issues.

None yet

3 participants