-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add optional offline mirror pruning #2836
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
Conversation
| const requiredTarballs = new Set(); | ||
| for (const dependency in lockfile) { | ||
| const resolved = lockfile[dependency].resolved; | ||
| if (resolved) { |
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.
I'm not sure if it is okay to depend on the format of resolved like this.
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.
The tests would fail if there are breaking changes.
I suppose it should be fine.
|
Looks nice, how about a test for add command as well? |
|
Tests seem to fail for some other reason |
|
Yep, I considered adding a test for add as well, but I couldn't come up with a situation where pruning would apply. Maybe there's some uncommon semver combination that I haven't thought of? If not, should I just copy over the upgrade test fixture and use that? So it would simulate: The tests fail for me locally as well, but the last I tried, the same tests failed on the master branch. I attributed the failures to flakiness, but would you like me to dig into them? |
|
I think you are right, |
|
@dguo, could you rebase please? |
|
Sure, I can rebase tonight when I'm at my computer again.
I'm happy to send a PR for docs, but I didn't see an existing section on
the website for the offline mirror feature. Could you point me to the right
place?
On Mar 7, 2017 10:16 AM, "Konstantin Raev" <notifications@github.com> wrote:
@dguo <https://github.com/dguo>, could you rebase please?
And also could you send a PR to the docs website?
Otherwise no one will ever know about this feature.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2836 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACopf7lswwRmNKuAKDbkK3OsuNSRCExoks5rjXSfgaJpZM4MTTWa>
.
|
|
I think we only have a bog post
https://yarnpkg.com/blog/2016/11/24/offline-mirror/
Would you create a new section in the Docs please?
We'll convert the blog post into the doc after that.
…On 7 March 2017 at 17:31, Danny Guo ***@***.***> wrote:
Sure, I can rebase tonight when I'm at my computer again.
I'm happy to send a PR for docs, but I didn't see an existing section on
the website for the offline mirror feature. Could you point me to the right
place?
On Mar 7, 2017 10:16 AM, "Konstantin Raev" ***@***.***>
wrote:
@dguo <https://github.com/dguo>, could you rebase please?
And also could you send a PR to the docs website?
Otherwise no one will ever know about this feature.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2836 (comment)>, or
mute
the thread
<https://github.com/notifications/unsubscribe-auth/
ACopf7lswwRmNKuAKDbkK3OsuNSRCExoks5rjXSfgaJpZM4MTTWa>
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2836 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWEcRF-4ESPxN8XvwQX-ukm86AgjOks5rjZSPgaJpZM4MTTWa>
.
|
316b914 to
3779a94
Compare
|
Ok, it's rebased, the tests passed, and I submitted yarnpkg/website#409 for the docs. |
|
Great job on pushing through the whole feature from RFC to great implementation with tests and docs, @dguo! |
|
Thank you! |
|
Wow, awesome! I'm participating in a hackathon today and this was actually the first thing I was gonna work on (I submitted the original issue), but I'm happy to see it's already done. Thanks @dguo! Also, re: the tests and not having a test for So, I think it'd be good to add a test case for this scenario: start with a lockfile and a mirror that has more tarballs than what's in the lockfile, run We could also add a similar test for running |
|
Is there any chance this could make it into a (pre-)release soon? |
|
Yeah, we'll cut the branch mid next week
…On Fri, 31 Mar 2017 at 23:34, rmacklin ***@***.***> wrote:
Is there any chance this could make it into a (pre-)release soon?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#2836 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACBdWPHB9qiMEqnvmfwbMRvZX1QOwnkaks5rrX9egaJpZM4MTTWa>
.
|
|
Awesome, and thanks for the speedy reply! |
Summary
This change is an implementation of yarnpkg/rfcs#49, which stems from #2109.
Test plan
I tested the feature locally with two scenarios where
.yarnrchasyarn-offline-mirror-pruningset totrue:$ yarn add is-positive-integer@1.0.0is-positive-integertarball, along with all its dependencies$ yarn upgrade is-positive-integer@1.1.1is-positive-integer, which doesn't have any dependencies$ yarn add left-pad right-padleft-padandright-padtarballs$ yarn remove left-padright-padI also added two Jest test cases, one for upgrade and one for remove. They verify that sub-dependencies are also pruned.
For documentation, I'd be happy to submit a pull request for that as well, but I don't see any for the offline mirror feature on the main Yarn website. I've just been referencing this blog post.