Bug 1558627

Summary: Automate Schedule: "Starting time" field saves nonsense.
Product: Red Hat CloudForms Management Engine Reporter: Milan Falešník <mfalesni>
Component: UI - OPSAssignee: Harpreet Kataria <hkataria>
Status: CLOSED CURRENTRELEASE QA Contact: Dmitry Misharov <dmisharo>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, dmisharo, hkataria, lavenel, mpovolny, obarenbo
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.10.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1560104 (view as bug list) Environment:
Last Closed: 2019-02-11 14:07:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1560104    

Description Milan Falešník 2018-03-20 16:04:32 UTC
Description of problem:
When I want to schedule an automate task and specify its starting hour, it behaves weirdly and stores either curret time or 01:00 (assuming midnight given my location has +1).

Version-Release number of selected component (if applicable):
5.9.1.0, 5.9.0.22

How reproducible:
always

Steps to Reproduce:
1. Go to Configuration / Schedules and create a simple Automation Task schedule. You can try both Once and Hourly, it does the same. Make sure you set the time to the future, pick eg. 22:45
2. After save, you can see the current time got saved instead of the selected one.
3. Try editing the schedule, you can see the time of creation in there. Notice that if you did not make the creation on a minute divisible by 5, the minute dropdown says Nothing selected.
4. Now, select a proper future time again (eg. 22:15). Save the schedule.
5. Look at the schedule now, the time is 01:00 (00:00 UTC, I am +1).

Actual results:
Times set wrong

Expected results:
Times set correctly.

Additional info:
It looks like the other kinds of schedules are not affected, I tested the Compliance ones and they seem to work fine.

Comment 2 Milan Falešník 2018-03-20 16:37:17 UTC
*** Bug 1558628 has been marked as a duplicate of this bug. ***

Comment 4 CFME Bot 2018-03-23 14:52:46 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/413e81d6bfbad8dc5a943a81e4aabc4d7e9b6d10
commit 413e81d6bfbad8dc5a943a81e4aabc4d7e9b6d10
Author:     Harpreet Kataria <hkataria>
AuthorDate: Wed Mar 21 17:43:10 2018 -0400
Commit:     Harpreet Kataria <hkataria>
CommitDate: Wed Mar 21 17:43:10 2018 -0400

    Fixed schedule editor to convert/save start time correctly

    Need to only pass date to create_time_in_utc method call, prior to fix code was passing in datetime as "Mon Mar 12 2018 20:00:00 GMT-0400 (EDT) 1:5:00", having timezone and time in the start_date parameter was messing the conversion up. Changed miq_datepicker.js to convert string into moment first and then convert it to utc, that solves the issue where Date being sent upto server was -1 day of selected day.

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

 app/assets/javascripts/controllers/schedule/schedule_form_controller.js | 2 +-
 app/assets/javascripts/directives/miq_datepicker.js | 2 +-
 app/controllers/ops_controller/settings/schedules.rb | 2 +-
 spec/controllers/ops_controller/settings/schedules_spec.rb | 11 +
 4 files changed, 14 insertions(+), 3 deletions(-)

Comment 6 Dmitry Misharov 2018-06-26 08:58:20 UTC
Fixed and verified in 5.10.0.1.20180619163011_900fdc4. Time set correctly in schedules for Automate Tasks.