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

[bundle add] Add version prefix flexibility #6556

Merged
merged 3 commits into from
Jun 6, 2018

Conversation

agrim123
Copy link
Contributor

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

By default, on bundle add we use "pessimistic" way (~>) of versions. According to this comment some users face problems.

What was your diagnosis of the problem?

Adding flags to provide flexibility to change this declaration namely optimistic and strict

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

Adding flags to opt for other declarations.

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

Currently, its an experiment and I have added it to only bundle add but still the version locked in lockfile are "pessimistic". Need suggestions on this and on how to proceed.

Addresses #6553

@@ -335,6 +335,8 @@ def binstubs(*gems)
method_option "source", :aliases => "-s", :type => :string
method_option "skip-install", :type => :boolean, :banner =>
"Adds gem to the Gemfile but does not install it"
method_option "optimistic", :type => :boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these need banners

end
end

describe "with --strict option" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we error when passing both --optimistic and --strict ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. adding it.

@agrim123
Copy link
Contributor Author

If I specify version then a strict declaration is added and these options have no affect. Should we disable the use of these options when version is specified? or inco-oporate these flags with the version also?

@segiddins
Copy link
Member

I think it’s fine to allow the specific requirement given to override the flags?

@agrim123
Copy link
Contributor Author

agrim123 commented May 30, 2018

But if we provide flexibility then I think we should allow 🤔 , any side effects for this?
And we need to figure out a separate command may be for this purpose?

@colby-swandale colby-swandale changed the title Add version prefix flexibility [bundle add] Add version prefix flexibility May 30, 2018
@colby-swandale colby-swandale added this to the 1.17.0 milestone May 30, 2018
@segiddins
Copy link
Member

But if we provide flexibility then I think we should allow 🤔 , any side effects for this?
And we need to figure out a separate command may be for this purpose?

For what ?

@agrim123
Copy link
Contributor Author

agrim123 commented Jun 3, 2018

I meant something like this

bundle add rack --version=1.1 --optimistic

This would do something like this

gem "rack", ">= 1.1"

Or a few more commands like --no-version, --strict.
Does this have any side effect?

@colby-swandale
Copy link
Member

Great! This looks amazing! @bundlerbot r+

@bundlerbot
Copy link
Collaborator

📌 Commit 9250dbc has been approved by colby-swandale

@bundlerbot
Copy link
Collaborator

⌛ Testing commit 9250dbc with merge 43b4fa9...

bundlerbot added a commit that referenced this pull request Jun 6, 2018
[bundle add] Add version prefix flexibility

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

By default, on `bundle add` we use "pessimistic" way (~>) of versions. According to this [comment](https://github.com/bundler/bundler/issues/6553#issue-326023952) some users face problems.

### What was your diagnosis of the problem?

Adding flags to provide flexibility to change this declaration namely `optimistic` and `strict`

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

Adding flags to opt for other declarations.

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

Currently, its an experiment and I have added it to only `bundle add` but still the version locked in lockfile are "pessimistic". Need suggestions on this and on how to proceed.

Addresses #6553
@bundlerbot
Copy link
Collaborator

☀️ Test successful - status-travis
Approved by: colby-swandale
Pushing 43b4fa9 to master...

@bundlerbot bundlerbot merged commit 9250dbc into rubygems:master Jun 6, 2018
@agrim123 agrim123 deleted the agr-versions-gem-add branch June 6, 2018 03:43
colby-swandale pushed a commit that referenced this pull request Sep 21, 2018
[bundle add] Add version prefix flexibility

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

By default, on `bundle add` we use "pessimistic" way (~>) of versions. According to this [comment](https://github.com/bundler/bundler/issues/6553#issue-326023952) some users face problems.

### What was your diagnosis of the problem?

Adding flags to provide flexibility to change this declaration namely `optimistic` and `strict`

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

Adding flags to opt for other declarations.

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

Currently, its an experiment and I have added it to only `bundle add` but still the version locked in lockfile are "pessimistic". Need suggestions on this and on how to proceed.

Addresses #6553

(cherry picked from commit 43b4fa9)
colby-swandale pushed a commit that referenced this pull request Sep 22, 2018
[bundle add] Add version prefix flexibility

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

By default, on `bundle add` we use "pessimistic" way (~>) of versions. According to this [comment](https://github.com/bundler/bundler/issues/6553#issue-326023952) some users face problems.

### What was your diagnosis of the problem?

Adding flags to provide flexibility to change this declaration namely `optimistic` and `strict`

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

Adding flags to opt for other declarations.

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

Currently, its an experiment and I have added it to only `bundle add` but still the version locked in lockfile are "pessimistic". Need suggestions on this and on how to proceed.

Addresses #6553

(cherry picked from commit 43b4fa9)
colby-swandale pushed a commit that referenced this pull request Oct 5, 2018
[bundle add] Add version prefix flexibility

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

By default, on `bundle add` we use "pessimistic" way (~>) of versions. According to this [comment](https://github.com/bundler/bundler/issues/6553#issue-326023952) some users face problems.

### What was your diagnosis of the problem?

Adding flags to provide flexibility to change this declaration namely `optimistic` and `strict`

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

Adding flags to opt for other declarations.

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

Currently, its an experiment and I have added it to only `bundle add` but still the version locked in lockfile are "pessimistic". Need suggestions on this and on how to proceed.

Addresses #6553

(cherry picked from commit 43b4fa9)
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.

4 participants