From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-qa+bounces-75-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1MP1Id-0000m7-0G
	for garchives@archives.gentoo.org; Thu, 09 Jul 2009 21:37:03 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 2CAC2E02F0;
	Thu,  9 Jul 2009 21:37:02 +0000 (UTC)
Received: from mail-fx0-f211.google.com (mail-fx0-f211.google.com [209.85.220.211])
	by pigeon.gentoo.org (Postfix) with ESMTP id A9372E02F0;
	Thu,  9 Jul 2009 21:37:01 +0000 (UTC)
Received: by fxm7 with SMTP id 7so429140fxm.34
        for <multiple recipients>; Thu, 09 Jul 2009 14:37:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:date:from:to:cc:subject
         :message-id:references:mime-version:content-type:content-disposition
         :in-reply-to:jabber-id:icq-uin:x-pgp-key:user-agent;
        bh=I7oHoCwuixZYq706zWbRjVPZkiz1ZuYi07K2YgdxyOo=;
        b=GE28bWcMsUv99uE1+pUPu1mjvlxC8fZzS0/o3kyX4OcSGqu3Fjb36e5SXzwMqcuNpI
         lid/hV29s6AbHrI83z80Y+V+Pp1ooSokkP8i8d9RgaQwIt2k13hN3HZ4T6k7PicD8GrK
         s9Z2JvAEv3bnaw/4uqob7PFcfGZBxeABZD9vo=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=date:from:to:cc:subject:message-id:references:mime-version
         :content-type:content-disposition:in-reply-to:jabber-id:icq-uin
         :x-pgp-key:user-agent;
        b=OaYBKJr4NtXhH22FjJDv7JQlH+3/TIkRD+T+LwNbtMMSJe7/zi1/o0kA3zArLy0uhw
         BiaIYDGCuVoHED8go9wcONe9DzH6fvIiZJ+6QjI3OM4z9dHggnXy3d+WdssjXPIuX9OI
         WJAE2/Kz6pXCubj47TVeHjW1+CwF1LxJVv2P4=
Received: by 10.103.213.9 with SMTP id p9mr672958muq.121.1247175421000;
        Thu, 09 Jul 2009 14:37:01 -0700 (PDT)
Received: from @ (adsl-dyn14.91-127-70.t-com.sk [91.127.70.14])
        by mx.google.com with ESMTPS id e8sm1698914muf.6.2009.07.09.14.36.59
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Thu, 09 Jul 2009 14:36:59 -0700 (PDT)
Date: Thu, 9 Jul 2009 23:36:09 +0200
From: Stanislav Ochotnicky <sochotnicky@gmail.com>
To: gentoo-qa@lists.gentoo.org
Cc: gentoo-soc@lists.gentoo.org
Subject: [gentoo-qa] Re: [GSoC-status] Collagen - database schema and further changes
Message-ID: <20090709213609.GA21248@w0rm>
References: <20090626125103.GA13253@w0rm> <20090703154127.GA32664@w0rm>
Precedence: bulk
List-Post: <mailto:gentoo-qa@lists.gentoo.org>
List-Help: <mailto:gentoo-qa+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-qa+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-qa+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-qa.gentoo.org>
X-BeenThere: gentoo-qa@lists.gentoo.org
Reply-to: gentoo-qa@lists.gentoo.org
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc"
Content-Disposition: inline
In-Reply-To: <20090703154127.GA32664@w0rm>
jabber-id: sochotnicky@gmail.com
icq-uin: 74274152
X-PGP-Key: https://dl.getdropbox.com/u/165616/sochotnicky-key.asc
User-Agent: Mutt/1.5.16 (2007-06-09)
X-Archives-Salt: 44b51f6b-8b44-4def-90d8-d9eecbb22914
X-Archives-Hash: abe7059da45ca8b2e009e451b293dc58


--C7zPtVaVf+AK4Oqc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Heya everyone,

another (almost) week went by so here is another status report.=20

As I stated in my last report one of key goals for this week was db
layer for storing information retrieved by tinderboxes. I was looking
into using various ORM frameworks. It was suggested to me to try Django
and I though "Hey, that's not even ORM framework, but a web framework".

Well one part of my project is creating web interface for database at
later stage. So in spirit of not doing same thing twice I looked into
using ORM part of Django. And guess what? I it doable, and basic
implementation is in devel branch of my repo.=20

There were certain caveats of course. Django is designed to work
for web applications, not as general purpose ORM framework. So when
using its ORM part without rest of Django, I have to take care of
DB exceptions and rollback of transactions myself. I soon realized
I am doing same thing in every db function I was writing so I ended
up writing a decorator in Python (finally had a reason! :-) ). It
looks something like this:

--- CODE

def dbquery(f):
    def decor(*args, **kwargs):
        reset_queries()=20
        try:
            return f(*args, **kwargs)
        except Exception, e:
            _rollback_on_exception()=20
            raise e
    return decor

@dbquery
def add_package(...)

--- CODE

This way we can be sure that failed transactions are rolled back.=20

Because I am using Django to generate SQL now, orignal database
schema that I commited to repository some time ago is now deprecated. We
can generate database (and initial data) by using django-admin syncdb
command now.

This approach seems fairly good so far since everything was set-up by
code that fits on one screen. I only wish using only small part of
Django was less painful.


And now comes the big part. Actually populating the database with some
meaningful data. I did some work in that part. Last week there were some
modifications to protocol I was using between Matchbox and Tinderboxes.
Most of changes were touching code dealing with log/environment
collection and fact that we have been compiling inside chroot
environment.

I also added support for packages that require certain use flags
enabled/disabled for their dependencies. Good example is dev-utils/git
(requires dev-utils/subversion[-dso]). For git this is however only
RDEPEND (runtime dependency) so compilation doesn't depend on it.

Since we already have db for storing results, and support is there let's
compile some packages! For next week I plan to finally add proper
testing to the mix. Instead of compiling fortune-mod over and over,
Matchbox will ask also for other packages to be compiled. This will bring
out some more problems that will need to be fixed I am sure. At least
that's the idea...

--=20
Stanislav Ochotnicky
Working for Gentoo Linux http://www.gentoo.org
Implementing Tree-wide collision checking and provided files database
http://soc.gentooexperimental.org/projects/show/collision-database
Blog: http://inputvalidation.blogspot.com/search/label/gsoc


jabber: sochotnicky@gmail.com
icq: 74274152
PGP: https://dl.getdropbox.com/u/165616/sochotnicky-key.asc

--C7zPtVaVf+AK4Oqc
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)

iEYEARECAAYFAkpWYskACgkQB9Uc/HGhZ3wAyACdGgZHQL8p+sOgkaMYtZUwxa9L
5x8AmwQlVNhDOD+GInSZsVYMOqL8tKoT
=o7jG
-----END PGP SIGNATURE-----

--C7zPtVaVf+AK4Oqc--