From patchwork Mon Mar 21 21:26:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guilherme Salgado X-Patchwork-Id: 87830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 6CDB41007D5 for ; Tue, 22 Mar 2011 08:26:55 +1100 (EST) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by ozlabs.org (Postfix) with ESMTP id 25F8CB6F44 for ; Tue, 22 Mar 2011 08:26:52 +1100 (EST) Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Q1mcj-0004Ui-Vf for ; Mon, 21 Mar 2011 21:26:49 +0000 Received: from [187.126.146.36] (helo=feioso) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Q1mcj-0004a7-M4 for patchwork@lists.ozlabs.org; Mon, 21 Mar 2011 21:26:49 +0000 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by feioso (Postfix) with ESMTP id A4F04418B4 for ; Mon, 21 Mar 2011 18:26:46 -0300 (BRT) Subject: Fully automating patch state updates To: patchwork@lists.ozlabs.org From: Guilherme Salgado Date: Mon, 21 Mar 2011 18:26:46 -0300 Message-ID: <20110321211341.11328.95472.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org I've seen the tools/patchwork-update-commits script and I'm planning to work on making a fully automated version of it, which fetches the master branch, scans the commits on it and updates the state of patches. I think this would be a nice addition to Patchwork. For that to work, though, the first thing we need is to know where's the master branch of a project. The patch below makes that possible by adding a free form char field to store the URL to the project's master branch. It's not a URLField because that only allows http[s] URLs, which is not what we want. I couldn't find anything about how Patchwork deals with DB schema migrations, but I wrote a migration script together with the other ones, which, AFAICT have to be applied manually? Is there anything I've missed or would this be everything that's needed to add a new field to a model class? Cheers, --- apps/patchwork/models.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py index 3d3490d..0f29157 100644 --- a/apps/patchwork/models.py +++ b/apps/patchwork/models.py @@ -64,6 +64,7 @@ class Project(models.Model): name = models.CharField(max_length=255, unique=True) listid = models.CharField(max_length=255, unique=True) listemail = models.CharField(max_length=200) + master_branch = models.CharField(max_length=300, blank=True, null=True) def __unicode__(self): return self.name diff --git a/lib/sql/migration/008-project-master-branch.sql b/lib/sql/migration/008-project-master-branch.sql new file mode 100644 index 0000000..73ae974 --- /dev/null +++ b/lib/sql/migration/008-project-master-branch.sql @@ -0,0 +1,3 @@ +BEGIN; +ALTER TABLE patchwork_project ADD column master_branch varchar(300); +COMMIT;