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

Include yarn and node versions in yarn.lock #3265

Merged
merged 1 commit into from
May 8, 2017

Conversation

christopherstott
Copy link
Contributor

Sometimes it is helpful for automated tooling to know the version of
yarn and nodejs that was used in the environment that last modified the
yarn.lock file.

For example, this allows CI platforms to automatically ensure the
same versions of yarn and node are used in CI as locally.

This functionality can be disabled by adding to .yarnrc
yarn-disable-lockfile-versions true

Summary

Test plan

Sometimes it is helpful for automated tooling to know the version of
yarn and nodejs that was used in the environment that last modified the
yarn.lock file.

For example, this allows CI platforms to automatically ensure the
same versions of yarn and node are used in CI as locally.

This functionality can be disabled by adding to .yarnrc
  yarn-disable-lockfile-versions true
@christopherstott
Copy link
Contributor Author

Looks like AppVeyor failed in an potentially unrelated way. Could this be a flakey test? Otherwise I can track down a windows machine to try this out on.

@christopherstott
Copy link
Contributor Author

Also - I'd love any suggestions for how to add tests for the .yarnrc behaviour

@orta orta mentioned this pull request May 5, 2017
@bestander bestander merged commit 525ce9c into yarnpkg:master May 8, 2017
@SimenB
Copy link
Contributor

SimenB commented May 13, 2017

Can this please be disabled by default? I can see for some projects it might be sorta useful, but the churn in PRs to make everybody disable it (or forced to add yet another dotfile to all my repos, this time to disable some weird behaviour I don't want) makes me a sad panda.

@SimenB
Copy link
Contributor

SimenB commented May 13, 2017

Does this also in practice makes using --pure-lockfile and testing on multiple versions of node impossible, or does pure lockfile compare just the dependency part?

@bestander
Copy link
Member

bestander commented May 19, 2017

Thanks for raising this @SimenB, I had similar reservations.

Anyone has an idea how to make this a better experience?
I think this will totally be a problem for merging PRs for popular OSS projects.

Maybe don't downgrade version in yarn.lock?
I.e. if this lockfile worked on 0.25.0 then if someone sends an updated generated in 0.24.0 then there is no need to update the version?

@SimenB
Copy link
Contributor

SimenB commented May 20, 2017

I'm more concerned about the node version. I like to use just the LTS version of node, but lots of people use node 7 because of async functions (and just running brew install node or whatever) which will be quite noisy. Also, lots of different minors and patch versions out there. The same thing is probably an issue for yarn versions.

What about never changing any of them without an explicit flag for it? So add it first time, then don't touch it without the user being explicit

@raido
Copy link
Contributor

raido commented May 26, 2017

This is not cool. In my team we have PR based workflow and this just is a lot of churn. This should be opt-in only instead of opt-out. I would like to revert the configuration name and logic that handles it to be opt-in.

Basically all the larger projects that upgrade to Yarn 0.25 will have this churn.

Workaround is to disable it but if you have many projects that's another churn, because it seems obvious that default patterns should not require configuration.

@bestander
Copy link
Member

bestander commented May 26, 2017 via email

@raido
Copy link
Contributor

raido commented May 26, 2017

I am not sure what type of compromise there could be. Having dynamic data as Yarn and Node versions in lockfile which will differ on each developer machine is not possible. It just causes merge conflicts and noise in commits as unrelated changes.

@bestander
Copy link
Member

@christopherstott and everyone, I've merged the reverse of logic where this feature is now opt-in.

I understand that this feature would help CI systems to match Yarn version to lockfile but side effects, i.e. merge conflicts make developer experience with Yarn noticeably worse.

Open to find some compromise that would work for both.

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

4 participants