Skip to content
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

197 Move all V3 Controllers into a Rest Namespace #198

Merged
merged 9 commits into from
Sep 1, 2017

Conversation

eugenk
Copy link
Member

@eugenk eugenk commented Sep 1, 2017

This shall fix #197 along with some cleanup (see the commit messages).

@eugenk eugenk requested a review from phyrog September 1, 2017 14:24
@eugenk
Copy link
Member Author

eugenk commented Sep 1, 2017

I think there's something wrong with Travis. Not sure what it is.

@eugenk eugenk force-pushed the 197-move_all_v3_controllers_into_a_rest_namespace branch from 869b7ed to 03afb47 Compare September 1, 2017 15:15
# We exclude the devise routes from these rake tasks because they load the
# models. When loading the models, the database needs to exist, or else it
# throws an error.
unless rake_task?(%w(db:create db:migrate db:drop
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is still needed, might also be the problem Travis has, see #69.

config/routes.rb Outdated
# We exclude these Devise mappings from these rake tasks because they
# load the models. When loading the models, the database needs to exist,
# or else it throws an error.
unless rake_task?(%w(db:create db:migrate db:drop))
Copy link
Contributor

@phyrog phyrog Sep 1, 2017

Choose a reason for hiding this comment

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

Might be necessary to add db:recreate and db:recreate:seed as well (you forgot to copy a line 😄)

Copy link
Member Author

Choose a reason for hiding this comment

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

Right 😅

@eugenk eugenk force-pushed the 197-move_all_v3_controllers_into_a_rest_namespace branch from cb59436 to d65e1fe Compare September 1, 2017 15:30
@eugenk eugenk force-pushed the 197-move_all_v3_controllers_into_a_rest_namespace branch from d65e1fe to d447d10 Compare September 1, 2017 15:31
Copy link
Contributor

@phyrog phyrog left a comment

Choose a reason for hiding this comment

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

Some v3s in the code left:

spec/support/api/schemas/rest/organizational_units_controller.json
125:      "href": "/v3/{#/definitions/id}",

spec/support/api/schemas/rest/version_controller.json
57:      "href": "/v3/version",

spec/support/api/schemas/rest/repositories_controller.json
127:      "href": "/v3/{#/definitions/id}",
136:      "href": "/v3/{#/definitions/organizational_unit_id}",

@codecov-io
Copy link

codecov-io commented Sep 1, 2017

Codecov Report

Merging #198 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #198      +/-   ##
==========================================
- Coverage   99.97%   99.97%   -0.01%     
==========================================
  Files         196      197       +1     
  Lines        4621     4599      -22     
==========================================
- Hits         4620     4598      -22     
  Misses          1        1
Impacted Files Coverage Δ
...llers/rest/organizational_units_controller_spec.rb 100% <100%> (ø)
...pec/shared_examples/resend_password_reset_email.rb 100% <100%> (ø) ⬆️
...ontrollers/rest/organizational_units_controller.rb 100% <100%> (ø)
...c/controllers/rest/repositories_controller_spec.rb 100% <100%> (ø)
...pec/shared_examples/resend_unlock_account_email.rb 100% <100%> (ø) ⬆️
app/controllers/rest/repositories_controller.rb 100% <100%> (ø)
app/controllers/rest/application_controller.rb 100% <100%> (ø)
...ec/controllers/rest/application_controller_spec.rb 100% <100%> (ø)
app/controllers/rest/version_controller.rb 100% <100%> (ø)
config/routes.rb 100% <100%> (ø) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 003717b...664c3e4. Read the comment docs.

# This is the base class for all API Version 3 Controllers.
class ApplicationController < ActionController::API
extend DSL

context do
{current_user: current_user}
end

def no_op
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrap in :nocov: please

Copy link
Member Author

Choose a reason for hiding this comment

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

Better: 664c3e4

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@phyrog phyrog left a comment

Choose a reason for hiding this comment

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

@eugenk
Copy link
Member Author

eugenk commented Sep 1, 2017

Well, that took some doing...

@eugenk eugenk merged commit d32d60c into master Sep 1, 2017
@eugenk eugenk deleted the 197-move_all_v3_controllers_into_a_rest_namespace branch September 1, 2017 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move all V3 Controllers into a REST namespace
3 participants