Bug 1536126 - Some tasks have no started time in Tasks table
Summary: Some tasks have no started time in Tasks table
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.9.0
Assignee: Yuri Rudman
QA Contact: Pavol Kotvan
URL:
Whiteboard: ui:automate
Depends On:
Blocks: 1543289
TreeView+ depends on / blocked
 
Reported: 2018-01-18 16:37 UTC by Pavol Kotvan
Modified: 2018-03-14 08:34 UTC (History)
13 users (show)

Fixed In Version: 5.9.0.18
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-06 15:27:43 UTC
Category: Bug
Cloudforms Team: Ansible
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Other tasks missing started_on field (176.58 KB, image/png)
2018-01-22 17:07 UTC, James Wong
no flags Details

Comment 3 James Wong 2018-01-19 22:12:40 UTC
In Fine release, the tasks now missing `Started` column used to be shown in 'All other Tasks' tab and UI is pulling in miq_task.created_on for the `Started` column.

Now after the project of merging jobs and tasks, UI tabs are merged as well and unified to show the `started_on` column.


Also updated title to reflect new findings.

Comment 5 Yuri Rudman 2018-01-19 23:56:15 UTC
Before G release: 
value for Started column on Tasks screen were populated from miq_task.created_on attribute. 

G release: 
- task screen has new column - 'Queued', which populated by the miq_task.created_on. So, we are not loosing data, it is just named correctly.

- new attribute created on miq_tasks table: 'started_on' and value of this attribute shown now in 'Started' column on tasks screen.
'started_on' will have valid date if state of task updated by  'MiqTask#update_status(MiqTask.STATE_ACTIVE, status,...)' call.

Comment 7 Yuri Rudman 2018-01-22 14:17:12 UTC
Above PR will set MiqTask#started_on if MiqTask#state updated directly ( update_attributes(:state => MiqTask::STATE_ACTIVE))

Comment 8 Jason Frey 2018-01-22 17:04:44 UTC
The PR changes the backend to ensure that the started on is set once the status of the MiqTask has been updated to "Active", however the code that's creating and using the MiqTask *must* set the status to Active, otherwise this PR will not have any effect.  Setting the status to Active is the responsibility of the caller, so if there are any missing "Started On" values after the PR is merged, then the caller (in this example, the Embedded Ansible team) would also have to make a change (cc jwong).

Comment 9 James Wong 2018-01-22 17:07:35 UTC
Created attachment 1384556 [details]
Other tasks missing started_on field

At least metric rollup tasks are also having this issue.

Comment 10 CFME Bot 2018-01-22 21:17:13 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/a56d3b7440b034e87e1189dc73974565f72c76d8

commit a56d3b7440b034e87e1189dc73974565f72c76d8
Author:     Yuri Rudman <yrudman>
AuthorDate: Mon Jan 22 07:44:50 2018 -0500
Commit:     Yuri Rudman <yrudman>
CommitDate: Mon Jan 22 08:30:43 2018 -0500

    added before_save callback to update MiqTask#started attribute if task become active
    https://bugzilla.redhat.com/show_bug.cgi?id=1536126

 app/models/miq_task.rb | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comment 15 James Wong 2018-01-24 13:37:45 UTC
A WIP PR for backend https://github.com/ManageIQ/manageiq/pull/16872

Comment 17 Yuri Rudman 2018-01-25 12:15:40 UTC
Above PR (for gaprindashvili only) will replace empty "Started" column with the same date as in "Queued" column.
I am still not sure if it is the right way to go ...

Comment 18 CFME Bot 2018-01-26 15:22:46 UTC
New commit detected on ManageIQ/manageiq/gaprindashvili:
https://github.com/ManageIQ/manageiq/commit/ab963eb0baa40c87d28da4c3303426f79f9b080c

commit ab963eb0baa40c87d28da4c3303426f79f9b080c
Author:     Yuri Rudman <yrudman>
AuthorDate: Wed Jan 24 14:42:14 2018 -0500
Commit:     Yuri Rudman <yrudman>
CommitDate: Wed Jan 24 16:33:33 2018 -0500

    temporary hack to show data in started_on column (on task managemnt screen) even if task's status was not updated to 'Active'
    https://bugzilla.redhat.com/show_bug.cgi?id=1536126

 app/models/miq_task.rb | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)


Note You need to log in before you can comment on or make changes to this bug.