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

Only update the specified shards #58

Closed
ysbaddaden opened this issue Sep 28, 2015 · 8 comments · Fixed by #259
Closed

Only update the specified shards #58

ysbaddaden opened this issue Sep 28, 2015 · 8 comments · Fixed by #259
Milestone

Comments

@ysbaddaden
Copy link
Contributor

It would be nice to be able to only update a specified set of shards, instead of everything. The update command would also do its best to only update nested dependencies to satisfy new requirements, keeping as much as possible the locked versions.

$ shards update mock
Using library
Using extra
Updating mock
@ysbaddaden ysbaddaden added this to the v1.0.0 milestone Sep 28, 2015
@waj
Copy link
Member

waj commented Mar 24, 2016

In Bundler, if the version of a gem is changed in the Gemfile, a bundle install would update the version of that gem without requiring a bundle update, unless it requires changing the version of other gems.

In other words, install always feel more "safe" in terms of not changing what's not needed. And I just use update to get the latest version of one or more gems still matching the versions specified in the Gemfile.

Don't you think we should mimic that behaviour? I guess it would require saving the version specification in the shard.lock too, so install could figure out which versions were changed in the shard.yml.

@ysbaddaden
Copy link
Contributor Author

I don't recall such a behaviour in Bundler. I always have to run bundle update when I change a dependency version —maybe because they will update other dependencies.

I think I prefer to have install to always install the locked versions, and then have update to update the locked versions of one or many dependencies, with maybe a flag to avoid resolving recursively.

@waterlink
Copy link

Yeah, bundle install installs only new added dependencies and all currently locked ones. bundle update updates all dependencies. And bundle update <NAME> updates only specific dependency.

@waj
Copy link
Member

waj commented Mar 24, 2016

I think the rationale is: if you change the version in the Gemfile, the version is now unlocked. That's why bundle install will update the version without asking for update.

@waterlink: bundle update <NAME> also updates the version of the recursive dependencies. If you have a stable project, you want to change as little as possible. That's why I think the behaviour of bundle install should be available, either with a flag in update or copying the Bundler's install.

I cannot make my mind with this yet, because I like the @ysbaddaden statement, of making install not changing locked versions, but after many years of Ruby development I always try to use update with care, only when needed.

@waterlink
Copy link

@waj Wouldn't the behavior of bundle install when changing version in Gemfile, update its dependencies too? (at least, if the requirements of the gem itself have changed in the newer version).

@waj
Copy link
Member

waj commented Mar 24, 2016

@waterlink: if the change in the Gemfile requires to update other gems stated in the Gemfile too, then you're forced to update.

It seems Bundler will unlock the gem changed in the Gemfile and other dependencies of that gem (not in the Gemfile) and will try to update with that. If the dependencies cannot be satisfied, then you're forced to update.

@waterlink
Copy link

Yeah, that is exactly how it works

@kostya
Copy link

kostya commented Oct 9, 2016

👍 when shards count > 10, it very slow when need to update 1 shard often.

@ysbaddaden ysbaddaden mentioned this issue Jan 29, 2019
@ysbaddaden ysbaddaden modified the milestones: v1.0.0, v0.9.0 Feb 3, 2019
ysbaddaden added a commit that referenced this issue Feb 9, 2019
ysbaddaden added a commit that referenced this issue Feb 9, 2019
ysbaddaden added a commit that referenced this issue Feb 9, 2019
taylor pushed a commit to vulk/shards that referenced this issue Aug 11, 2020
f-fr pushed a commit to f-fr/shards that referenced this issue Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants