Bug 1298055

Summary: [RFE] ability to set a job or recipe's whiteboard from the CLI
Product: [Retired] Beaker Reporter: Naoya Horiguchi <naoya.horiguchi>
Component: generalAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: dcallagh, huiwang, junichi.nomura, mjia, rjoost
Target Milestone: 23.3Keywords: FutureFeature, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-07 06:44:45 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:

Description Naoya Horiguchi 2016-01-13 05:35:31 UTC
Currently we have no easy-to-use API to get/set whiteboard contents
of Beaker jobs/recipes.
So please implement lacking APIs with some documents such as:
  - /jobs/<job_id>/whiteboard (GET/PUT)
  - /recipes/<recipe_id>/whiteboard (GET/PUT)

Background:

In our usecase, whiteboard contains not only test descriptions, but
also some additional information left by reviewers (including review
scripts) for testers to easily track the review status (not limited
to just 'ack/nack').

Though we can edit job whiteboard via web UI, we also want to do it in
an automated manner. Lack of APIs limits the efficiency of our review
process of test results.
And as for recipe whiteboard, there's no functionality to edit it
once the recipe is created, which is inconvenient.

Additional information:

Optionally, 'bkr' subcommand to access the APIs is also nice. One
example of usage is like below:

  $ w=$(bkr job-modify --get-whiteboard R:1234)
  $ bkr job-modify --set-whiteboard "$w [Failed but OK]" R:1234

Comment 1 Dan Callaghan 2016-07-19 02:05:01 UTC
As of Beaker 23, we have

GET /jobs/(id)
PATCH /jobs/(id)
GET /recipes/(id)
PATCH /recipes/(id)

which produce/consume JSON with a key of 'whiteboard'. However there's no option in bkr job-modify for whiteboard yet. It should be easy enough to add a new option: bkr job-modify --whiteboard "new value", to update it.

Comment 2 Dan Callaghan 2016-07-19 02:09:28 UTC
I don't think we would add a --get-whiteboard option to bkr job-modify though, since it doesn't fit with the rest of the options (nor with the purpose of that command). The only way to get the whiteboard from the CLI is to use bkr job-results and then parse the XML, for example:

bkr job-results J:123 | xmlstarlet sel -t -v 'job/whiteboard'

Comment 3 Dan Callaghan 2016-07-19 02:13:05 UTC
(In reply to Naoya Horiguchi from comment #0)
>   $ bkr job-modify --set-whiteboard "$w [Failed but OK]" R:1234

BTW you could also consider using the waiving and commenting functionality, which has been greatly improved in Beaker 23, for this purpose instead.

Waiving and commenting are available in the web UI and with new APIs. For the CLI we have bug 853350.

Comment 4 Naoya Horiguchi 2016-07-19 02:23:36 UTC
(In reply to Dan Callaghan from comment #1)
> As of Beaker 23, we have
> 
> GET /jobs/(id)
> PATCH /jobs/(id)
> GET /recipes/(id)
> PATCH /recipes/(id)
> 
> which produce/consume JSON with a key of 'whiteboard'. However there's no
> option in bkr job-modify for whiteboard yet. It should be easy enough to add
> a new option: bkr job-modify --whiteboard "new value", to update it.

Great to hear that, I'll wait for the new option to be available.

Naoya

Comment 5 Dan Callaghan 2016-10-10 04:43:35 UTC
Converting this RFE to be just about setting the whiteboard with bkr job-modify.

I assume that getting the whiteboard from bkr job-results is sufficient -- or if it's not, we can come up with something better, but it wouldn't be in the bkr job-modify command.

Comment 6 Dan Callaghan 2016-10-10 05:48:06 UTC
http://gerrit.beaker-project.org/5304

Comment 7 Dan Callaghan 2016-10-21 03:35:26 UTC
This bug fix is included in beaker-client-23.3-0.git.18.3350a63 which is currently available for download here:

https://beaker-project.org/nightlies/release-23/

Comment 9 Dan Callaghan 2016-11-07 06:44:45 UTC
Beaker 23.3 has been released.