From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id ACKUF60IW2dTvQAAqHPOHw:P1 (envelope-from ) for ; Thu, 12 Dec 2024 16:00:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id ACKUF60IW2dTvQAAqHPOHw (envelope-from ) for ; Thu, 12 Dec 2024 17:00:45 +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=nabiuPR3; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=eWZu37my; 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"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=inria.fr (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734019245; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=RE8lBaf/pTi8b5H510KVAwwBQqm/BYAxFMMjT/H7oIU=; b=ht+9QQAJ/3PZl1ieVivuj+aMRPgbNoFUFK1/36veUQct5JkB77YXFWG3lKF98hllDWz/pu dJrEz6nphitq6b4Bcv1xbF05XMLWPRAJLxX6vct5daMUh6upn2r622BPCoK3+XDzotBY2m ZidbU7L+Q2Qg6TYeA2GLekYnQEj4sDgmfuwT39SyOEe+Z/e/+77GactTAQ+9t++HZ/pd61 rS5z6aG5A2Q9L5o9S+1pBu/O1FhG42bkAASh1P3CGjaCPJYj4Nd8NYl2SIgg8x4XthankI ozQNQIDchVpjo+C1o8Xodn0Dj7ZswMYXADyFnGnvaFCzY5wyXRJjDV2yzZGA0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=nabiuPR3; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=eWZu37my; 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"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=inria.fr (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734019245; a=rsa-sha256; cv=none; b=ozftVIBoaKbBh0ksfYTJO3VZaBDZErQ9lwL08Aiq+w/6fuutcB1e66861oe9DSPvVvw9uu kxFegoKTq7yGMToAzkgJIMeFfkC2s5erabmTDNXsOGbFqTcL53SdkrtMqz1PwoEIdy0iZ7 QPd2HADDIwcphgO5NUlqj1sEjdXoSVescxZI4EGqpQXV0Y3Qkdc5rmNy4Mphef4T7bQmr+ e0fGG4tg/nm+A16qzoKAk8aFloVrEFwt0kNQT9r0olZCcB4xCVc3sRYQ296auBdzC06yHU Tt4Wv3/h3zO7WcFMixHNITpse//UxP5/Z/d/14FbTQk7uJlJERoAjZ/9HTqWxQ== 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 E91FD8C6C4 for ; Thu, 12 Dec 2024 17:00:44 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLlbq-0001zd-Jx; Thu, 12 Dec 2024 11:00:16 -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 1tLlbj-0001vy-PF for guix-patches@gnu.org; Thu, 12 Dec 2024 11:00:08 -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 1tLlbj-0000pr-AG for guix-patches@gnu.org; Thu, 12 Dec 2024 11:00:07 -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=RE8lBaf/pTi8b5H510KVAwwBQqm/BYAxFMMjT/H7oIU=; b=nabiuPR3GRDGDh/Ed/4vvCuJl+PzO9sAh+5E9/nIrUifTGYDqbdiCErDza8khH1vzNz2hPuUIKopiCkYyRxSYty4AsBnKYPwoFEu+gXklBBcCy6IqT+oklPjWlMrzc+Es4cZcXtfeigd0tDGc2E+3fMRwwMxuqpeCDip5vlNmOOIiIg6qTuQxAaC5LgpFMKztnNUcNOyF2wQA9hJoy8pWYFhsfr6gDP0adX2FEQ/U9PbUgeHqK5/bTD0ht/XJTW9jTE7H6orBK0XC0VqzKjITTdXRb6IIkzg3FwVpOMLekkvvSbPPp31KGJgpWZB4Vp973I7GG5/nD7BPW+iKkfWsQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLlbi-00010w-LJ for guix-patches@gnu.org; Thu, 12 Dec 2024 11:00:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74769] [PATCH Cuirass v2 3/7] forges: Add module for common forges utilities. Resent-From: Romain GARBAGE Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Dec 2024 16:00:06 +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.17340191593588 (code B ref 74769); Thu, 12 Dec 2024 16:00:06 +0000 Received: (at 74769) by debbugs.gnu.org; 12 Dec 2024 15:59:19 +0000 Received: from localhost ([127.0.0.1]:39982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLlau-0000vO-2l for submit@debbugs.gnu.org; Thu, 12 Dec 2024 10:59:19 -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 1tLlao-0000u3-L6 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=RE8lBaf/pTi8b5H510KVAwwBQqm/BYAxFMMjT/H7oIU=; b=eWZu37myBP+Ag44RN8GtY0e0gGE3Shsp8Yg5Z2Nbfnore9lEl5fNceY/ G1cPYUWF0VxLKIHI0cYXwV3MhpO+3GXzQcv3tux7ygwTxpTZtrVt2zAWJ Gn/30swDfeMnqRrCkOl9bZGxQ9Nr7R8xFnTR7HHG4Y4CJEDygsa9bORw5 g=; X-IronPort-AV: E=Sophos;i="6.12,229,1728943200"; d="scan'208";a="104178640" 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:51 +0100 Message-ID: <20241212155845.27344-3-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-Type: text/plain; charset=UTF-8 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 0.01 X-Spam-Score: 0.01 X-Migadu-Queue-Id: E91FD8C6C4 X-TUID: xPQ30lQ9wLD3 * Makefile.am: Update module list. * src/cuirass/forges.scm: New module. * src/cuirass/gitlab.scm: Moved to src/cuirass/forges/gitlab.scm. * src/cuirass/http.scm, tests/gitlab.scm, tests/http.scm: Update module header. --- Makefile.am | 3 +- src/cuirass/forges.scm | 73 +++++++++++++++++++++++++++++ src/cuirass/{ => forges}/gitlab.scm | 41 ++-------------- src/cuirass/http.scm | 2 +- tests/gitlab.scm | 2 +- tests/http.scm | 2 +- 6 files changed, 81 insertions(+), 42 deletions(-) create mode 100644 src/cuirass/forges.scm rename src/cuirass/{ => forges}/gitlab.scm (80%) diff --git a/Makefile.am b/Makefile.am index 1123eb1..2de3419 100644 --- a/Makefile.am +++ b/Makefile.am @@ -52,7 +52,8 @@ dist_pkgmodule_DATA = \ src/cuirass/store.scm \ src/cuirass/base.scm \ src/cuirass/database.scm \ - src/cuirass/gitlab.scm \ + src/cuirass/forges.scm \ + src/cuirass/forges/gitlab.scm \ src/cuirass/http.scm \ src/cuirass/logging.scm \ src/cuirass/mail.scm \ diff --git a/src/cuirass/forges.scm b/src/cuirass/forges.scm new file mode 100644 index 0000000..c05e266 --- /dev/null +++ b/src/cuirass/forges.scm @@ -0,0 +1,73 @@ +;;; forges.scm -- Common forges utilities +;;; Copyright © 2024 Romain Garbage +;;; +;;; This file is part of Cuirass. +;;; +;;; Cuirass is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation, either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; Cuirass is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with Cuirass. If not, see . + +(define-module (cuirass forges) + #:use-module (cuirass specification) + #:use-module (json) + #:use-module (ice-9 match) + #:export (make-jobset-options + jobset-options? + json->jobset-options + jobset-options-name-prefix + jobset-options-build + jobset-options-period + jobset-options-priority + jobset-options-systems)) + +;;; Commentary: +;;; +;;; This module implements objects and default values used in the various +;;; forges modules. +;;; +;;; Code: + +;; 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). +(define-json-mapping + make-jobset-options + jobset-options? + json->jobset-options + (name-prefix jobset-options-name-prefix "name_prefix" + (lambda (v) + (if (unspecified? v) + #f + (string->symbol v)))) + (build jobset-options-build "build" + (match-lambda + ((? unspecified?) + #f) + (((key . val) _ ...) + (cons (string->symbol key) (vector->list val))) + (str + (string->symbol str)))) + (period jobset-options-period "period" + (lambda (v) + (if (unspecified? v) + #f + v))) + (priority jobset-options-priority "priority" + (lambda (v) + (if (unspecified? v) + #f + v))) + (systems jobset-options-systems "systems" + (lambda (v) + (if (unspecified? v) + #f + (vector->list v))))) diff --git a/src/cuirass/gitlab.scm b/src/cuirass/forges/gitlab.scm similarity index 80% rename from src/cuirass/gitlab.scm rename to src/cuirass/forges/gitlab.scm index fcb93bb..56e875a 100644 --- a/src/cuirass/gitlab.scm +++ b/src/cuirass/forges/gitlab.scm @@ -1,5 +1,5 @@ ;;;; gitlab.scm -- Gitlab JSON mappings -;;; Copyright © 2024 Romain Garbage +;;; Copyright © 2024 Romain Garbage ;;; ;;; This file is part of Cuirass. ;;; @@ -16,7 +16,8 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with Cuirass. If not, see . -(define-module (cuirass gitlab) +(define-module (cuirass forges gitlab) + #:use-module (cuirass forges) #:use-module (cuirass specification) #:use-module (json) #:use-module (guix channels) @@ -60,42 +61,6 @@ (name gitlab-project-name "name" string->symbol)) -;; 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). -(define-json-mapping - make-jobset-options - jobset-options? - json->jobset-options - (name-prefix jobset-options-name-prefix "name_prefix" - (lambda (v) - (if (unspecified? v) - #f - (string->symbol v)))) - (build jobset-options-build "build" - (match-lambda - ((? unspecified?) - #f) - (((key . val) _ ...) - (cons (string->symbol key) (vector->list val))) - (str - (string->symbol str)))) - (period jobset-options-period "period" - (lambda (v) - (if (unspecified? v) - #f - v))) - (priority jobset-options-priority "priority" - (lambda (v) - (if (unspecified? v) - #f - v))) - (systems jobset-options-systems "systems" - (lambda (v) - (if (unspecified? v) - #f - (vector->list v))))) - (define-json-mapping make-gitlab-merge-request gitlab-merge-request? diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm index 881e803..8ea929f 100644 --- a/src/cuirass/http.scm +++ b/src/cuirass/http.scm @@ -27,7 +27,7 @@ #:use-module (cuirass config) #:use-module (cuirass database) #:use-module ((cuirass base) #:select (evaluation-log-file)) - #:use-module (cuirass gitlab) + #:use-module (cuirass forges gitlab) #:use-module (cuirass metrics) #:use-module (cuirass utils) #:use-module (cuirass logging) diff --git a/tests/gitlab.scm b/tests/gitlab.scm index 117a94d..df221bf 100644 --- a/tests/gitlab.scm +++ b/tests/gitlab.scm @@ -16,7 +16,7 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with Cuirass. If not, see . -(use-modules (cuirass gitlab) +(use-modules (cuirass forges gitlab) (cuirass specification) (cuirass utils) (tests common) diff --git a/tests/http.scm b/tests/http.scm index 7b8ab03..541f30d 100644 --- a/tests/http.scm +++ b/tests/http.scm @@ -22,7 +22,7 @@ (use-modules ((cuirass base) #:select (%bridge-socket-file-name)) (cuirass http) (cuirass database) - (cuirass gitlab) + (cuirass forges gitlab) (cuirass specification) (cuirass utils) (tests common) -- 2.46.0