-
Notifications
You must be signed in to change notification settings - Fork 400
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
use yarn.lock when building the apps #5897
Conversation
Codecov Report
@@ Coverage Diff @@
## master mozilla/addons-frontend#5897 +/- ##
=======================================
Coverage 97.72% 97.72%
=======================================
Files 229 229
Lines 5858 5858
Branches 1123 1123
=======================================
Hits 5725 5725
Misses 118 118
Partials 15 15 Continue to review full report at Codecov.
|
9e86bc4
to
50758e0
Compare
I cannot make the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if I'm missing something but I don't think this solves https://github.com/mozilla/addons-frontend/issues/3034 (I just updated its description btw). Aside from not solving the issue, I don't see any benefit to adding --pure-lockfile
.
As far as I can tell, --pure-lockfile
only stops yarn install
from generating a lock file, that's it. I cloned the repo in a temp directory, edited the version of a dependency in package.json, and ran
yarn install --pure-lockfile
. It still tried to install the new dependency version from package.json
.
Maybe we need --frozen-lockfile
? I think that will fail if package.json
is introducing new modules/versions. Getting a failure like this in production/dev/stage is too late, though.
Anyway, I'm not convinced that either option will solve this part of https://github.com/mozilla/addons-frontend/issues/3034 :
A production install should never upgrade a package (or its dependencies) beyond what's in our lock file.
A lock file will always contain loose sub-dependency versions if the package author declared them as such. This means those packages could get silently upgraded in production and that's what I want to avoid.
I think we need to consider a new approach. We either need an offline mirror or something like shrinkwrap.
It is not clear to me what this option does actually. I re-read the GH issues and it now seems pointless: I don't understand why people keep mentioning it when it comes to looking for "how to install dependencies according to the lock file?". Anyway...
That sounds like the correct behavior to me given that you change the Both files should be synchronized, and that's why we keep pushing
Adding such an option on Travis means we can stop using Greenkeeper because all PRs will be red :/ We could potentially add a Travis job for builds on
I tend to disagree: that will be the case with this PR given that it adds the
Offline mode is probably too much honestly, we would have to commit 50-60MB of We currently don't use the The second part could be fixed by running WDYT? |
@willdurand Do we need to keep this PR open, or are we looking at other alternatives to solve the issue? |
I think it should stay open until I get the chance to talk to @kumar303 about it again, hopefully I'll have an update by the end of this week. |
Sorry for missing the last comment. I'll come back to this requirement again:
You mentioned in the last comment that your patch will fix this. How? Let's take Line 184 in 9f14a30
But in the lock file, its dependency on Lines 4992 to 4997 in 9f14a30
What if an attacker hacks an account and publishes |
I also just realized that I worded this incorrectly. What I mean is to never upgrade any sub-dependency beyond its version that existed at the time we pinned the top-level dependency. We accomplish this in Python by pinning all package versions (even sub-dependencies) and installing the requirements with |
@kumar303 mainly by using the According to this issue,
Offline mirror is probably the feature that allows that: https://yarnpkg.com/blog/2016/11/24/offline-mirror/. To sum up, I really think we need that |
I agree. If you want to merge your patch as is then that's fine with me. I don't think it should close mozilla/addons#10714 but you could make another issue to track it like "Make deploy builds more predictable with
I intended mozilla/addons#10714 to be that issue and I think the bullet point about making sure no packages can be upgraded captures that intent. I will update the issue to clarify what I meant in that sentence. |
@kumar303 alrighty, updated PR title/desc. and created a different issue. r? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix mozilla/addons#12327