From patchwork Wed Mar 13 06:56:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrepapoti X-Patchwork-Id: 1911543 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" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=CMYOqtbJ; 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)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TvhD774wVz1yWn for ; Wed, 13 Mar 2024 17:57:59 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=CMYOqtbJ; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4TvhD763LNz3vZB for ; Wed, 13 Mar 2024 17:57:59 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=CMYOqtbJ; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::435; helo=mail-pf1-x435.google.com; envelope-from=andrepapoti@gmail.com; receiver=lists.ozlabs.org) Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) (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 4TvhCm6Glfz3vYG for ; Wed, 13 Mar 2024 17:57:40 +1100 (AEDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6e5dddd3b95so423190b3a.1 for ; Tue, 12 Mar 2024 23:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710313057; x=1710917857; 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=p4zgkhFjxCpfYMwSVigSLMyVTdfxujxRG2FyU6JOeek=; b=CMYOqtbJ9o35T5XJ8fSeN1G8co+j3qUxlDS8PkCUEVcW7z4hrr4mu0qUxf54tGPkf7 krq1lYz1iFpiof57IMe58VnLg0GrGW4YCgpDj04/gPY1x86AY2KpaKXtH8vGhoh+wjYa kPGnQXBoxDwuLEQLIOxubpg2In+pIRVlXDbDfpGEiIcUx307/NsZNoUKhd02hIXlZD8y OhbhcQ3g7jf8cNAzf6ZZuz/bVqwArMu8o8pu6vuy+xvK93jt9V5DZ+aK9CXStPoH6nPd n3yTcw8/VRTFLzs9kXTyrSQhXfQZNjx4aSN+6LvitVF043resUK6Y6rwUglSs+AH6jCL 7GPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710313057; x=1710917857; 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=p4zgkhFjxCpfYMwSVigSLMyVTdfxujxRG2FyU6JOeek=; b=B8EcS0uVc+La5cupdw3ikEKgvI8ZfwjptDEC9V2fmTag7ijHkBUUeY0BPy1dExtvGo ruwD7Sy7nha2wOtbiGVXz4x6DktMygI+9pshyUjQNI92oExTXtaHZZ10pru+U89DZow0 Mm2/ePc0AXXKLDmksuCJdB9WBvJLRE3L9hLzy5L9s+u+wJPMGq4zm62G6BozZShCJGE+ 1GUFAT3ZWCT24cemL41lwuo4JYMtOmuaTyWeRwVAWfE8NlRyuMej0Vrve1Fjco4RlgBD XzFTMcn4ZBO0S4A4nXbgC4JD9BxlopU0n7xwfvakMCiUxxIy4Ryuf2ImfKBfAnLkMqWG hY8g== X-Gm-Message-State: AOJu0YypxwrF1QExRZIFluhJFihjfIlGCzp3lenCOzV0H1vbalDI7159 jqUPvt5EetSWweNpk4XQh3Tq5DtcUijwpmk1+U+V9KeKiY2uBPey1z/QEmraYs0= X-Google-Smtp-Source: AGHT+IGIrdSATkutGMr1ioFFh11XO9SYSpmHWwpnXmLSJYNdThzK/rus7ZYsFHXhuKxEn5bPHv3c7g== X-Received: by 2002:a05:6a20:a10c:b0:1a3:16e1:9150 with SMTP id q12-20020a056a20a10c00b001a316e19150mr2713322pzk.15.1710313057419; Tue, 12 Mar 2024 23:57:37 -0700 (PDT) Received: from localhost.localdomain ([2804:1b3:a4c0:b1de:3ec4:883:9cca:f0a7]) by smtp.gmail.com with ESMTPSA id le21-20020a056a004fd500b006e691787eaesm4843998pfb.34.2024.03.12.23.57.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 23:57:37 -0700 (PDT) From: andrepapoti To: patchwork@lists.ozlabs.org Subject: [PATCH 4/9] api: Add Note to Patch Serializer Date: Wed, 13 Mar 2024 03:56:36 -0300 Message-ID: <20240313065642.385843-4-andrepapoti@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313065642.385843-1-andrepapoti@gmail.com> References: <20240313065642.385843-1-andrepapoti@gmail.com> 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" Patch serializer returns a fields containing it's notes. Some notes may be filtered out depending on the request's user and on the note maintainer_only attribute Signed-off-by: andrepapoti --- patchwork/api/patch.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/patchwork/api/patch.py b/patchwork/api/patch.py index 443c382..8fd3456 100644 --- a/patchwork/api/patch.py +++ b/patchwork/api/patch.py @@ -85,6 +85,7 @@ class PatchListSerializer(BaseHyperlinkedModelSerializer): mbox = SerializerMethodField() series = SeriesSerializer(read_only=True) comments = SerializerMethodField() + notes = SerializerMethodField() check = SerializerMethodField() checks = SerializerMethodField() tags = SerializerMethodField() @@ -108,6 +109,11 @@ class PatchListSerializer(BaseHyperlinkedModelSerializer): reverse('api-patch-comment-list', kwargs={'patch_id': patch.id}) ) + def get_notes(self, patch): + return self.context.get('request').build_absolute_uri( + reverse('api-patch-note-list', kwargs={'patch_id': patch.id}) + ) + def get_check(self, instance): return instance.combined_check_state @@ -173,6 +179,7 @@ class PatchListSerializer(BaseHyperlinkedModelSerializer): 'mbox', 'series', 'comments', + 'notes', 'check', 'checks', 'tags', @@ -191,6 +198,7 @@ class PatchListSerializer(BaseHyperlinkedModelSerializer): 'mbox', 'series', 'comments', + 'notes', 'check', 'checks', 'tags',