Bug 816490 - bkr job-list should allow searching by owner, whiteboard, job id range
Summary: bkr job-list should allow searching by owner, whiteboard, job id range
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.8
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: 0.10.0
Assignee: Amit Saha
QA Contact: Qixiang Wan
URL:
Whiteboard: CommandLineEnhancement
: 696540 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-26 08:59 UTC by Frantisek Reznicek
Modified: 2018-02-06 00:41 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-22 06:42:29 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 679458 0 unspecified CLOSED RFE: Add option to bkr job-list to allow searching in whiteboards 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 822387 0 unspecified CLOSED RFE: XML-RPC method for listing my jobs 2021-02-22 00:41:40 UTC

Internal Links: 679458 822387

Description Frantisek Reznicek 2012-04-26 08:59:41 UTC
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-28 00:05:34 UTC
*** Bug 696540 has been marked as a duplicate of this bug. ***

Comment 2 Amit Saha 2012-10-18 01:51:52 UTC
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 07:54:03 UTC
On Gerrit: http://gerrit.beaker-project.org/#/c/1426/

Comment 5 Frantisek Reznicek 2012-10-23 13:27:08 UTC
(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 23:35:25 UTC
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 11:05:20 UTC
(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 08:42:35 UTC
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 06:42:29 UTC
This has now been released


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