Bug #3988

Expected app/services/foreman/plugin.rb to define Plugin

Added by Dominic Cleal almost 4 years ago. Updated over 3 years ago.

Status:Closed
Priority:Urgent
Assigned To:Ivan Necas
Category:Rails
Target version:Sprint 21
Difficulty: Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-
Release1.5.0Release relationshipAuto

Description

Since #3821, the "rake locale:find" command throws an error, identical to the one we saw during the PR with rake test:

rake aborted!
Expected /home/dcleal/code/foreman/foreman/app/services/foreman/plugin.rb to define Plugin
/home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:503:in `load_missing_constant'
/home/dcleal/code/foreman/foreman_hooks/lib/foreman_hooks.rb:82:in `load_missing_constant_with_hooks'
/home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:192:in `block in const_missing'
/home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `each'
/home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:190:in `const_missing'
/home/dcleal/.rvm/gems/ruby-2.0.0-p247@foreman/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:514:in `load_missing_constant'

I suspect using autoload_once not on the top level dir (app/services) means it thinks the foreman subdir is just part of the path and not part of the class namespace. Maybe it's only happening with this rake task because it loads so many of the models and classes known in the application, while other simpler rake tasks don't, and rake test isn't affected by the previous commit because it's in the test environment.


Related issues

Related to Foreman - Bug #3821: Plugin menus are lost after page refresh in development mode Closed 12/05/2013
Related to Foreman - Bug #4140: GET on /API generate 500 error New 01/20/2014

Associated revisions

Revision 70ce8fe7
Added by Ivan Necas over 3 years ago

Fixes #3988 - use require instead of autoload_once_paths

History

#1 Updated by Dominic Cleal almost 4 years ago

  • Related to Bug #3821: Plugin menus are lost after page refresh in development mode added

#2 Updated by Dominic Cleal almost 4 years ago

  • Priority changed from High to Urgent

Also breaks /apidoc...

#3 Updated by Dominic Cleal almost 4 years ago

and /api/plugins

#4 Updated by Dominic Cleal almost 4 years ago

  • Related to Bug #4140: GET on /API generate 500 error added

#5 Updated by Dominic Cleal almost 4 years ago

  • Release deleted (1.4.0)

#6 Updated by Dominic Cleal over 3 years ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Ivan Necas
  • Target version set to Sprint 21
  • Release set to 1.5.0

#7 Updated by Ivan Necas over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF