Bug 1371279 - [RFE] Running jobs that resolve to 0 hosts result as 'succeeded'
Summary: [RFE] Running jobs that resolve to 0 hosts result as 'succeeded'
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Remote Execution
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-29 18:57 UTC by Craig Donnelly
Modified: 2019-11-14 09:00 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 19:11:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 16993 0 None None None 2016-10-18 13:41:58 UTC

Description Craig Donnelly 2016-08-29 18:57:21 UTC
Description of problem:
If we run a remote execution job that has a 'search query' which resolves to 0 hosts, the job will still run but show a mis-leading success.

Version-Release number of selected component (if applicable):
Satellite 6.2.1:
rubygem-smart_proxy_remote_execution_ssh-0.1.2-2.el7sat.noarch
tfm-rubygem-smart_proxy_remote_execution_ssh_core-0.1.2-1.el7sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. Goto Monitor -> Jobs
2. Click Run Job
3. Create a search query that resolves to 0 hosts, for example:
last_report < "30 minutes ago" and status.enabled = false
4. Submit job.

Actual results:
Shows evaluated against 0 hosts, but shows succeeded on right side (where we normally see percentage complete for job run).
Hosts tab is empty.
Monitor -> Jobs shows a job with 0 total hosts, and 0 actions, with status 'succeeded'.

Expected results:
Should not allow job to run if it resolves to 0 hosts on job submission.

Comment 2 Adam Ruzicka 2016-10-18 13:41:19 UTC
REX can handle resolving the search query two ways, static and dynamic. Static is evaluated when the user submits the form, dynamic is evaluated 

REX has two ways of resolving the search query. Citing the explanation from the new job invocation form:

"Type has impact on when is the query evaulated to hosts.
Static evaluates just after you submit this form.
Dynamic evaluates just before the execution is started, so if it's planed in future, targeted hosts set may change before it."

This means we can implement a check and display some kind of validation error in case there are no hosts, but this can be done only when using the static query. 

When using the dynamic query we could show some kind of warning like "right now, this search query would resolve to no hosts", but we can't stop the execution, because the query will be resolved later and the number of hosts matching it might change.

Would this work for you?

Comment 3 Adam Ruzicka 2016-10-18 13:41:56 UTC
Created redmine issue http://projects.theforeman.org/issues/16993 from this bug

Comment 4 Craig Donnelly 2016-10-31 16:31:31 UTC
This sounds fine to me.
I really was not aware of the other type of query.

Comment 5 Bryan Kearney 2018-09-04 18:59:53 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.

Comment 6 Bryan Kearney 2018-09-04 19:11:56 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.


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