From patchwork Mon Jun 17 22:18:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Hassick X-Patchwork-Id: 1948882 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=iol.unh.edu header.i=@iol.unh.edu header.a=rsa-sha256 header.s=unh-iol header.b=EmNu3b3/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W347f1KQtz20Wb for ; Tue, 18 Jun 2024 08:19:58 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=iol.unh.edu header.i=@iol.unh.edu header.a=rsa-sha256 header.s=unh-iol header.b=EmNu3b3/; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4W347b5dw2z3gCk for ; Tue, 18 Jun 2024 08:19:55 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=iol.unh.edu Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=iol.unh.edu header.i=@iol.unh.edu header.a=rsa-sha256 header.s=unh-iol header.b=EmNu3b3/; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=iol.unh.edu (client-ip=2607:f8b0:4864:20::92a; helo=mail-ua1-x92a.google.com; envelope-from=ahassick@iol.unh.edu; receiver=lists.ozlabs.org) Received: from mail-ua1-x92a.google.com (mail-ua1-x92a.google.com [IPv6:2607:f8b0:4864:20::92a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4W346z4DX1z3g9L for ; Tue, 18 Jun 2024 08:19:21 +1000 (AEST) Received: by mail-ua1-x92a.google.com with SMTP id a1e0cc1a2514c-80b8d45e6b7so1289363241.3 for ; Mon, 17 Jun 2024 15:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1718662756; x=1719267556; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lbBvq5OPhQXkSjwUs8cRzHYvqvVAD6vwCnyoRnqrzpc=; b=EmNu3b3/RqbHYBCQ5dpzyWGvEeBW0e2BN4bNEWFK6Na5ups68QxWDPAyjnRFv33tys 6VuxO2DvcwOkeH4NOnM0TelMcQL7e5DGMZq3SNeon+oRVL1wZrYtmjTy2/91UPQHSkZ3 nWX1AkVW7e2fkhdi8gmcMmmadrbtIpHjqkzwc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718662756; x=1719267556; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lbBvq5OPhQXkSjwUs8cRzHYvqvVAD6vwCnyoRnqrzpc=; b=faDlwLOhxKSBLHy0WWa04v0rPSPBOFtM3X7Zsclk/8P0cbwRZ79TC91QebTVuOFOuL pSMSGrjQcFuIXmq4kQ9kVLyC88n1wCnYyeMFSGo/BhOKuOO3iN1ny7XRFBtpipek6YRw 83i69H4J5bjaXOrKR9Ta3FyqwtC6LBNWir0G2DRKTzI8oEwnDrPcpkAxyeOXnepL5dRj 4AfaVzul8zC3TS9CpfGS99m/2cQFnjLgc+bZb+OT//MxersAWa8DX1PVPvsePDwiM1Yt rdwMSAD6P/0s8jnIVQshiv6HunvkTKlBQTX3/lGAlBsOEu2VQJJixTiBLHJNbYU+qfNa ydow== X-Gm-Message-State: AOJu0YwbV0zPukkThjHxaPWTnjTyi5d8V1YV2dQ22YRfnUXlJpK5bA4i HtizdrhAub+02151UYg5ycfeqvSVbOZhF8zzkuisgJOPyevh3fMtYVjRrI0vQI1JXfLcBGiSAA8 RWYzPn8oOYfMbi49i66tNvD//bSL36HNlevYRiaqen9WjTvOXHNUDIZkUVpVCAAu1413w+OntVC SDqrMfDrK3mY2X3p4BXxfI1WVuJM/ysSFE5zNPacCZIb0Ndg== X-Google-Smtp-Source: AGHT+IFdQc0QC/Muvl0sj8WfTAIqWIfh+6JHMHkmpwwcVTS0km3FlOW7wThs/XlGrbSFyv4Y+10oqQ== X-Received: by 2002:a05:6102:834:b0:48d:98a9:d1ab with SMTP id ada2fe7eead31-48dae2b47d7mr9139707137.1.1718662756277; Mon, 17 Jun 2024 15:19:16 -0700 (PDT) Received: from bubs.loudonlune.net ([71.254.3.64]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaee0e52sm469808185a.37.2024.06.17.15.19.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 15:19:16 -0700 (PDT) From: Adam Hassick To: patchwork@lists.ozlabs.org Subject: [PATCH v1 2/9] models: Add field for series dependencies Date: Mon, 17 Jun 2024 18:18:48 -0400 Message-ID: <20240617221900.156155-2-ahassick@iol.unh.edu> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240617221900.156155-1-ahassick@iol.unh.edu> References: <20240617221900.156155-1-ahassick@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 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" Add a ManyToMany field to represent a dependency relationship between patch series. Signed-off-by: Adam Hassick Reviewed-by: Stephen Finucane --- patchwork/models.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/patchwork/models.py b/patchwork/models.py index 9a619bc..6f6a32d 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -840,6 +840,16 @@ class Series(FilenameMixin, models.Model): Cover, related_name='series', null=True, on_delete=models.CASCADE ) + # dependencies + dependencies = models.ManyToManyField( + 'self', + symmetrical=False, + blank=True, + help_text='Optional dependencies on this patch.', + related_name='dependents', + related_query_name='dependent', + ) + # metadata name = models.CharField( max_length=255, @@ -880,6 +890,13 @@ class Series(FilenameMixin, models.Model): def received_all(self): return self.total <= self.received_total + def add_dependencies(self, dependencies): + # for dependency in dependencies: + # dependency.dependents.add(self) + # dependency.save() + self.dependencies.add(*dependencies) + self.save() + def add_cover_letter(self, cover): """Add a cover letter to the series.