-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
logstash-core* version constrains problem #4236
Comments
maybe use a crazy high version number for the upper bound?
|
Ugh. SemVer strikes again :( |
I think I'm OK with Alternately, I think the "right" solution is probably using |
I totally didn't finish reading your description. I see oyu already proposed ~> hehe |
We can try |
@colinsurprenant your proposal looks ugly to me (too hacky for now), I would do a bit more research or stick with the `~>`` as I proposed in logstash-plugins/logstash-output-file#22. |
I comfort myself in that this isn't a unicode problem, at least ;P |
@purbon but I am not saying |
wondering if it would make a difference if we use |
nope.
|
note that the above is only the rubygem requirement validation and does not account for bundler's selection, which excludes pre releases when using
but as expected not this
but bundler won't select it in the first place. |
another option would be to publish pre-release versions one minor version up, for example with the constrain
the problem with this approach is that it is error prone. if we forget not to release X.0.0.prewhatever version then we get burn. in that respect, using a high minor version constrain still seems the best & safest option.
|
I'm leaning towards Thoughts? |
@jordansissel for me using @colinsurprenant I agree, using I would like us to step a bit, and thing on possible ways to have a clear description of it. Opening an issue with rubygems to clarify this now. |
What about using something like |
personally I find it easier to comprehend the intention when using As for opening an issue with Rubygems, let's not forget that the constrain semantic of |
@colinsurprenant I made my proposal because using But I see both proposals as not perfect, so not sure how to make a call on this. Thoughts? |
@purbon version X.1000? are you serious? For someone looking at at the gemspec, without being aware all the details about this semantic versioning oddity of having If |
also called the principle of least surprise. |
@colinsurprenant Yes I'm serious. Is not that scares me, is that I find it less polite than the other proposal as |
sorry @purbon, not equally bad, |
Been through all this semver discussion, this is what I think. I would go with the X.999, for the following reason: to understand the meaning of So I believe with your explication, the current dependency string should look something like this:
And when we work on the next major release (3.0) we will do something like this:
Correct? |
@ph thanks for sharing your opinion, so then go for the |
sorry if I'm late in the game, but what about
|
@jsvd This is madness but seems to work. |
@jsvd what about pre releases within the 1.x branch? I don't think it will work there. |
@purbon it work.
|
then good, I like this approach @jsvd. @colinsurprenant what do you think? |
@jsvd dude. if this works, you're da man. But it's not over yet, per previous comment #4236 (comment) ... when there's a So this need to be validated first to see if it works in the context of Bundler. |
@colinsurprenant we can simulate this rather easily, but I'm not sure I understand the scenario where bundler will fail, can you provide a reduced example? |
@jsvd it is pretty simple: when using Now this is true with a simple |
I vote for < 2.0.0.alpha0 Its clear to all that we want the very last version before we started any kind of release of v 2 |
@jsvd 's solution may work but nobody understands how or why. |
If I find the time this weekend I'd like to test this in a local gem server. It seems bundler behaviour is a bug, no? Any suggestions on the Gemfile/gems setup to test? My idea is a gem server with Gemfile Gemfile.lock Running bundle install should run ok. Is this an fair example of what should work/not work @colinsurprenant? |
I don't think there is any bug involved per-se
@jsvd ^^ in your scenario you also need to have a gemA version 2.0.0.alpha1 and it should not be installed in the |
good weekend and good luck 😈 |
@guyboertje I like you proposal at #4236 (comment), is an improvement over mine, I think is a well known and understood contrain that there is nothing before @guyboertje @jsvd @colinsurprenant @ph agreement? so we can move forward with backports? and unblock some that has been waiting for this? |
I created 2 gems for this test which I served locally with geminabox:
So hola-dep depends on hola (sorry for the terrible names) hola-dep 0.9.0 in Gemfile, no Gemfile.lock ✅
hola-dep 1.0.0 in Gemfile, no Gemfile.lock ❌
hola-dep 1.0.1 in Gemfile, no Gemfile.lock ❌
hola-dep 0.9.0 in Gemfile, hola-dep 0.9.0 Gemfile.lock ✅
hola-dep 1.0.0 in Gemfile, manually created Gemfile.lock with hola 1.5.0.beta1 ✅
hola-dep 1.0.1 in Gemfile, manually created Gemfile.lock with hola 1.5.0.beta1 ✅
I might be missing some test here but I don't see a difference in using < 1.999 and ~> 1 |
is there a case where it doesn't work when manually editing the Gemfile.lock? In particular the simple
|
created:
works ✅
|
I should note that I'm not that familiar with Gemfile / Gemfile.lock shenanigans, so I might be doing the wrong test here. |
hm. now I am confused. 😕 |
@jsvd Yes this is the same behavior I had and I believe this is consistent with bundler and his gemfile handling. If you don't explicit set a pre-release version it should be ignored, so this might be the way to go, if we want to explicitly use a pre-release we have to define it in one of the Gemfile. We could always have a way to update our jenkins jobs that modify the plugin gemfile to test our pre-releases, this would also reduce the number of mass update we have to do on the plugins. Or maybe event better, why we don't add a job that test the plugins with the current master. |
We can close this, we have decided to generate a |
currently our gemspecs uses constrains on logstash-core (and soon logstash-core-event), let's call them the core gems, using a pattern similar to:
the problem with this notation is that a logstash-core gem release version 2.0.0.rc1 is considered prior to 2.0.0, because it is a "pre-release" version so a gem version
2.0.0.rc1
would satisfy the< 2.0.0
constrain.Obviously the intent in specifying
< 2.0.0
is to exclude anything 2.0.ish but I guess that semantically the current behaviour is arguable.One possible solution is to specify
~> 1.4
but then this notation does not allow any pre-release versions to satisfy the constrain which is bad since we need to release pre-release beta/rc packages that uses pre-release gem versions.I am not sure what our options are. A solution is required for current and future releases and should ideally be also applied to the 1.5 branch.
This related to #4235 logstash-plugins/logstash-output-file#22 #4188 #4231
The text was updated successfully, but these errors were encountered: