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

fix reload! for MiqAeMethodService #445

Merged
merged 1 commit into from
May 31, 2020
Merged

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented May 29, 2020

after reload classes don't exist. and that includes what we were
delegating for the class missing

before:

> reload!
Traceback (most recent call last):
       16: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:510:in `load_missing_constant'
       15: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:356:in `require_or_load'
       14: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:37:in `load_interlock'
       13: from activesupport (5.2.4.3) lib/active_support/dependencies/interlock.rb:13:in `loading'
       12: from activesupport (5.2.4.3) lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
       11: from activesupport (5.2.4.3) lib/active_support/dependencies/interlock.rb:14:in `block in loading'
       10: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:37:in `block in load_interlock'
        9: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:373:in `block in require_or_load'
        8: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:475:in `load_file'
        7: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:661:in `new_constants_in'
        6: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:476:in `block in load_file'
        5: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:476:in `load'
        4: from lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:3:in `<top (required)>'
        3: from lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:4:in `<module:MiqAeMethodService>'
        2: from lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:13:in `<class:MiqAeServiceModelBase>'
        1: from lib/miq_automation_engine/engine/miq_ae_method_service.rb:12:in `const_missing'
NoMethodError (undefined method `create_service_model_from_name' for MiqAeMethodService::MiqAeServiceModelBase:Class)

after:

> reload!
sure thing. coming right up
>

@kbrock kbrock requested review from lfu and tinaafitz as code owners May 29, 2020 17:08
@coveralls
Copy link

coveralls commented May 29, 2020

Pull Request Test Coverage Report for Build 4123

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 85.717%

Totals Coverage Status
Change from base Build 4062: 0.0%
Covered Lines: 5047
Relevant Lines: 5888

💛 - Coveralls

Copy link
Member

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

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

'Requesting further explanation'.

lib/miq_automation_engine/engine/miq_ae_method_service.rb Outdated Show resolved Hide resolved
after reload classes don't exist. and that includes what we were
delegating for the class missing

before:

```
> reload!
Traceback (most recent call last):
       16: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:510:in `load_missing_constant'
       15: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:356:in `require_or_load'
       14: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:37:in `load_interlock'
       13: from activesupport (5.2.4.3) lib/active_support/dependencies/interlock.rb:13:in `loading'
       12: from activesupport (5.2.4.3) lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
       11: from activesupport (5.2.4.3) lib/active_support/dependencies/interlock.rb:14:in `block in loading'
       10: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:37:in `block in load_interlock'
        9: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:373:in `block in require_or_load'
        8: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:475:in `load_file'
        7: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:661:in `new_constants_in'
        6: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:476:in `block in load_file'
        5: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:476:in `load'
        4: from lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:3:in `<top (required)>'
        3: from lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:4:in `<module:MiqAeMethodService>'
        2: from lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:13:in `<class:MiqAeServiceModelBase>'
        1: from lib/miq_automation_engine/engine/miq_ae_method_service.rb:12:in `const_missing'
NoMethodError (undefined method `create_service_model_from_name' for MiqAeMethodService::MiqAeServiceModelBase:Class)
```

after:
```
> reload!
sure thing. coming right up
>
```
@chessbyte chessbyte merged commit f44fae6 into ManageIQ:master May 31, 2020
simaishi pushed a commit that referenced this pull request Jun 1, 2020
fix reload!

(cherry picked from commit f44fae6)
@simaishi
Copy link
Contributor

simaishi commented Jun 1, 2020

Jansa backport details:

$ git log -1
commit f0185addb172cbdbb1b24951b611bfb41224c4c7
Author: Oleg Barenboim <[email protected]>
Date:   Sun May 31 10:10:25 2020 -0400

    Merge pull request #445 from kbrock/class_reload

    fix reload!

    (cherry picked from commit f44fae618cfade841a2b6ddcf12f56ae34baabca)

@kbrock kbrock deleted the class_reload branch June 2, 2020 20:24
@jrafanie
Copy link
Member

FYI, this is a slippery slope. I've been here. Dev reload of automation engine doesn't work. #418. I had a similar change in that issue but couldn't get dev reload to work at all in many situations, specifically: #418 (comment)

I'm curious which problem this fixes because I think there's lots more buried in automation engine due to file paths not being autoloadable, etc.

@kbrock
Copy link
Member Author

kbrock commented Jun 10, 2020

There was a weird class load issue. Just wanted to fix it.

@NickLaMuro NickLaMuro changed the title fix reload! fix reload! for MiqAeMethodService Jun 10, 2020
@NickLaMuro
Copy link
Member

@kbrock @jrafanie Fixed the title so it doesn't seem like Keenan is on a Vendeta to fix this across the board (which he has been know to do 🙄 ), and clarify this is just a targeted fix for a particular class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants