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 indents so we don't overwrite the main settings.yml #53

Merged

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Jun 5, 2017

This should fix the following errors on manageiq master:

  1) EmsEvent.event_groups returns a list of groups
     Failure/Error: expect(described_class.event_groups[:addition][:critical]).to include('CloneTaskEvent')
       expected ["aggregate.addhost.end", "aggregate.create.end", "aggregate.removehost.end", "aggregate.updateprop.e..."AWS_EC2_Instance_DELETE", "TerminateInstances", "RunInstances", "virtualMachines_write_EndRequest"] to include "CloneTaskEvent"
     # ./spec/models/ems_event_spec.rb:212:in `block (3 levels) in <top (required)>'
  2) EmsEvent.event_groups returns the provider event if configured
     Failure/Error: expect(described_class.event_groups[:addition][:critical]).to include('CloneTaskEvent')
       expected ["aggregate.addhost.end", "aggregate.create.end", "aggregate.removehost.end", "aggregate.updateprop.e...TerminateInstances", "RunInstances", "virtualMachines_write_EndRequest", "SomeSpecialProviderEvent"] to include "CloneTaskEvent"
     # ./spec/models/ems_event_spec.rb:232:in `block (3 levels) in <top (required)>'
Finished in 8 minutes 36 seconds (files took 1 minute 2.99 seconds to load)
4177 examples, 2 failures, 19 pending
Failed examples:
rspec ./spec/models/ems_event_spec.rb:205 # EmsEvent.event_groups returns a list of groups
rspec ./spec/models/ems_event_spec.rb:216 # EmsEvent.event_groups returns the provider event if configured

@jrafanie
Copy link
Member Author

jrafanie commented Jun 5, 2017

cc @tzumainn

@jrafanie jrafanie force-pushed the fix_incorrect_event_handling_indents branch from d9fb460 to f52a80f Compare June 5, 2017 20:50
Copy link
Member

@bdunne bdunne left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@miq-bot
Copy link
Member

miq-bot commented Jun 5, 2017

Checked commit jrafanie@f52a80f with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
0 files checked, 0 offenses detected
Everything looks fine. 🍪

@jrafanie
Copy link
Member Author

jrafanie commented Jun 5, 2017

@durandom Please review... the way the provider plugin code merges in provider settings should probably not allow plugins to touch other plugins or the main settings.yml like this did.

@chessbyte chessbyte merged commit 69fed34 into ManageIQ:master Jun 5, 2017
@chessbyte chessbyte added this to the Sprint 62 Ending Jun 5, 2017 milestone Jun 5, 2017
@jrafanie jrafanie deleted the fix_incorrect_event_handling_indents branch June 5, 2017 21:16
@aufi
Copy link
Member

aufi commented Jun 6, 2017

Thanks for the fix

@durandom
Copy link
Member

durandom commented Jun 6, 2017

@jrafanie I've discussed this with @Fryguy in ManageIQ/manageiq-providers-amazon#138 and ManageIQ/manageiq#13942

I dont see a reasonable approach for that until we have either scoped all plugin related settings under one plugin key (then this would be the gatekeeper) or have real content based validation of the config file / structure.

Maybe this is a use case for re-arch too? When moving to a distributed config storage? Does e.g. etcd support config schema validation?

@Fryguy
Copy link
Member

Fryguy commented Jun 6, 2017

We can actually do config validation with the config gem... It's a relatively new feature we could leverage.

@durandom
Copy link
Member

durandom commented Jun 6, 2017

@Fryguy yeah, I experienced this the hard way when moving the authenticator settings to aws. But afaik we only do this for a small amount of the settings... Maybe we should expand that on some crucial settings that potentially break the app

@Fryguy
Copy link
Member

Fryguy commented Jun 6, 2017

Can we just go through all of the plugins and ensure they have the event_handling indented like this PR?

@jrafanie
Copy link
Member Author

jrafanie commented Jun 6, 2017

@durandom @Fryguy It's an easy mistake since yaml is so unforgiving but it might be worthwhile to only let providers merge in their subhash as opposed to the root of the hash.

@Fryguy
Copy link
Member

Fryguy commented Jun 6, 2017

to only let providers merge in their subhash as opposed to the root of the hash.

💯 This would be great. I think to @durandom's point though, we have to refactor some things to make that a reality. I feel we should just prioritize the effort for that though.

@durandom
Copy link
Member

durandom commented Jun 7, 2017

merge in their subhash

Thats hard to define. We could start with the section we know and check that when loading settings.
However this mixes validation and merging of the config...
I'll explore both approaches
Added item to ManageIQ/manageiq#14840

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.

7 participants