From patchwork Wed Apr 21 12:21:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 28723 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 E38ED27BC79; Wed, 21 Apr 2021 13:22:17 +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 9F10227BC7A for ; Wed, 21 Apr 2021 13:22:13 +0100 (BST) Received: from localhost ([::1]:41536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZBrw-0002bE-NX for patchwork@mira.cbaines.net; Wed, 21 Apr 2021 08:22:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZBrn-0002XP-Qn for guix-patches@gnu.org; Wed, 21 Apr 2021 08:22:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45579) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZBrn-0007BN-JD 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-0005aR-Fr for guix-patches@gnu.org; Wed, 21 Apr 2021 08:22:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47929] [PATCH 4/5] scripts: weather: Add packages dashboard support. 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.161900769621411 (code B ref 47929); Wed, 21 Apr 2021 12:22:03 +0000 Received: (at 47929) by debbugs.gnu.org; 21 Apr 2021 12:21:36 +0000 Received: from localhost ([127.0.0.1]:57120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZBrL-0005ZB-He for submit@debbugs.gnu.org; Wed, 21 Apr 2021 08:21:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZBrH-0005YI-Ow for 47929@debbugs.gnu.org; Wed, 21 Apr 2021 08:21:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54766) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZBrC-0006nq-Jr for 47929@debbugs.gnu.org; Wed, 21 Apr 2021 08:21:26 -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 1lZBr9-0003pa-Vd; Wed, 21 Apr 2021 08:21:24 -0400 From: Mathieu Othacehe Date: Wed, 21 Apr 2021 14:21:07 +0200 Message-Id: <20210421122108.2344-4-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/scripts/weather.scm (display-dashboard-url): New procedure. (guix-weather): Call it. --- guix/scripts/weather.scm | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm index 5164fe0494..be0b2e3509 100644 --- a/guix/scripts/weather.scm +++ b/guix/scripts/weather.scm @@ -499,6 +499,17 @@ SERVER. Display information for packages with at least THRESHOLD dependents." #f systems)))) +(define (display-dashboard-url server packages) + "Display a link to the dashboard for PACKAGES on the given CI SERVER." + (let* ((id (dashboard-register server packages)) + (url (and id (dashboard-url server id)))) + (when url + (format #t "~%") + (format #t (G_ "The packages dashboard is available ~a.~%") + (if (supports-hyperlinks?) + (hyperlink url (G_ "here")) + (format #f "here: ~a" url)))))) + ;;; ;;; Entry point. @@ -554,15 +565,18 @@ SERVER. Display information for packages with at least THRESHOLD dependents." (report-server-coverage server items #:display-missing? (assoc-ref opts 'display-missing?))) - (match (assoc-ref opts 'coverage) - (#f #f) - (threshold - ;; PACKAGES may include non-package objects coming from a - ;; manifest. Filter them out. - (report-package-coverage server - (filter package? packages) - systems - #:threshold threshold))) + + ;; PACKAGES may include non-package objects coming from a + ;; manifest. Filter them out. + (let ((packages (filter package? packages))) + (match (assoc-ref opts 'coverage) + (#f #f) + (threshold + (report-package-coverage server + packages + systems + #:threshold threshold))) + (display-dashboard-url server packages)) (= 1 coverage)) urls))))))