Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Add bundle package functionality to bundle cache #7249

Merged
5 commits merged into from
Jul 20, 2019

Conversation

deivid-rodriguez
Copy link
Member

What was the end-user problem that led to this PR?

The problem was that the previous plan provided no migration path from the current bundle cache to the future one (an alias to bundle package).

What was your diagnosis of the problem?

My diagnosis was that we should probably tell users first that in bundler 3, bundle cache will have a different implementation. However, after playing around with it a bit, I noticed that the additions to bundle cache provided by bundle package are fully backwards compatible. Or maybe I'm missing something but at least all bundle cache tests still pass when changing the implementation under the hood to use bundle package. As far as I can see, the only backwards incompatible change (start caching git and path gems by default) is already covered by the exisiting cache_all flag), so we should be good.

What is your fix for the problem, implemented in this PR?

My fix is to remove the current implementation of bundle cache, and replace it with the current implementation of bundle package.

Why did you choose this fix out of the possible options?

I chose this fix because it allows us to remove code and it reduces confusion about bundle cache vs bundle package making them work exactly the same.

On a future PR, I plan to clean this up so that everything (docs, code, tests) use bundle cache, and bundle package is left only as an alias.

This is inside a code branch where the condition is already met.
Just change the default. The reason to do this is that the deprecation
message talks about the default being changed, not the option being
removed.
So that we handle the removal of `bundle cache` just like we'll handle
the removal of `bundle show` and `bundle console`.
The additions of the `package` command are not actually backwards
incompatible, so we can do this transition without further care. All
existing specs of `bundle cache` pass when using the `bundle package`
implementation for it.
@deivid-rodriguez
Copy link
Member Author

Thoughts about this, @indirect? I was a bit confused by the changes that were going happen here, I think this makes the transition simpler.

@indirect
Copy link
Member

Oh! That's awesome, thank you for this. :)

@bundlerbot r+

ghost pushed a commit that referenced this pull request Jul 20, 2019
7249: Add `bundle package` functionality to `bundle cache` r=indirect a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that the previous plan provided no migration path from the current `bundle cache` to the future one (an alias to `bundle package`).

### What was your diagnosis of the problem?

My diagnosis was that we should probably tell users first that in bundler 3, `bundle cache` will have a different implementation. However, after playing around with it a bit, I noticed that the additions to `bundle cache` provided by `bundle package` are fully backwards compatible. Or maybe I'm missing something but at least all `bundle cache` tests still pass when changing the implementation under the hood to use `bundle package`. As far as I can see, the only backwards incompatible change (start caching `git` and `path` gems by default) is already covered by the exisiting `cache_all` flag), so we should be good.

### What is your fix for the problem, implemented in this PR?

My fix is to remove the current implementation of `bundle cache`, and replace it with the current implementation of `bundle package`.

### Why did you choose this fix out of the possible options?

I chose this fix because it allows us to remove code and it reduces confusion about `bundle cache` vs `bundle package` making them work exactly the same.

On a future PR, I plan to clean this up so that everything (docs, code, tests) use `bundle cache`, and `bundle package` is left only as an alias. 

Co-authored-by: David Rodríguez <[email protected]>
@ghost
Copy link

ghost commented Jul 20, 2019

Build succeeded

@ghost ghost merged commit 69497ad into master Jul 20, 2019
@ghost ghost deleted the add_package_functionality_to_cache branch July 20, 2019 23:01
ghost pushed a commit that referenced this pull request Jul 29, 2019
7258: Restore the removal of the `--all` flag for `bundle cache` in Bundler 3 r=indirect a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that I accidentally restored this flag on Bundler 3 in #7249, but the plan still is to remove it.

### What was your diagnosis of the problem?

My diagnosis was that I need to remove it again.

### What is your fix for the problem, implemented in this PR?

My fix is to remove it.

### Why did you choose this fix out of the possible options?

I chose this fix because it's the original plan and makes sense.


Co-authored-by: David Rodríguez <[email protected]>
ghost pushed a commit that referenced this pull request Oct 30, 2019
7389: Wrap up `bundle cache` migration to current `bundle package` r=indirect a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that after #7249, we added the current `bundle package` functionality to the current `bundle cache` command, so that these commands are now aliases of each other.

The initial plan was to do this in a more careful manner but we concluded that this was only _adding_ functionality to `bundle cache`, so not backwards incompatible.

We still need to wrap up the original plan, where `bundle cache` is the preferred command.

### What is your fix for the problem, implemented in this PR?

My fix is to migrate docs, tests and help text to use `bundle cache`, and to remove duplicated specs for `bundle cache` and `bundle package`, since they are testing the exact same code.

Co-authored-by: David Rodríguez <[email protected]>
deivid-rodriguez pushed a commit that referenced this pull request Nov 7, 2019
7389: Wrap up `bundle cache` migration to current `bundle package` r=indirect a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that after #7249, we added the current `bundle package` functionality to the current `bundle cache` command, so that these commands are now aliases of each other.

The initial plan was to do this in a more careful manner but we concluded that this was only _adding_ functionality to `bundle cache`, so not backwards incompatible.

We still need to wrap up the original plan, where `bundle cache` is the preferred command.

### What is your fix for the problem, implemented in this PR?

My fix is to migrate docs, tests and help text to use `bundle cache`, and to remove duplicated specs for `bundle cache` and `bundle package`, since they are testing the exact same code.

Co-authored-by: David Rodríguez <[email protected]>
(cherry picked from commit 5ba1360)
ghost pushed a commit to rubygems/rubygems that referenced this pull request Mar 11, 2020
7389: Wrap up `bundle cache` migration to current `bundle package` r=indirect a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that after rubygems/bundler#7249, we added the current `bundle package` functionality to the current `bundle cache` command, so that these commands are now aliases of each other.

The initial plan was to do this in a more careful manner but we concluded that this was only _adding_ functionality to `bundle cache`, so not backwards incompatible.

We still need to wrap up the original plan, where `bundle cache` is the preferred command.

### What is your fix for the problem, implemented in this PR?

My fix is to migrate docs, tests and help text to use `bundle cache`, and to remove duplicated specs for `bundle cache` and `bundle package`, since they are testing the exact same code.

Co-authored-by: David Rodríguez <[email protected]>
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants