From patchwork Fri Mar 7 11:00:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain GARBAGE X-Patchwork-Id: 39752 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CC4D227BBEA; Fri, 7 Mar 2025 11:01:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8ACCC27BBE2 for ; Fri, 7 Mar 2025 11:01:14 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqVRy-0002Gy-Ap; Fri, 07 Mar 2025 06:01:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tqVRv-00029L-9q for guix-patches@gnu.org; Fri, 07 Mar 2025 06:01:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqVRu-0007d8-Jn for guix-patches@gnu.org; Fri, 07 Mar 2025 06:01:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=FGP6840AW2WBy67WJgP2/yIWeLLEhXF8wPZ7CVLqIjY=; b=fVGGV21ZmnLfx7yrvgn+1YDTTngWaeKEchYptgsKISw2AHYUJ7CEcL8Rpl4C4NV4Xk//yDuMWPEzuab8MAY6HbboC1bCkH7Vcpjtq5MO+HI6zo4T9wLgMeiJ5N5kC2+LiBiQnHRfIeyFw17Bi57SP5D+oQYmAAdfTIywGYifW+SdPZbUoFXnYBKeorNGt5L5b/jOKY90OeTsJhqMmDTDEi9uoYR88864aA/mX6ke9zORrzE1T2FVqso5tB8VVf5SPQ7ShLOsd7Ct/rjTHtaivwT83IQNVHQ/pk5tPtNdgjLpQicbSQUvfxsYJ8WehGJGJcEuCQqiXlbZHopkV0R7CQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tqVRu-0000oT-ET for guix-patches@gnu.org; Fri, 07 Mar 2025 06:01:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76809] [PATCH Cuirass 1/3] tests: common: Improve specifications=?. References: <20250307105850.27870-1-romain.garbage@inria.fr> In-Reply-To: <20250307105850.27870-1-romain.garbage@inria.fr> Resent-From: Romain GARBAGE Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Mar 2025 11:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76809 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76809@debbugs.gnu.org Cc: ludovic.courtes@inria.fr, Romain GARBAGE Received: via spool by 76809-submit@debbugs.gnu.org id=B76809.17413452423067 (code B ref 76809); Fri, 07 Mar 2025 11:01:02 +0000 Received: (at 76809) by debbugs.gnu.org; 7 Mar 2025 11:00:42 +0000 Received: from localhost ([127.0.0.1]:47146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tqVRa-0000nK-2P for submit@debbugs.gnu.org; Fri, 07 Mar 2025 06:00:42 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:48252) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tqVRY-0000mz-Ho for 76809@debbugs.gnu.org; Fri, 07 Mar 2025 06:00:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=FGP6840AW2WBy67WJgP2/yIWeLLEhXF8wPZ7CVLqIjY=; b=uL0c0NbxpJRbVn0kki6KToGizmQO6W3XJamt3npIAoqPiMSQ5pgc58Ei hX60KtglD5okx6qfgNSmuSzgz4ZkK7p7QE5FKqWWony9WVtkChH3OI4NC xYfOkBvnSQLtAQoMfTSjEWhuoPC4QmNqaqTfkCNboX3mdiNcxZ8XXh/mL I=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=romain.garbage@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.14,229,1736809200"; d="scan'208";a="211751968" Received: from unknown (HELO guix-A102.bordeaux.inria.fr) ([193.50.110.221]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2025 12:00:34 +0100 From: Romain GARBAGE Date: Fri, 7 Mar 2025 12:00:23 +0100 Message-ID: <20250307110025.12928-1-romain.garbage@inria.fr> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * tests/common.scm (specifications=?): Add check for channel commit. --- tests/common.scm | 4 ++++ 1 file changed, 4 insertions(+) base-commit: 520b2fdbd96e953fc2d4b56e78e52a81fc11e2b7 diff --git a/tests/common.scm b/tests/common.scm index 479fef3..4974812 100644 --- a/tests/common.scm +++ b/tests/common.scm @@ -149,5 +149,9 @@ Return the socket on success and #f on failure." (specification-channels spec1)) (map channel-branch (specification-channels spec2))) + (equal? (map channel-commit + (specification-channels spec1)) + (map channel-commit + (specification-channels spec2))) (equal? (specification-properties spec1) (specification-properties spec2)))) From patchwork Fri Mar 7 11:00:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain GARBAGE X-Patchwork-Id: 39753 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4F17027BBE9; Fri, 7 Mar 2025 11:01:21 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 551C727BBE2 for ; Fri, 7 Mar 2025 11:01:19 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqVS0-0002P7-TS; Fri, 07 Mar 2025 06:01:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tqVRv-00029M-AP for guix-patches@gnu.org; Fri, 07 Mar 2025 06:01:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqVRv-0007dD-0C for guix-patches@gnu.org; Fri, 07 Mar 2025 06:01:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=CKbQGm/D8ioeDbz8teOXm8yywlwvIwfLUhuqTh9z7XY=; b=WsI5BUXRgMW6yH3kaVs2p/2o1qWObD18Qafi0HZs299ysSujhOT49t7z09E6JMKPR+aXUFFjF1rYCHStTid9BgunOo0jlLI9HlPII1u1tlP+c4J8qHZ4t362RUHdu65Fm62H0Llqz1zIyqr7Q9wLkKsIbC5KRBFWYaHgU+WwPsQEBfkw1vTnKBZehThep2y8dMOADzInEVfeWd/gdiPlwla6FDI3jeJ1cG5SehITEt5X02vS3NkHdHlvraGBaeeBQbva7N1YABh7QgKzwgJ6lK3cW2uLPwo3ccGmtgGN1ZxzCwy7nJnc5NTTee03lrDo+PrTav5tIwdy9/HkH/jHsQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tqVRu-0000oc-Sx for guix-patches@gnu.org; Fri, 07 Mar 2025 06:01:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76809] [PATCH Cuirass 2/3] forgejo: Support for Agit workflow. Resent-From: Romain GARBAGE Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Mar 2025 11:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76809 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76809@debbugs.gnu.org Cc: ludovic.courtes@inria.fr, Romain GARBAGE Received: via spool by 76809-submit@debbugs.gnu.org id=B76809.17413452453084 (code B ref 76809); Fri, 07 Mar 2025 11:01:02 +0000 Received: (at 76809) by debbugs.gnu.org; 7 Mar 2025 11:00:45 +0000 Received: from localhost ([127.0.0.1]:47149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tqVRc-0000nf-Gq for submit@debbugs.gnu.org; Fri, 07 Mar 2025 06:00:44 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:48252) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tqVRZ-0000mz-Fa for 76809@debbugs.gnu.org; Fri, 07 Mar 2025 06:00:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CKbQGm/D8ioeDbz8teOXm8yywlwvIwfLUhuqTh9z7XY=; b=icAahLgVFI+TmLPOvRD7+PRonrBMAj8ccDKNevGsIpFlGrk9WwIDJgsR gXFnxW2BZTaXMSBZc7u9DwtFrRELgcg3Ondb+fGZh9AmKxsB/F3lJNKMc UegljyuE697bEVXbI7RNdKo18h7z7q2/Hfcs0Gb/cc1WxWjISc5SKS5O4 k=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=romain.garbage@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.14,229,1736809200"; d="scan'208";a="211751973" Received: from unknown (HELO guix-A102.bordeaux.inria.fr) ([193.50.110.221]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2025 12:00:34 +0100 From: Romain GARBAGE Date: Fri, 7 Mar 2025 12:00:24 +0100 Message-ID: <20250307110025.12928-2-romain.garbage@inria.fr> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250307110025.12928-1-romain.garbage@inria.fr> References: <20250307110025.12928-1-romain.garbage@inria.fr> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This commit adds support for the Agit workflow (see https://forgejo.org/docs/latest/user/agit-support/). In this case the provided "ref" is not an existing branch and the channel can't be fetched. * src/cuirass/forges/forgejo.scm (forgejo-pull-request->specification): Build channel from commit instead of branch. * tests/forgejo.scm: Update test. --- src/cuirass/forges/forgejo.scm | 3 ++- tests/forgejo.scm | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cuirass/forges/forgejo.scm b/src/cuirass/forges/forgejo.scm index 73ab609..40d1279 100644 --- a/src/cuirass/forges/forgejo.scm +++ b/src/cuirass/forges/forgejo.scm @@ -94,6 +94,7 @@ (forgejo-repository-reference-repository (forgejo-pull-request-base pull-request)))) (source-branch (forgejo-repository-reference-ref source-repo-reference)) + (source-commit (forgejo-repository-reference-sha source-repo-reference)) (source-url (forgejo-repository-url (forgejo-repository-reference-repository source-repo-reference))) (id (forgejo-pull-request-number pull-request)) @@ -129,7 +130,7 @@ (cons* (channel (name project-name) (url source-url) - (branch source-branch)) + (commit source-commit)) %default-channels)) (priority priority) (period period) diff --git a/tests/forgejo.scm b/tests/forgejo.scm index 2718bb3..ba3675a 100644 --- a/tests/forgejo.scm +++ b/tests/forgejo.scm @@ -76,7 +76,7 @@ (cons* (channel (name 'project-name) (url "https://forgejo.instance.test/source-repo/fork-name.git") - (branch "test-branch")) + (commit "582af40e8a059fa05c7048a7ac4f2eccbbd0183b")) %default-channels)) (priority %default-jobset-options-priority) (period %default-jobset-options-period) From patchwork Fri Mar 7 11:00:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain GARBAGE X-Patchwork-Id: 39754 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5784427BBEA; Fri, 7 Mar 2025 11:01:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BD40327BBE2 for ; Fri, 7 Mar 2025 11:01:24 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqVS3-0002Ze-Ky; Fri, 07 Mar 2025 06:01:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tqVRv-0002AZ-To for guix-patches@gnu.org; Fri, 07 Mar 2025 06:01:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqVRv-0007dM-IY for guix-patches@gnu.org; Fri, 07 Mar 2025 06:01:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=4byisWVRXiihEfcSC6Ae9/T/l6/J2H/qYQw4hGdv/xs=; b=Uo8tYlE2smj1hrbbcKFmclRI+60wnzPImUw9yH5dgenBdGphNz8HwlZhqGcAH02Z0l4j/V0+4RJtqil7HESTRYKExO9GwXNN6VXHDkL4wcWZxe37oxVtkenlCIp/yWk/se1pbLDdU+rJdKKQi7npI4pY9ltZmYuRTrcXbzHxQdl6wzTqzJZ11u+T1avi3lgtoqaS93rMowJACzrSt0zy9dek6XypL1QYHjnr5EYitHbZh6K8atip75WSB+ftJw1kXDveGuxQkN2Q/oa89dFEmDyN9O703YA839cWTWCiTM5z8ujrUOkknKA9GxJg6/dJsPSXuOMx99okpnFn0y75pg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tqVRv-0000ok-AK for guix-patches@gnu.org; Fri, 07 Mar 2025 06:01:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76809] [PATCH Cuirass 3/3] http: Update Forgejo jobset when PR is updated. Resent-From: Romain GARBAGE Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Mar 2025 11:01:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76809 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76809@debbugs.gnu.org Cc: ludovic.courtes@inria.fr, Romain GARBAGE Received: via spool by 76809-submit@debbugs.gnu.org id=B76809.17413452453091 (code B ref 76809); Fri, 07 Mar 2025 11:01:03 +0000 Received: (at 76809) by debbugs.gnu.org; 7 Mar 2025 11:00:45 +0000 Received: from localhost ([127.0.0.1]:47151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tqVRc-0000ni-Tf for submit@debbugs.gnu.org; Fri, 07 Mar 2025 06:00:45 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:48252) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tqVRa-0000mz-El for 76809@debbugs.gnu.org; Fri, 07 Mar 2025 06:00:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4byisWVRXiihEfcSC6Ae9/T/l6/J2H/qYQw4hGdv/xs=; b=GKr2aXzKuHmhJt6IrcoSuERKKUKEDvqPJC+UinvjUKsEaWavy0nQx129 QT+EUn3MzWM3WL58Otu7azmQPbxPxdL0jEDerkPZVogngsYoSEs5c6meT IE89MLbJBZhgP/j23SN3z1MrRry3aQHONFNtDtWloLPokHq67bRihr0sK c=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=romain.garbage@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.14,229,1736809200"; d="scan'208";a="211751975" Received: from unknown (HELO guix-A102.bordeaux.inria.fr) ([193.50.110.221]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2025 12:00:34 +0100 From: Romain GARBAGE Date: Fri, 7 Mar 2025 12:00:25 +0100 Message-ID: <20250307110025.12928-3-romain.garbage@inria.fr> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250307110025.12928-1-romain.garbage@inria.fr> References: <20250307110025.12928-1-romain.garbage@inria.fr> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * src/cuirass/http.scm (url-handler): Update Forgejo jobset when PR is updated. * tests/http.scm (forgejo-pull-request-json-update): New variable. ("/admin/forgejo/event updates a spec"): New test. --- src/cuirass/http.scm | 14 ++++++++------ tests/http.scm | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 6 deletions(-) diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm index cfb72e4..a826ef1 100644 --- a/src/cuirass/http.scm +++ b/src/cuirass/http.scm @@ -840,12 +840,14 @@ return DEFAULT." ;; Pull request is updated. ('synchronized (if (db-get-specification spec-name) - (if (call-bridge `(trigger-jobset ,(specification-name spec)) - bridge) - (respond-json (scm->json-string `((jobset . ,spec-name)))) - (begin - (log-warning "evaluation hook disabled") - (respond-json-with-error 400 "Evaluation hook disabled."))) + (begin + (db-add-or-update-specification spec) + (if (call-bridge `(trigger-jobset ,spec-name) + bridge) + (respond-json (scm->json-string `((jobset . ,spec-name)))) + (begin + (log-warning "evaluation hook disabled for spec ~a" spec-name) + (respond-json-with-error 400 "Evaluation hook disabled.")))) (respond-json-with-error 404 "Jobset not found.")))))) (_ (respond-json-with-error 400 (format #f "Event type \"~a\" not supported." event-type)))) (respond-json-with-error 400 "This API only supports JSON.")))) diff --git a/tests/http.scm b/tests/http.scm index a57a4ab..ead4bf3 100644 --- a/tests/http.scm +++ b/tests/http.scm @@ -177,6 +177,36 @@ } }") +(define forgejo-pull-request-json-update + "{ + \"action\": \"synchronized\", + \"pull_request\": { + \"number\": 1, + \"state\": \"open\", + \"url\": \"https://forgejo.instance.test/base-repo/pulls/1\", + \"base\": { + \"label\": \"base-label\", + \"ref\": \"base-branch\", + \"sha\": \"666af40e8a059fa05c7048a7ac4f2eccbbd0183b\", + \"repo\": { + \"name\": \"project-name\", + \"clone_url\": \"https://forgejo.instance.test/base-repo/project-name.git\", + \"html_url\": \"https://forgejo.instance.test/base-repo/project-name\" + } + }, + \"head\": { + \"label\": \"test-label\", + \"ref\": \"test-branch\", + \"sha\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\", + \"repo\": { + \"name\": \"fork-name\", + \"clone_url\": \"https://forgejo.instance.test/source-repo/fork-name.git\", + \"html_url\": \"https://forgejo.instance.test/source-repo/fork-name\" + } + } + } + }") + (define forgejo-pull-request-json-close "{ \"action\": \"closed\", @@ -572,6 +602,19 @@ forgejo-pull-request-json-open '((x-forgejo-event . "pull_request"))))) + (test-assert "/admin/forgejo/event updates a spec" + (let* ((spec (forgejo-pull-request->specification + (forgejo-pull-request-event-pull-request + (json->forgejo-pull-request-event forgejo-pull-request-json-update)))) + (spec-name (specification-name forgejo-pull-request-specification))) + (specifications=? + (pk 'expected spec) + (begin + (http-post-json (test-cuirass-uri "/admin/forgejo/event") + forgejo-pull-request-json-update + '((x-forgejo-event . "pull_request"))) + (pk 'actual (db-get-specification spec-name)))))) + (test-assert "/admin/forgejo/event removes a spec from a closed pull request" (begin (http-post-json (test-cuirass-uri "/admin/forgejo/event")