-
Notifications
You must be signed in to change notification settings - Fork 476
Adds support for grape >= 1.2 #717
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
Conversation
Not sure how to handle the fact that this is dependant on the other code being merged. I've tested this locally manually using the branch and it was working |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should try to make this backward compatible. The only difference is the class name being extended, so you should be able to do this with an if defined?(Grape::API::Instance)
or something like that.
You need a spec for next version of grape regarding mounting the API twice. What happens to swagger in that case?
Gemfile
Outdated
@@ -6,7 +6,7 @@ ruby RUBY_VERSION | |||
|
|||
gemspec | |||
|
|||
gem 'grape', case version = ENV['GRAPE_VERSION'] || '~> 1.0' | |||
gem 'grape', case version = ENV['GRAPE_VERSION'] || '~> 1.2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave this at 1.0 for now, but add another entry to .travis.yml with the branch, so for example
when 'INSTANCE'
{ git: '...', branch: '...' } # your own PR branch here
when 'HEAD'
...
UPGRADING.md
Outdated
@@ -1,5 +1,9 @@ | |||
## Upgrading Grape-swagger | |||
|
|||
### Upgrading to >= 0.32.0 | |||
|
|||
This version is *only* compatible with grape >= 1.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some info on why, link to the other PR, add a link.
I've addressed the issue of making swagger compatible with previous versions of Grape. |
This looks great. We can keep this moving once the Grape PR is merged. |
@myxoh Now that ruby-grape/grape#1803 got merged this can be updated to build against HEAD only |
Makes swagger backwards-compatible again Adds a test that covers re-mounting with configuration Describes changes on this PR Removes custom branch from build process
Looks like a rubocop failure. Lock it at 0.59.2 or upgrade to 0.60.0 and |
Thanks @dblock . Addressed. |
Gemfile
Outdated
@@ -26,7 +26,7 @@ group :development, :test do | |||
gem 'rake' | |||
gem 'rdoc' | |||
gem 'rspec', '~> 3.0' | |||
gem 'rubocop', '~> 0.59', require: false | |||
gem 'rubocop', '~> 0.60', require: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is OK for now, but really should just be a specific version, because each new release (eg. 0.61) will produce new errors/warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether it is desirable to lock the gem, rather than tackle the new errors / warnings as they come.
If you still feel I should lock this to a version, I'll do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got this in #719.
We lock rubocop because it's otherwise a moving target. Yesterday ~> 0.59
resolved to 0.59, but today it resolved to 0.60, producing new errors. So the same code built green yesterday but fails to build today, which is not desirable.
New errors and warnings should totally be tackled, but not in the way of feature/fix work :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work … thanks
CHANGELOG.md
Outdated
|
||
#### Features | ||
|
||
* Your contribution here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please re-add it again, same for line 9
Gemfile
Outdated
@@ -26,7 +26,7 @@ group :development, :test do | |||
gem 'rake' | |||
gem 'rdoc' | |||
gem 'rspec', '~> 3.0' | |||
gem 'rubocop', '~> 0.59', require: false | |||
gem 'rubocop', '0.60', require: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't lock it, minor rubocop updates are much easier to handle then big ones
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dblock Could you guys agree on a decision? I'm happy either way as I see both views as valid, but I don't want to step over either of you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets take it to #719
lib/grape-swagger/version.rb
Outdated
@@ -1,5 +1,5 @@ | |||
# frozen_string_literal: true | |||
|
|||
module GrapeSwagger | |||
VERSION = '0.31.2' | |||
VERSION = '0.32.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert, will be done on next release
thanks @myxoh … please also add a travis entry |
@LeFnord regarding adding a travis entry. I'm pressuming you mean against 1.12, however, that was not released yet, it's still on HEAD. Would you reckon we should wait until that's released and then add it to the matrix? |
ok @myxoh … |
again … great work @myxoh … will mörge it, after specs are green 😄 |
* Adds support for grape >= 1.2 Makes swagger backwards-compatible again Adds a test that covers re-mounting with configuration Describes changes on this PR Removes custom branch from build process * Upgrades Rubocop and autofixes indentation * Locks rubocop version to 0.60 * Rollbacks version bump * Removes HEAD from allowed failure
This PR is required after: ruby-grape/grape#1803
to make sure that
grape-swagger
is compatible withgrape
after the breaking changes introduced in1.2.0
Because of the nature of the changes in the grape gem, this version won't be compatible with prior versions of grape