openQA Python client

2015-03-19 Thread Adam Williamson
So the openQA API is pretty simple, and I kinda hate being tied to the 
'client' command that's part of the whole openQA package.

Sooo...I wrote a Python client for it. The openQA folks were nice 
enough to let me maintain it inside the os-autoinst github vendor 
space, so you can get it here:

https://github.com/os-autoinst/openQA-python-client

I've tested it works for POSTing ISOs (that's my test code right there 
in the README :>). I think we could port openqa_fedora_tools to use it 
for POSTing ISOs and then we could run all of openqa_fedora_tools from 
Fedora systems.

We could also use it for querying jobs in report_job_results.py - it's 
not *that* hard to just produce your own requests directly for read-
only stuff (as the code does at present), but using the library would 
let us run jobs on something other than localhost without writing all 
the config file parsing into report_job_results too.
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net

___
qa-devel mailing list
qa-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/qa-devel


Re: openQA crash reporting

2015-03-19 Thread Adam Williamson
On Thu, 2015-03-19 at 01:15 -0700, Adam Williamson wrote:
> hey folks! I mentioned this to jskladan on IRC, but just for the  
> permanent record, I'm working on optional crash report submission 
> for  openQA.

To follow up on a question Jan had on IRC:

 01:38:03> adamw: do you know whether reporter-bugzilla 
command is in OpenSUSE or not?

The answer is not officially, but jfilak maintains an OBS repo with 
builds:

https://build.opensuse.org/project/show/home:jfilak

Hasn't been updated for a year, though, don't know if it works on 13.2.

The other part of the answer is that this is why my patch allows you 
to specify the openQA URL: so you can run crash submission from a 
Fedora system. :) (in fact we should be able to make all of op
enqa_trigger usable from any system, if we make at least the 'client' 
command available in Fedora or just write a bit of Python to do API 
requests, the openQA API looks very simple).
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net

___
qa-devel mailing list
qa-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/qa-devel


libtaskotron: /var/cache/taskotron dir added

2015-03-19 Thread Kamil Paral
Hello,

those of you who use libtaskotron from git, please note that libtaskotron now 
requires one more directory (/var/cache/taskotron) to exist [1]. From now on, 
you should be notified if you're missing any of the important directories right 
at 'runtask' execution start (the execution will exit in that case).

I have also added this directory into conf/tmpfiles.d/taskotron.conf, so if you 
use automatic pruning of taskotron directories, be sure to update this file in 
your system.

Cheers,
Kamil

[1] https://phab.qadevel.cloud.fedoraproject.org/D266
___
qa-devel mailing list
qa-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/qa-devel


openQA crash reporting

2015-03-19 Thread Adam Williamson
hey folks! I mentioned this to jskladan on IRC, but just for the 
permanent record, I'm working on optional crash report submission for 
openQA.

at first I had the workers clicking through the graphical report 
submission process, but that has several problems:

a) needles and keypresses and blah
b) workers don't actually know the job ID or URL, so can't include it 
in the bug report
c) requires inventing some kind of way to get a BZ username and 
password into the workers without it being logged (doable, but just 
unnecessary work, when libreport-plugin-bugzilla already has this set 
up)

so instead I'm doing it in report_job_results.py in 
openqa_fedora_tools. It actually builds off D310, Jan's improvement to 
upload the contents of /var/tmp after a crash.

Given a job_id, we check if there's a var_tmp.tar.gz for that job, and 
if there is, we look for libreport 'problem directories' inside it. If 
we find any, we extract them from the tarball and run 'reporter-
bugzilla -d (directory)' on them.

That's really it in a nutshell, the rest is just error checks and glue 
and frills. There's an attempt to include the web UI job URL in the 
bug report for new crash reports (though so far I've been testing with 
a problem directory that shows up as a dupe of an existing report, so I
haven't tested this yet), and we capture the IDs of the bugs reported.

I also refactored the reporting functions a bit to avoid code 
duplication between calling report_job_results directly and using it 
from openqa_trigger, and made it possible to specify the openQA URL in 
a config file (so you can do result reporting from a system other than 
the openQA host itself - like, fr'instance, a Fedora system with 
libreport-plugin-bugzilla installed...)

To test it out you need a job in some openQA instance which has a 
var_tmp.tar.gz with a crash directory inside it: I've been testing 
with https://openqa.happyassassin.net/tests/2736 . You also need to 
put a valid BZ username and password in 
/etc/libreport/plugins/bugzilla.conf and, unless you're running on the 
openQA host itself (there *are* libreport packages for openSUSE in 
some OBS repository, but I haven't tried them), you'll want to create 
/etc/openqa_fedora.conf with this content:

[site]
url = https://openqa.happyassassin.net

(or whatever URL is appropriate).

Then you can do this:

python report_job_results.py --crashes 2736

(or whatever the job ID is).

This probably still needs a bit more testing and polish before I 
submit it as a differential, but I wanted to give people a heads-up 
that I was working on it and explain the general design. My current 
patch (against 'develop' branch, to which I've merged the 'live' work 
now) is attached.

In case you're wondering what happens with duplicate reports: I tested 
and it seems like 'not a lot'. When calling reporter-bugzilla in this 
way, if the crash has already been reported, it will only generate BZ 
activity if the BZ account in question isn't already on the CC list: 
it will add it. But if the BZ account is already on the CC list, it 
doesn't change the bug at all, it doesn't add the extra comment saying 
'another user encountered this issue'. I checked libreport and it 
actually only does that when some comment text has been provided, and 
we aren't providing one, so it gets skipped.

If we're still worried about noise on dupes it *is* possible to test 
if a bug is a dupe by checking the output of:

reporter-bugzilla -h $(cat duphash)

and completely skip the report submission step if it is, and I 
actually had that written, but took it out as it seemed unnecessary. 
Easy enough to put it back if we want to, though.

In the current version of the patch things are set up so that 
openqa_trigger current or openqa_trigger all or openqa_trigger compose 
--submit-results runs will try and report all crashes, but it's 
absolutely trivial to change that if we only want to report crashes 
via a separate invocation.

Comments welcome!
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net
From aa20bc32c79004269c2e10fdaf0fc69ed3ae4d81 Mon Sep 17 00:00:00 2001
From: Adam Williamson 
Date: Wed, 18 Mar 2015 20:58:43 -0700
Subject: [PATCH] allow reporting of crashes

This provides report_job_results with the ability to file bugs
for crashes encountered during tests. It requires a pending
change to openqa_fedora which uploads the contents of /var/tmp
for failed tests; libreport 'problem directories' are located
here.

report_crash() grabs the var_tmp.gz for the given job (if it's
available), extracts any problem directories found, and runs
reporter-bugzilla (with a slightly tweaked config file) on
them. It then finds the bug URL(s) and returns a list of them.
---
 tools/openqa_trigger/report_job_results.py | 186 +
 1 file changed, 163 insertions(+), 23 deletions(-)

diff --git a/tools/openqa_trigger/report_jo