Bug 1175853

Summary: [RFE] list my running jobs (using bkr command-line client)
Product: [Retired] Beaker Reporter: Ales Zelinka <azelinka>
Component: command lineAssignee: wangdong <dowang>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: developCC: dcallagh, dowang, ebaak, hliu, huiwang, mcermak, mjia, rjoost
Target Milestone: 24.0Keywords: FutureFeature, Patch, Reopened, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-21 18:49:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1175846    

Description Ales Zelinka 2014-12-18 18:27:22 UTC
I'd like to be able to list all my running(*) jobs from command-line.

(*) running as in "not finished yet" = including all the interim statuses like queue, scheduled and such.

Comment 1 Amit Saha 2014-12-18 23:30:04 UTC
(In reply to Ales Zelinka from comment #0)
> I'd like to be able to list all my running(*) jobs from command-line.
> 
> (*) running as in "not finished yet" = including all the interim statuses
> like queue, scheduled and such.

I think I would rather have "bkr job-list --mine" rather than a separate command.

Comment 2 Ales Zelinka 2014-12-19 15:42:47 UTC
Yup, that's pretty much what I had in mind: a new parameter for "bkr job-list" that would return running jobs. E.g. --running or a bit more lowlevel (and powerful) --status=running,queued,scheduled,...

This parameter when combined with --mine would then do what I want: return all my running jobs.

Comment 3 matt jia 2016-06-02 01:57:30 UTC
This bug has already been fixed by bug 822387.

Comment 4 Dan Callaghan 2016-06-02 14:43:52 UTC
The piece we are still missing is filtering for running (actually "incomplete") jobs.

Comment 5 matt jia 2016-06-05 23:30:43 UTC
(In reply to Dan Callaghan from comment #4)
> The piece we are still missing is filtering for running (actually
> "incomplete") jobs.

Yeah, you are right. I guess we could have a new option --status=New,Processed,Queued,Scheduled,Running... which matches the filter we have on the jobs page.

Comment 6 Dan Callaghan 2016-06-07 06:07:23 UTC
Let's start simple and just add --finished (Completed, Aborted, Cancelled) and --unfinished (everything else).

Comment 7 Dan Callaghan 2016-11-14 02:03:15 UTC
*** Bug 1394237 has been marked as a duplicate of this bug. ***

Comment 8 wangdong 2016-11-22 09:38:23 UTC
on gerrit:
https://gerrit.beaker-project.org/#/c/5456/

Comment 10 Hui Wang 2016-12-13 09:38:07 UTC
Verified this issue.
The result is PASS.
Version:
beaker-client-24.0-0.git.210.01bf

details:
$ bkr job-list --finished -o huiwang
["J:11829", "J:11753", "J:11736", "J:11735", "J:11734", "J:11733", "J:11732", ..
$ bkr job-list --unfinished -o jenkins/beaker-jenkins.rhev-ci-vms.eng.rdu2.redhat.com
["J:11890", "J:11889", "J:11888", "J:11887", "J:11886", "J:11885", "J:11882", "J:11881", "J:11879"]
$ bkr job-list --finished --unfinished
Usage: bkr job-list [options] ...

bkr: error: Only one of --finished or --unfinished may be specified


Just one concern:
In production, there will list about 252860 finished jobs if when end user run $bkr job-list with no --owner.

Comment 11 Dan Callaghan 2017-02-21 18:49:46 UTC
Beaker 24.0 has been released.

Comment 12 Martin Cermak 2017-02-23 13:57:12 UTC
Brilliant, works for me. Thanks!