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 failing creating new Alert in Control > Explorer #5056

Merged
merged 2 commits into from Dec 10, 2018

Conversation

hstastna
Copy link
Contributor

@hstastna hstastna commented Dec 6, 2018

Fixes BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1654896

Related PR:
#4947

What:
This PR fixes failing creating a new Alert in Control > Explorer page.

Steps to reproduce:

  1. Go to Control > Explorer > Alerts accordion > All Alerts
  2. Select Configuration > Add new alert
  3. Fill in some info (Description and Driving Event are required),
    check the Show on Timeline checkbox, in Timeline Event section instead of Send an E-mail, for example
  4. Click on Add button
    => error:
[----] I, [2018-12-06T17:22:47.963847 #3514:2abc52c6f44c]  INFO -- : Started POST "/miq_policy/alert_edit?button=add" for ::1 at 2018-12-06 17:22:47 +0100
[----] I, [2018-12-06T17:22:48.011375 #3514:2abc52c6f44c]  INFO -- : Processing by MiqPolicyController#alert_edit as JS
[----] I, [2018-12-06T17:22:48.011707 #3514:2abc52c6f44c]  INFO -- :   Parameters: {"button"=>"add"}
[----] F, [2018-12-06T17:22:48.032725 #3514:2abc52c6f44c] FATAL -- : Error caught: [NoMethodError] undefined method `[]' for nil:NilClass
/home/hstastna/manageiq/manageiq-ui-classic/app/controllers/miq_policy_controller/alerts.rb:650:in `alert_valid_record?'
/home/hstastna/manageiq/manageiq-ui-classic/app/controllers/miq_policy_controller/alerts.rb:26:in `alert_edit_save_add'
/home/hstastna/manageiq/manageiq-ui-classic/app/controllers/miq_policy_controller/alerts.rb:60:in `alert_edit'

Notes:
Failing depends on which info is (not) filled in while creating a new alert - it does not happen always.
Mostly failing does not occur if all the info is filled in properly, including the emails.


Before: (not able to create a new Alert, nothing happens in the UI)
alert_before

After:(creating a new Alert successful)
alert_after

@hstastna
Copy link
Contributor Author

hstastna commented Dec 6, 2018

@miq-bot add_label bug, blocker, hammer/yes

@hstastna hstastna force-pushed the Alert_creation_fail_nil branch 2 times, most recently from a813cd8 to 749539d Compare December 7, 2018 12:49
@hstastna hstastna changed the title [WIP] Fix failing creating new Alert in Control > Explorer Fix failing creating new Alert in Control > Explorer Dec 7, 2018
@hstastna
Copy link
Contributor Author

hstastna commented Dec 7, 2018

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Dec 7, 2018
Check successful adding Alert while no Send an E-mail option was chosen.
@hstastna
Copy link
Contributor Author

hstastna commented Dec 7, 2018

@skateman Could you, please, check the spec? 😏 Thanks!

@miq-bot
Copy link
Member

miq-bot commented Dec 7, 2018

Checked commits hstastna/manageiq-ui-classic@d9906ea~...37f4cf7 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍪

@skateman
Copy link
Member

skateman commented Dec 7, 2018

@hstastna looks good

@mzazrivec mzazrivec self-assigned this Dec 10, 2018
@mzazrivec mzazrivec added this to the Sprint 101 Ending Dec 17, 2018 milestone Dec 10, 2018
@mzazrivec mzazrivec merged commit 8615b74 into ManageIQ:master Dec 10, 2018
simaishi pushed a commit that referenced this pull request Dec 10, 2018
Fix failing creating new Alert in Control > Explorer

(cherry picked from commit 8615b74)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1654896
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit 8fb6d104870ed9088bc4553c506595c433462387
Author: Milan Zázrivec <mzazrivec@redhat.com>
Date:   Mon Dec 10 12:04:53 2018 +0100

    Merge pull request #5056 from hstastna/Alert_creation_fail_nil
    
    Fix failing creating new Alert in Control > Explorer
    
    (cherry picked from commit 8615b7476e823dd7ad9d5c7369006f2b472a58f8)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1654896

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.

None yet

5 participants