From patchwork Wed Apr 21 12:21:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 28722 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 D4E6927BC79; Wed, 21 Apr 2021 13:22:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6C2E527BC7C for ; Wed, 21 Apr 2021 13:22:11 +0100 (BST) Received: from localhost ([::1]:41434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZBru-0002Yb-Gu for patchwork@mira.cbaines.net; Wed, 21 Apr 2021 08:22:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZBrn-0002XH-Du for guix-patches@gnu.org; Wed, 21 Apr 2021 08:22:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45578) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZBrn-0007Aw-6H for guix-patches@gnu.org; Wed, 21 Apr 2021 08:22:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lZBrn-0005aK-2l for guix-patches@gnu.org; Wed, 21 Apr 2021 08:22:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47929] [PATCH 3/5] ci: Add dashboard procedures. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 21 Apr 2021 12:22:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47929 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47929@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 47929-submit@debbugs.gnu.org id=B47929.161900769521404 (code B ref 47929); Wed, 21 Apr 2021 12:22:03 +0000 Received: (at 47929) by debbugs.gnu.org; 21 Apr 2021 12:21:35 +0000 Received: from localhost ([127.0.0.1]:57118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZBrL-0005Z9-6u for submit@debbugs.gnu.org; Wed, 21 Apr 2021 08:21:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZBrF-0005YF-4C for 47929@debbugs.gnu.org; Wed, 21 Apr 2021 08:21:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54765) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZBr9-0006mc-Vk for 47929@debbugs.gnu.org; Wed, 21 Apr 2021 08:21:23 -0400 Received: from [2a01:e0a:19b:d9a0:9576:8bbf:4795:82ee] (port=38154 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lZBr8-0003pa-Tj; Wed, 21 Apr 2021 08:21:23 -0400 From: Mathieu Othacehe Date: Wed, 21 Apr 2021 14:21:06 +0200 Message-Id: <20210421122108.2344-3-othacehe@gnu.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210421122108.2344-1-othacehe@gnu.org> References: <20210421122108.2344-1-othacehe@gnu.org> 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" X-getmail-retrieved-from-mailbox: Patches * guix/ci.scm (dashboard-url, dashboard-register): New procedures. --- guix/ci.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/guix/ci.scm b/guix/ci.scm index 780e90ef32..78ab739340 100644 --- a/guix/ci.scm +++ b/guix/ci.scm @@ -65,6 +65,8 @@ evaluations-for-commit manifest->jobs + dashboard-url + dashboard-register channel-with-substitutes-available)) ;;; Commentary: @@ -282,6 +284,26 @@ evaluation with the higher successful jobs count." (package->job-name (package-name package))) packages))) +(define (dashboard-url url id) + "Return the url of the dashboard with the given ID on the CI server at URL." + (format #f "~a/dashboard/~a" url id)) + +(define* (dashboard-register url packages + #:key + (specification "master")) + "Register a dashboard for the packages jobs of the given SPECIFICATION using +the CI server at URL. Returns the newly created dashboard id or false if it +could not be created." + (let* ((jobs (manifest->jobs + (packages->manifest packages))) + (names (string-join jobs ",")) + (id (json->scm + (http-fetch + (format #f "~a/api/dashboard/register?spec=~a&names=~a" + url specification names))))) + (and id + (assoc-ref id "id")))) + (define* (latest-checkouts-with-substitutes url jobs) "Return a list of latest checkouts, sorted by descending substitutes coverage of the given JOBS list on the CI server at URL. Only evaluations for