Bug 1112131 - [RFE] accept and preserve arbitrary XML elements in job XML
Summary: [RFE] accept and preserve arbitrary XML elements in job XML
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: general
Version: 0.16
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: 22.0
Assignee: Roman Joost
QA Contact: tools-bugs
URL:
Whiteboard:
: 1269105 (view as bug list)
Depends On:
Blocks: 1193570
TreeView+ depends on / blocked
 
Reported: 2014-06-23 08:14 UTC by David Kutálek
Modified: 2018-02-06 00:41 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-14 05:34:14 UTC
Embargoed:


Attachments (Terms of Use)

Description David Kutálek 2014-06-23 08:14:54 UTC
Description of problem:

Please provide a place in a beaker job to store arbitrary job generator data, eg. command line used to schedule the job. So when eg. cloning a job via UI you can find it in xml offered for the clone. 

Particularly as I use wow workflow, I can imagine it can easily do the job automatically for users. Some of my 'bkr wow ...' commands are like five and more liners and now I just use bash history & manual copy-paste into tcms...

As already discussed on mailing list, data stored is not to be used by Beaker itself anyhow, it is just for convenience of Beaker users.

Something similar to job whiteboard. But since whiteboard is already heavily used in other meanings (like 'job title'), we need other such a place. Something like <generator/> or possibly a namespace support so that tools can use any tags within their namespace.

Version-Release number of selected component (if applicable):

Version 0.16.2

Comment 1 Nick Coghlan 2014-06-23 08:22:10 UTC
The general concept gets a +1 from me - similar to the recent addition of the "remote_post" metavar, I think some kind of arbitrary "job annotations" capability (whether using XML namespaces or as a dedicated element) would allow Beaker to become a more powerful and flexible platform without significantly increasing the complexity of the core Beaker application.

Comment 2 David Kutálek 2015-10-06 17:00:04 UTC
Independently this need popped up once more in bug 1269105,
so it seems there is a real demand for this feature.

Please can you take a look once more and raise prio?

Comment 3 David Kutálek 2015-10-06 17:10:10 UTC
I would be more happy with more general solution (like namespaces?)
so that that users can easily store a little bit more data in their other use cases, if necessary, without having to add yet another tags via another bugs here.

Comment 4 Eva Mrakova 2015-10-07 06:24:55 UTC
*** Bug 1269105 has been marked as a duplicate of this bug. ***

Comment 5 Roman Joost 2015-10-12 23:21:46 UTC
Dear David,

my apology for the late reply. We're considering expanding the whiteboard field to accept multiple lines (as proposed by https://beaker-project.org/dev/proposals/job-page-improvements.html see Whiteboards). Would that go in the direction you were proposing with this bug?

Comment 6 David Kutálek 2015-10-13 12:45:57 UTC
(In reply to Roman Joost from comment #5)
> Dear David,
> 
> my apology for the late reply. We're considering expanding the whiteboard
> field to accept multiple lines (as proposed by
> https://beaker-project.org/dev/proposals/job-page-improvements.html see
> Whiteboards). Would that go in the direction you were proposing with this
> bug?

Hi Roman,

basic direction yes. Not sure this is the best specific route to go.
As noted in linked document, whiteboard is now used more or less as title
in gui and that fits me very well.

Info we would like to store is IMHO not to be consumed by user always, or regularly. I would like to get to it via GUI, but not be visible by default, as it is not needed in all times and could be quite big text.

So what about having new 'title' element together with existing 'whiteboard' element?

Comment 7 Dan Callaghan 2015-10-13 22:15:48 UTC
I think the whiteboard should remain as the human-friendly description. In the new job page we will accept Markdown and show multiple lines, which will be useful I think.

But for this RFE, which is really about embedding machine-readable metadata in the job, I think the original idea of having Beaker preserve arbitrary elements in other XML namespaces is the nicest one.

For context, here was the original thread where we discussed it:

http://post-office.corp.redhat.com/archives/beaker-dev-list/2014-June/msg00051.html

Comment 8 Dan Callaghan 2015-10-13 22:25:42 UTC
To keep the implementation simple, I would start out by only allowing the arbitrary elements at the top level inside <job/>, like this:

    <job>
        <options xmlns="http://example.com/mytool">--distro RHEL6</options>
        <whiteboard>Running tests on RHEL6</whiteboard>
        ...

where the <options/> could be any arbitrary XML element including any other arbitrary XML content, which Beaker will store as is. So it would be possible to store actual structured data in there too if desired.

Then when viewing job results XML the same elements will be included. It wouldn't preserve the *order* or *position* of the elements within <job/> because Beaker doesn't store things that way. They would always be dumped out at the top in arbitrary order.

Should Beaker also preserve the extra XML elements when cloning a job?

Comment 9 David Kutálek 2015-10-14 08:04:51 UTC
(In reply to Dan Callaghan from comment #8)
> To keep the implementation simple, I would start out by only allowing the
> arbitrary elements at the top level inside <job/>, like this:
> 
>     <job>
>         <options xmlns="http://example.com/mytool">--distro RHEL6</options>
>         <whiteboard>Running tests on RHEL6</whiteboard>
>         ...
> 
> where the <options/> could be any arbitrary XML element including any other
> arbitrary XML content, which Beaker will store as is. So it would be
> possible to store actual structured data in there too if desired.
> 
> Then when viewing job results XML the same elements will be included. It
> wouldn't preserve the *order* or *position* of the elements within <job/>
> because Beaker doesn't store things that way. They would always be dumped
> out at the top in arbitrary order.
> 
> Should Beaker also preserve the extra XML elements when cloning a job?

I would be very happy with this proposed solution.

We should definitely preserve these extra XML elements when cloning a job. It is kind of a property of the job and it should be user's responsibility to clean/modify these elements when needed.

Do you have some ETA when we can expect implementation?

Comment 10 Roman Joost 2015-11-05 04:23:57 UTC
Dear David,

I'm picking this one up and work on it. A conservative ETA is early next year. I'll keep you posted on the progress on this bug.

Comment 11 David Kutálek 2015-11-05 09:18:37 UTC
Thank you Roman, I am happy you will be working on that.

Comment 12 Roman Joost 2015-11-11 05:32:02 UTC
First patch set is up:

https://gerrit.beaker-project.org/#/c/4478/1

Comment 13 Roman Joost 2015-12-07 00:38:29 UTC
This bug fix is included in beaker-server-22.0-0.git.110.c41cd4c which is currently available for testing here:

https://beaker-devel.app.eng.bos.redhat.com/

Comment 15 Dan Callaghan 2016-01-14 05:34:14 UTC
Beaker 22.0 has been released.


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