From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id YN/sFL0IW2dM2wAA62LTzQ:P1 (envelope-from ) for ; Thu, 12 Dec 2024 16:01:01 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id YN/sFL0IW2dM2wAA62LTzQ (envelope-from ) for ; Thu, 12 Dec 2024 17:01:01 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b="SkMLO/1A"; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=HUrPmCmW; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=inria.fr (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734019260; a=rsa-sha256; cv=none; b=Ah1NNTpbbhN82YuTrmxcslCSIMi0biv5ljVa7xh6CMhJojcdUbOH990AUNVtCgDzaJ+j8l BMd6hZue0DbQrgKKA7U0KEqKUVLf73zs/h9kGi5S9OBxXvbTEoUlaC8O3i4v8Gqgrfr1ni gjvGvGjBmg8i7cLPkp4fF+zr63Ek8Zwo2db0HeqC3gUEAPG4Nhdr6kwRtf5P1u9dqnM0e6 QTV02KQn3qW+F/nFJR1iSPycGyMWmY0694dzNzwHBNhgccTfsjSxc6kxwBBjnj/UPoDiTM GIBY9EX+GKdtzb3RP0mJOb8i7vUAQVQGuARhhhHbs7bih1s21xsMV51/9/M20A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b="SkMLO/1A"; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=HUrPmCmW; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=inria.fr (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734019260; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=48mp6pe0MYg4VAS8We11BI6B0263e24mgz3A2ArOdfM=; b=e0pYEckbiyueAZp+xlSOJ7dXeISafpmbEpYFu1lVnsQAyX9Ix6TZpXaSRvyBGub/LH9Cx9 23lKKE2iUGlGrCQ/SAZwokhwlH3Q8QqsAk9jasL2tbf+GN2GhWJjpnMuz5zQM08zU03dUX o0dD5JphXFKHnYjACynysHyi7g6hb2/F56xW4Qi/2a6mICgFZCfMnqVGIXE60E7pgR+S67 GM3l9kiX0bW+NOKbEkgkw1Vse9gWPvfmeNNk1ONZ6pHQaRAohkYrW9FSgqDCS/GxfFFfnZ fy1FGM2+IispJs5t81VfH4g2xBU50DhNH5bKv9Rc2+d5NPxB48WkGKHKHWjIxw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 109CD83FC6 for ; Thu, 12 Dec 2024 17:01:00 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLlbx-00021o-D3; Thu, 12 Dec 2024 11:00:21 -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 1tLlbo-0001zO-HE for guix-patches@gnu.org; Thu, 12 Dec 2024 11:00:12 -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 1tLlbn-0000qH-FZ for guix-patches@gnu.org; Thu, 12 Dec 2024 11:00:12 -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=48mp6pe0MYg4VAS8We11BI6B0263e24mgz3A2ArOdfM=; b=SkMLO/1AEKKo5c640k5xo2aImfVzxeY6RzRqeH+FPQI/BQLi+gdNGjpwMskKdxUrKgOvRiv3lcO5IizPw/HxJ5syNjg/+6aFoI/lxYGdH3Qz+R7LFCBD5ijstCU1diAIV/BDY9KpZeBW2P0vBHl0bae2spzIfuySrX6WjQMhXKEzDdeazf0w411Qv1AwdQP/wUhM5pxKgrfBhjJPCIeuxnytLoGIn1yfaNE8x4pAFop0s747HG97NEF2HFPMoR+g2dMNSRPv4Te1YLq8nDP1chuHNOZ0awp1XNxsm4+P3t7NEHUI1MdTAg7xZ9zHBzVr5zKfiVSneYrUYh3RABSXrA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLlbk-00011m-5o for guix-patches@gnu.org; Thu, 12 Dec 2024 11:00:08 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74769] [PATCH Cuirass v2 4/7] forges: Define default values for specifications. Resent-From: Romain GARBAGE Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Dec 2024 16:00:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74769 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74769@debbugs.gnu.org Cc: ludovic.courtes@inria.fr, Romain GARBAGE Received: via spool by 74769-submit@debbugs.gnu.org id=B74769.17340191603597 (code B ref 74769); Thu, 12 Dec 2024 16:00:07 +0000 Received: (at 74769) by debbugs.gnu.org; 12 Dec 2024 15:59:20 +0000 Received: from localhost ([127.0.0.1]:39986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLlax-0000vp-L3 for submit@debbugs.gnu.org; Thu, 12 Dec 2024 10:59:20 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:36970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLlaq-0000u3-CG for 74769@debbugs.gnu.org; Thu, 12 Dec 2024 10:59:12 -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=48mp6pe0MYg4VAS8We11BI6B0263e24mgz3A2ArOdfM=; b=HUrPmCmWLVkrO+CRAh3bC2iPQdccrL/o3vswikREWfYJ11biD181kOC4 VP46+7DtGfufUWcgX3aZ3JDEa/hKQQIc5IHsAgcSy6sHhv7cqpw0CDoyn ZfI25A69ApKnIivv1gjxaX0bJeJW8sHLTdc4rpX+WXPErTDkD8ub/WyZx I=; X-IronPort-AV: E=Sophos;i="6.12,229,1728943200"; d="scan'208";a="104178642" Received: from unknown (HELO guix-A102.bordeaux.inria.fr) ([193.50.110.191]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2024 16:58:59 +0100 From: Romain GARBAGE Date: Thu, 12 Dec 2024 16:57:52 +0100 Message-ID: <20241212155845.27344-4-romain.garbage@inria.fr> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241212155845.27344-1-romain.garbage@inria.fr> References: <20241212155845.27344-1-romain.garbage@inria.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -0.69 X-Spam-Score: -0.69 X-Migadu-Queue-Id: 109CD83FC6 X-Migadu-Scanner: mx12.migadu.com X-TUID: q6iPerUa1EqK * src/cuirass/forges.scm (%default-jobset-options-period, %default-jobset-options-priority, %default-jobset-options-systems): New variables. * src/cuirass/forges/gitlab.scm (gitlab-merge-request->specification), tests/gitlab.scm: Change hardcoded values to variables defined in the forges module. --- src/cuirass/forges.scm | 16 +++++++++++++++- src/cuirass/forges/gitlab.scm | 6 +++--- tests/gitlab.scm | 21 +++++++++++---------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/cuirass/forges.scm b/src/cuirass/forges.scm index c05e266..56f4876 100644 --- a/src/cuirass/forges.scm +++ b/src/cuirass/forges.scm @@ -20,7 +20,11 @@ #:use-module (cuirass specification) #:use-module (json) #:use-module (ice-9 match) - #:export (make-jobset-options + #:export (%default-jobset-options-period + %default-jobset-options-priority + %default-jobset-options-systems + + make-jobset-options jobset-options? json->jobset-options jobset-options-name-prefix @@ -36,6 +40,16 @@ ;;; ;;; Code: +;; Default polling period for jobsets created using a forge module. +(define %default-jobset-options-period 3600) + +;; Default priority for jobsets created using a forge module. +(define %default-jobset-options-priority 5) + +;; Default target systems for jobsets created using a forge module. +(define %default-jobset-options-systems + (list "x86_64-linux")) + ;; This mapping defines a specific JSON dictionary used for tweaking Cuirass ;; options. It is not included in the JSON data sent by default by Gitlab and ;; must be used through the custom template mechanism (see documentation). diff --git a/src/cuirass/forges/gitlab.scm b/src/cuirass/forges/gitlab.scm index 56e875a..de2216f 100644 --- a/src/cuirass/forges/gitlab.scm +++ b/src/cuirass/forges/gitlab.scm @@ -123,15 +123,15 @@ (period (if (and cuirass-options (jobset-options-period cuirass-options)) (jobset-options-period cuirass-options) - 3600)) + %default-jobset-options-period)) (priority (if (and cuirass-options (jobset-options-priority cuirass-options)) (jobset-options-priority cuirass-options) - 1)) + %default-jobset-options-priority)) (systems (if (and cuirass-options (jobset-options-systems cuirass-options)) (jobset-options-systems cuirass-options) - (list "x86_64-linux")))) + %default-jobset-options-systems))) (specification (name spec-name) (build build) diff --git a/tests/gitlab.scm b/tests/gitlab.scm index df221bf..3409413 100644 --- a/tests/gitlab.scm +++ b/tests/gitlab.scm @@ -16,7 +16,8 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with Cuirass. If not, see . -(use-modules (cuirass forges gitlab) +(use-modules (cuirass forges) + (cuirass forges gitlab) (cuirass specification) (cuirass utils) (tests common) @@ -172,9 +173,9 @@ (url "https://gitlab.instance.test/source-repo/fork-name.git") (branch "test-branch")) %default-channels)) - (priority 1) - (period 3600) - (systems (list "x86_64-linux"))))) + (priority %default-jobset-options-priority) + (period %default-jobset-options-period) + (systems %default-jobset-options-systems)))) (test-assert "custom-json" (specifications=? @@ -211,9 +212,9 @@ (url "https://gitlab.instance.test/source-repo/fork-name.git") (branch "test-branch")) %default-channels)) - (priority 1) - (period 3600) - (systems (list "x86_64-linux"))))) + (priority %default-jobset-options-priority) + (period %default-jobset-options-period) + (systems %default-jobset-options-systems)))) (test-assert "custom-json-name-prefix" (specifications=? @@ -230,9 +231,9 @@ (url "https://gitlab.instance.test/source-repo/fork-name.git") (branch "test-branch")) %default-channels)) - (priority 1) - (period 3600) - (systems (list "x86_64-linux"))))) + (priority %default-jobset-options-priority) + (period %default-jobset-options-period) + (systems %default-jobset-options-systems)))) (test-assert "custom-json-build-all" (specifications=? -- 2.46.0