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
Modified generated Gemfile to allow patch versions of Rails. #6610
Conversation
|
I'm naturally a |
|
|
|
I'm If the users want to use the |
|
To make any difference users would have to run For users that use bundler properly it would be only triggered on |
|
From my experience, changing rails version in most apps is not a quick "update and forget process". Usually you need to see if everything works as expected and if extensions that you use don't break. That's why I prefer to keep strict version. |
|
Sticking with one version is a bad thing, we encourage people to upgrade to at least latest patch level of ruby, to test their apps against all the rubies, but in the same time we tell them to stick with one rails version, at least add a comment to update it once in a while, would it be a solution? |
|
Keeping the strict version are not saying that the people should not upgrade the Rails version, it is saying to people that if they want to upgrade the version they need to change the Gemfile. For me this is a conscious upgrade. This avoid acidental upgrade when the user run As @drogus said, upgrade the rails is more than install the newest version. Gem author can use some private API that changed in the newest release or users can rely in bugged behavior, so I think that upgrade the rails version should be always conscious. |
|
(accidentally clicked the 'close and comment' sorry) If gem authors use private APIs (myself included) then it's kind of their own fault don't you think? [edit: this doesn't make much sense - clarified in the last paragraph below] It's not like developers call
If you run a normal If you're a gem author then this change is irrelevant to you as you'll be specifying a Rails version dependency in your .gemspec file. |
|
Another reason to use strict version. If you have installed Rails 3.2.3 and run |
|
@rafaelfranca our opinions differ as I see that as a benefit; you get to start with the latest patch level already installed. Imagine not knowing there was a security update -- this way you get a de facto notification that you weren't running the latest patch code. |
|
+1 from me. I totally agree with @parndt . |
If your application is tested enough to allow changing versions without thorough check, just change the @paneq @parndt Would you say that majority of rails apps can be upgraded without any problems? My experience tell me something completely different. |
|
Agree with @drogus. So many apps that mess with things that they shouldn't... |
|
/me sad this should be done only for new apps - those that are not yet broken It seams very bad from both sides:
I have an impression that you gave up and prefer to stick to older rails patch level instead of promoting fixed version - which fixes security issues (because that's what you do for every patch version increase). |
|
First, Rails doesn't follow semver. Second, no one is telling that people can upgrade to the next version, we only prefer to stick the rails version in the Gemfile to the people don't update the rails by mistake when run And finally, we avoid changes in the API in patch version but sometimes people can use bugged behavior as correct and they application can be broken with a patch upgrade. So even with a stable API a patch update can broke the application. |
Maybe should start? |
Please note that situation since Rails 3 is much better than in 2.x times and there is a lot of good APIs that can be used by gem developers (or application developer, if they need something other than defaults). However, it's virtually impossible to predict every case of framework extension. If there is anything that can't be done with current API, people should open issues (or better pull requests). Also, I was not trying to say that people use rails internals, mainly because rails doesn't provide good APIs. It can be the case, but most of the time I've seen code that tried to be "too clever" in my opinion - a lot of things can be achieved in many different ways and often code that touch internals can be refactored into proper implementation that doesn't do it.
I haven't given up. I think that people should be on the latest stable release. The thing is, changing The other thing is, I see a little problem with your reasoning. You say that people will upgrade version only after running I assume that given that most rails apps are hard to upgrade painlessly and |
|
Everyone loves SemVer until they want a breaking change. (I would like Rails to follow SemVer too, but it would be a MASSIVE undertaking) |
|
It seems that the only reason for rejecting this patch is the fear that people may run Anyway, no one is crazy enough to just update and deploy to production right ? We do run tests before doing deploy. If I update rails, or any other gem in that matter and my tests are passing then I choose to believe that I can deploy it. It is equally possible that there was a unknown / untested bug in previous Rails version as that it is in the updated one. I choose to believe in progress and that rails is getting better and that upgrading often is a good thing. Let's think about 2 usecases: a) Someone executed b) Someone executed |
|
@drogus - I think we should focus on usecases when people execute commands intentionally, properly and with knowledge about what they are doing. I also think that they can easily test the changes and revert in case they don not like the result of their accidental command execution. Please remember that the required version of gems are hardcoded in |
|
We sort of do follow semver, with a shifted version as Ruby does.
Patch versions of Rails do not introduce backwards-incompatible changes intentionally and do not usually add new features, except as necessary for security fixes or deprecations. That makes patch levels in Rails more like minor versions. Rails has no version number similar to patch versions. Ruby uses a similar scheme, but uses "patch level" versions for this purpose.
Rails minor versions (3.0 => 3.1, 3.1 => 3.2, etc.) serve as major versions for Semver purposes. In general, we try to avoid introducing breaking changes in minor versions, but don't promise no breaking changes. In general, breaking changes in minor versions are paired with deprecation notices in a teeny version of the prior minor version. Rails major versions usually make substantial breaking changes. The primary difference between minor and major releases in Rails is the magnitude of the breaking changes. Changes made in minor versions are small and should not require large-scale application changes, unless required for security fixes. Changes made in major releases often do require large-scale application changes (think XSS protection in Rails 3.0 and the Ruby 1.9 requirement in Rails 4.0). In general, the first minor release of a new major release maintains as much backwards compatibility as possible with the last release, with the removal of that support in the From that perspective, this change should be fine. That said, I'm unsure what this adds:
As far as I can tell, the tradeoff is "having to know what version of Rails is the latest version" vs. "overeager updating semantics". Why do people think that breaking conservative updating semantics are worth it? |
|
@wycats - Changing |
|
Anytime you run If you modify a dependency in the Gemfile and run When you run |
|
In other words, After this change, you can still have the same behavior as Before if you follow the exact same steps. Right? |
|
For my understanding, wrong. After this patch if you run |
1 similar comment
|
For my understanding, wrong. After this patch if you run |
|
Currently ~> is used with sass-rails and coffee-rails. I always change rails to use it as well. For consistency, why not change to match? I use bundle/gem to reveal to me the version running (or grep Gemfile.lock). I don't read the Gemfile. It seems that |
Different gems have different upgrade needs and policies. |
|
From http://weblog.rubyonrails.org/2012/8/3/ann-rails-3-2-8-rc2-has-been-released/:
Is it step towards semantic versioning and allowing this pull request to be merged? |
|
It's not an explicit step towards semver, but it is a step towards being a bit more consistent about what happens when. |
|
I don't think so. Also 3.2.7 was a huge example how a patch version can break applications that rely in bugged behavior. |
|
I'm If you want to follow SemVer (which is great), nothing stops you from editing the Gemfile and doing so. |
|
Okay. After this discussion, I think the potential for breakage is too high. If you want this behavior, it's two characters to change in your Gemfile. I don't think it's responsible for us to make this change. We're not perfect, and sometimes people rely on bugged behavior as well. Thanks for the idea, though! |
|
Yep - happy to put this one to bed seeing as people are fairly divided on the issue. Thanks for taking part, everyone! |
Fixes #6604 which was a great idea by @mpapis
This change allows, for example when generating an application using Rails 3.2.5, the application to use 3.2.5 -> 3.2.x but not 3.3 or greater and not less than 3.2.5.
I believe that this is a good idea given that security issues are often fixed with patch releases and that it is safe to do so as these versions are tested for regressions which, when found, are solved with a subsequent release.
I couldn't find any tests that are related to this change and all railties tests passed (eventually).
Thanks :-)