Bug 816490 - bkr job-list should allow searching by owner, whiteboard, job id range
bkr job-list should allow searching by owner, whiteboard, job id range
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: command line (Show other bugs)
0.8
Unspecified Unspecified
low Severity medium (vote)
: 0.10.0
: ---
Assigned To: Amit Saha
Qixiang Wan
CommandLineEnhancement
: FutureFeature
: 696540 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-26 04:59 EDT by Frantisek Reznicek
Modified: 2015-11-15 20:14 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-22 01:42:29 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Frantisek Reznicek 2012-04-26 04:59:41 EDT
Description of problem:
Beaker XMLRPC interface does not provide all actions as Beaker GUI.

Specifically Job search is possible using following creteria:

  [freznice@dhcp-26-251 bkr]$ bkr job-list -h
  Usage: bkr.exe job-list [options] ...
  
  Options:
    -h, --help                                    show this help message and exit
    --username=USERNAME                           specify user
    --password=PASSWORD                           specify password
    -f FAMILY, --family=FAMILY                    Family for which the Job is run against
    -c COMPLETEDAYS, --completeDays=COMPLETEDAYS  Number of days job has been completed for
    -t TAG, --tag=TAG                             Jobs with a particular tag
    -p PRODUCT, --product=PRODUCT                 Jobs for a particular product


What is missing (very minimalistic):
 - search by job number (ranged)
 - search by owner
 - search by whiteboard


Generally Beaker XMLRPC interface should allow at least the options which can be selected using Beaker Web UI.


Version-Release number of selected component (if applicable):
beaker-0.8.2-5.el5 brewbuild

How reproducible:
100%

Steps to Reproduce:
1 bkr job-list -h

  
Actual results:
  XMLRPC job search very limited

Expected results:
  XMLRPC job search more flexible
Comment 1 Dan Callaghan 2012-09-27 20:05:34 EDT
*** Bug 696540 has been marked as a duplicate of this bug. ***
Comment 2 Amit Saha 2012-10-17 21:51:52 EDT
Hi Frantisek,

A number of the things you have mentioned has now been added as patches against a couple of other bugs. (See: https://bugzilla.redhat.com/show_bug.cgi?id=679458 and https://bugzilla.redhat.com/show_bug.cgi?id=822387). 

Would you be able to let me know what kind of use case are you targeting for the search by job ID range? If it is to filter out old jobs, would it be better if there was a way to search by the job submission date? 

Thanks.
Comment 3 Amit Saha 2012-10-18 03:54:03 EDT
On Gerrit: http://gerrit.beaker-project.org/#/c/1426/
Comment 5 Frantisek Reznicek 2012-10-23 09:27:08 EDT
(In reply to comment #2)
> Hi Frantisek,
> 
> A number of the things you have mentioned has now been added as patches
> against a couple of other bugs. (See:
> https://bugzilla.redhat.com/show_bug.cgi?id=679458 and
> https://bugzilla.redhat.com/show_bug.cgi?id=822387). 
> 
> Would you be able to let me know what kind of use case are you targeting for
> the search by job ID range? If it is to filter out old jobs, would it be
> better if there was a way to search by the job submission date? 

Fair enough.
Submission date works for me as well (if it is ranged).
The use case was to be able to narrow other search result by time, for instance:
- combination search by owner in last 1000 jobs
  (I'm fine with modification search by owner in last N days)
- search by whiteboard but ignore last 2000 jobs

> 
> Thanks.
Comment 6 Amit Saha 2012-10-23 19:35:25 EDT
The proposed patch adds support for --min-id and --max-id options which allows you to specify a  minimum Job ID, a maximum Job ID or both. You can then use queries such as:

List all jobs with IDs between 10-100 (both inclusive):

$ bkr job-list --min-id=10 --maxid=100

List all scratch jobs with IDs between 10-100:

$ bkr job-list --tag=scratch --min-id=10 --max-id=100

List all scratch jobs with min ID of 10:

$ bkr job-list --tag=scratch --min-id=10


Does that help you?
Comment 7 Frantisek Reznicek 2012-11-01 07:05:20 EDT
(In reply to comment #6)
> The proposed patch adds support for --min-id and --max-id options which
> allows you to specify a  minimum Job ID, a maximum Job ID or both. You can
> then use queries such as:
> 
> List all jobs with IDs between 10-100 (both inclusive):
> 
> $ bkr job-list --min-id=10 --maxid=100
> 
> List all scratch jobs with IDs between 10-100:
> 
> $ bkr job-list --tag=scratch --min-id=10 --max-id=100
> 
> List all scratch jobs with min ID of 10:
> 
> $ bkr job-list --tag=scratch --min-id=10
> 
> 
> Does that help you?

Yes it does. Thanks.
Comment 8 Qixiang Wan 2012-11-09 03:42:35 EST
Verified with beaker-client-0.9.4-2.git.96.40f4404

Now beaker-client provide the support for --min-id and --max-id options for job-list command like the following:

# bkr job-list --min-id=10 --max-id=100
[['J:100', 'J:99', 'J:98', 'J:97', 'J:96', 'J:95', 'J:92', 'J:91', 'J:90', 'J:89', 'J:88', 'J:87', 'J:86', 'J:85', 'J:84', 'J:83', 'J:82', 'J:81', 'J:80', 'J:67', 'J:63', 'J:62', 'J:60', 'J:59', 'J:54', 'J:53', 'J:29', 'J:25', 'J:23', 'J:22', 'J:19', 'J:14'], 'Count: 32']
# bkr job-list --tag=scratch --min-id=10 --max-id=100
[['J:100', 'J:99', 'J:98', 'J:97', 'J:96', 'J:95', 'J:92', 'J:91', 'J:90', 'J:89', 'J:88', 'J:87', 'J:86', 'J:85', 'J:84', 'J:83', 'J:82', 'J:81', 'J:80', 'J:67', 'J:63', 'J:62', 'J:60', 'J:59', 'J:54', 'J:53', 'J:29', 'J:25', 'J:23', 'J:22', 'J:19', 'J:14'], 'Count: 32']
# bkr job-list --tag=scratch --min-id=10
[['J:195', 'J:194', 'J:193', 'J:192', 'J:191', 'J:190', 'J:189', 'J:188', 
<snip>
'J:59', 'J:54', 'J:53', 'J:29', 'J:25', 'J:23', 'J:22', 'J:19', 'J:14'], 'Count: 126']
Comment 9 Raymond Mancy 2012-11-22 01:42:29 EST
This has now been released

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