Home Home > Hackweek
Sign up | Login

Deprecation notice: openSUSE Lizards user blog platform is deprecated, and will remain read only for the time being. Learn more...

Archive for the ‘Hackweek’ Category

Hackweek IV: Novell Bugzilla access from command line

July 29th, 2009 by

During a last Hackweek I decided to work on some tool which will helps users with submitting a new bug. My idea is to create something like reportbug from Debian, but targeted to SUSE. So the first step was find the way how to communicate with a bugzilla (especially to bugzilla.novell.com – bnc). Fortunately I found several libraries, which should be used for it:

perl-SUSE-BugzillaClient is written by Thomas Schmidt especially for bnc, so it is able to login using iChain. It also provides few functions for bugzilla communication, but unfortunately only for querying. Pybugz is written by Alastair Tse for Gentoo development in Python. But it is not able to login through iChain and I did not extended it for bnc, because it uses a plain GET/POST communication with parsing of HTML using regexes.

The reason why I have used the python-bugzilla written by Will Woods from RedHat is simple. It uses XMLRPC API, which bugzilla provides. And it’s also written with a flexibility in mind, so writing of another type of Bugzilla was easy. Just some subclassing and reimplementing of few methods and voila, the NovellBugzilla type is here. Because it uses iChain, it was necessary to reimplement login/logout methods – I spend a lot of time to understand how it works. Osc uses a HTTP authentication, which should be supported too, but even if it works with api.opensuse.org, it did not work with bnc. So I used a Firefox and LiveHTTP headers extension to track a communication and implemented the login according it.

The useful advantage of Novell bugzilla is that I extended a method readconfig, which reads a config file. Novell Bugzilla can read the username/password from ~/.oscrc, so you don’t need to have a same password in another config file, if you use osc.

So on the end those few lines of Python code

import bugzilla

bnc = bugzilla.NovellBugzilla(url="https://bugzilla.novell.com", user="mvyskocil", password="XXXXX")
kwargs = {
    'product': 'openSUSE 11.2',
    'severity': 'Normal',
    'cc': [],
    'rep_platform': 'x86-64',
    'component': 'Java',
    'summary': '[Java:packages/ant]: Cannot find a Java virtual machine',
    'version': 'unspecified',
    'assigned_to': 'mvyskocil@novell.com',
    'op_sys': 'Linux',
    'description': 'This is a testing bug report\n'
    }
bug = bnc.createbug(**kwargs)
print bug.bug_id

Have created this bug#525549. Even if Python is readable for regular programmers, the **kwargs should be expressed. It maps the dictionary to named function arguments (called keyword arguments – kwargs – in a Python world), so both calls in following snippet are equivalent.

d = {'name' : 'value')
call(**d)
call(name='value')

The python-bugzilla comes also with a simple command line tool called bugzilla, so this tool should be used also from shell scripts. It is sometimes little bit raw. For example listing of all products returns an output as a Python dictionary

bugzilla --bztype NovellBugzilla --user mvyskocil --password xxxxxx info -p
...
{'description': 'openSUSE 11.1', 'internals': {'disallownew': 0, 'classification_id': 7340, 'name': 'openSUSE 11.1', 
'votestoconfirm': 0, 'milestone_required': 0, 'id': 651, 'votesperuser': 20, 'maxvotesperbug': 5, 'defaultmilestone': '---',
'milestoneurl': '', 'description': 'openSUSE 11.1'}, 'name': 'openSUSE 11.1', 'id': 651} 
{'description': 'openSUSE 11.2', 'internals': {'disallownew': 0, 'classification_id': 7340, 'name': 'openSUSE 11.2',
'votestoconfirm': 0, 'milestone_required': 0, 'id': 755, 'votesperuser': 20, 'maxvotesperbug': 5, 'defaultmilestone': '---',
'milestoneurl': '', 'description': 'openSUSE 11.2'}, 'name': 'openSUSE 11.2', 'id': 755}
...

which might be hard to parse in other language. But it provides a lot of functionality, so for other informations about usage, please use man bugzilla.

Build Service for Package Testing – and Making Factory Updates Smaller

July 24th, 2009 by

I’ve blogged already about the work done by Coolo and Michael on reducing the size of factory updates.  Looking into some  of the packages that did not get filtered out due to timestamps, I decided to use that as my hackweek project – and learn some more about the openSUSE Build Service.

Coolo told me that I could create a small project in OBS with packages I wanted to look at and with my testing version of build-compare.  So, I created a project and set it up to build against openSUSE:Factory and linked some packages from factory into the project.

(more…)

Further Hackweek IV Impressions

July 23rd, 2009 by

I spend quite some time today going through the offices in Novell’s Nürnberg office and talked with engineers what they are doing for hackweek.  There were a lot of interesting projects and ideas and I decided to write about some of them. I look forward to see many of the changes in openSUSE 11.2.  Some people have entered their Hackweek projects in openFATE and we have created an openFATE  start page for Hackweek.

(more…)

Ullae-veliyae (iotop-gui) : Hackweek

July 23rd, 2009 by

The hackweek project I worked on was to implement a live graphing utility for per process I/O data. See https://features.opensuse.org/306941 (Yes, I added the fate request, just now, after doing most of the work.)

Screen-shots, RPM download link, project homepage link,..

(more…)

Some Impressions from Hackweek

July 21st, 2009 by

I just wanted to introduce briefly two projects that I found interesting while talking yesterday with developers:

Richard Günther has been looking into making factory updates smaller.  He writes in the Wiki that his first milestone has been reached – the %{release} macro does not contain the rebuild number and therefore instead of syncing out all RPMs of a package, we can limit it to those that have changed.  His next task is creating debuginfo packages for each subpackage instead of a single one that accompanies all packages.

Jiri Kosina and Vojtech Pavlik are working on an automated bug screened, based on Bayesian self-learning algorithms.  The simple tool will suggest the best assignee of a bug based on a description and Bugzilla field values.

Note that we’re just at day two of hackweek, so some of these projects might fail.

Feel free to ping me, if I should introduce your project as well.

Hackweek: Application Directory Interface for OBS

July 20th, 2009 by

Frank Karlitschek is joining us here in Nürnberg to work with us through the Hackweek. First project is to build and integrate an interface where webapps like www.kde-apps.org can get information from about binary packages that exist on the openSUSE Buildservice. That will make it very easy for upstream developers who build their package for several distros in OBS to get a list of available binaries in the application directory application. In kde-apps.org which will use this first you just need to enter the name of OBS project and package and the download links for rpms or deps will appear automagically. That takes away the pain to maintain lenghty lists of links to rmps 🙂

The specification is in the Wiki – Buildservice Concepts. Comments are welcome.

Build maemo-apps with openSUSE BuildService ? – It works !

January 27th, 2009 by

build serviceThe openSUSE Build Service is an open and complete distribution development platform. It’s the infrastructure for a development of the openSUSE distributions. But this powerful tool can do much more! The upcoming version 1.5 will also have cross-build support and thus be able to build e.g. ARM packages on x86 hardware .

maemo.org loko Maemo is the platform for mobile devices like the N810 and has been developed by Nokia in collaboration with many open source projects such as the Linux kernel, GNOME and many more. (more…)

Modding the openSUSE flashlight

January 19th, 2009 by

The openSUSE flashlight

The boxed version of openSUSE 11.1 comes bundled with a LED-flashlight. Nice black and sturdy aluminum, Modern design with 9 white LEDs, no old-fashioned bulb that would produce more heat than illumination. Not flimsy, not heavy, just practical and quite bright. Batteries included. Exactly what I like.

But alas, this high-tech-toy is not perfect. The LEDs produce a strange unnatural light, which makes people look really sick. It gives a bluish-greenish tint to everything. This I don’t like. Okay, it is state of the art with regard to white LEDs, so this is no real reason to complain. Still, it leaves room for improvement.

Let us adjust the color of the light, so that objects look more natural. This posting explains you how to do it in 3 easy (or 4 not so easy) steps.
(more…)

openSUSE Buildservice: cross-build

October 4th, 2008 by

There is some good news for you: in cooperation with Marcus Hüwe the download on demand feature is now working seamlessly with cross-build, making it a combined “super feature”.

Also, I have put together a “condensed” cross-build in OBS document in the OBS Wiki Concepts collection.

New OBS cross-build installation packages will be provided inside openSUSE:Tools:Devel soon.

Have fun.

Developing with libyui/libzypp & python – part3

October 3rd, 2008 by

In part 1 we installed and tested libyui and its python binding and part 2 was about constructing the GUI. Now its time for the libzypp-bindings – of course for python ;). So far the GUI looks like:


We will import a repository’s metadata and list its content. But let’s move on …
I assume you have already installed the software from part 1. Then we’ll just donwload the missing parts.
zypper in prefix-opt-python-zypp prefix-opt-libzypp

(more…)