From patchwork Sun Oct 16 19:33:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 43450 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 CD81A27BBEA; Sun, 16 Oct 2022 20:36:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 BD7DF27BBE9 for ; Sun, 16 Oct 2022 20:36:24 +0100 (BST) Received: from localhost ([::1]:55828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ok9Qs-0004Qq-Iu for patchwork@mira.cbaines.net; Sun, 16 Oct 2022 15:36:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok9Od-0004Ot-7V for guix-patches@gnu.org; Sun, 16 Oct 2022 15:34:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47229) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ok9Oc-00037Q-Ps for guix-patches@gnu.org; Sun, 16 Oct 2022 15:34:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ok9Oc-000434-Ft for guix-patches@gnu.org; Sun, 16 Oct 2022 15:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58573] [PATCH] Add QA status badge to issue page. References: <20221016193112.14087-1-arunisaac@systemreboot.net> In-Reply-To: <20221016193112.14087-1-arunisaac@systemreboot.net> Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 16 Oct 2022 19:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58573 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ricardo Wurmus Cc: 58573@debbugs.gnu.org, Arun Isaac , Christopher Baines Received: via spool by 58573-submit@debbugs.gnu.org id=B58573.166594882015531 (code B ref 58573); Sun, 16 Oct 2022 19:34:02 +0000 Received: (at 58573) by debbugs.gnu.org; 16 Oct 2022 19:33:40 +0000 Received: from localhost ([127.0.0.1]:46307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok9OG-00042R-0R for submit@debbugs.gnu.org; Sun, 16 Oct 2022 15:33:40 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:51798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok9OD-00042H-NN for 58573@debbugs.gnu.org; Sun, 16 Oct 2022 15:33:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JcSGq/SYK8CTwpeCKkwbuiiGy0BXIheu1KmUfCnD6fs=; b=SR6TZelQiWSLLs0XkIeFCICcae MUZg4n10HweINk4tdk+yES0HPLXBrfK/k3uMO3d3VQ6WhTcNozvj5ql1MlX1u1rQqVN7l6m92j6tq mWfi5XlRtiZAGcpdn5eQ0Qhe8XTgwLhUf39ytXoAGH7iBykFZXX85jNJxtXlI7X42tZk3SLr0Whgx uxG7UGMf93lmjyPTAolMbUnCTIdZLbVnvjejojujp9n/kX1OybQBid9OluS5/KubzTvmB4K24QYuz ddrIvtR+wqy7dNzy+iXQYauoxGGKGkElyXnuG7S6on0cv8djhIk/QZQ+jz+/l8pwtgcRMQJwhJv2e hGAnHrAQ==; Received: from [192.168.2.1] (port=5870 helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ok9O3-000F0w-21; Mon, 17 Oct 2022 01:03:27 +0530 From: Arun Isaac Date: Mon, 17 Oct 2022 01:03:26 +0530 Message-Id: <20221016193326.14634-1-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.37.3 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 * mumi/config.scm.in (%config): Add qa-scheme and qa-host configuration parameters. * mumi/web/view/html.scm: Import (web uri). (build-uri-path): New function. (issue-page): Add QA status badge. --- mumi/config.scm.in | 4 +++- mumi/web/view/html.scm | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/mumi/config.scm.in b/mumi/config.scm.in index 66ad924..ed9330a 100644 --- a/mumi/config.scm.in +++ b/mumi/config.scm.in @@ -78,6 +78,8 @@ (submission-bug-email-address . "bug-guix@gnu.org") (lists . ("guix-patches@gnu.org" "bug-guix@gnu.org")) (packages . ("guix-patches" "guix")) - (debbugs-domain . "debbugs.gnu.org")))) + (debbugs-domain . "debbugs.gnu.org") + (qa-scheme . https) + (qa-host . "qa.guix.gnu.org")))) (lambda (key) (assoc-ref config key)))) diff --git a/mumi/web/view/html.scm b/mumi/web/view/html.scm index 171fbf9..7fd85bc 100644 --- a/mumi/web/view/html.scm +++ b/mumi/web/view/html.scm @@ -26,6 +26,7 @@ #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-19) + #:use-module (web uri) #:export (index help unknown @@ -355,6 +356,10 @@ failed to process associated messages.") ,message (p (a (@ (href "/")) "Try something else?")))))) +(define (build-uri-path . parts) + "Encode PARTS and join them together into an absolute URI path." + (string-append "/" (encode-and-join-uri-path parts))) + (define* (issue-page bug #:optional flash-message) "Render the conversation for the given BUG." (define id (bug-num bug)) @@ -403,6 +408,18 @@ failed to process associated messages.") ;; non-ASCII characters. (sender-name (first messages)) ".") + (div + (a (@ (href ,(uri->string + (build-uri (%config 'qa-scheme) + #:host (%config 'qa-host) + #:path (build-uri-path "issue" + (number->string id)))))) + (img (@ (src ,(uri->string + (build-uri (%config 'qa-scheme) + #:host (%config 'qa-host) + #:path (build-uri-path "issue" + (number->string id) + "status-badge-medium.svg")))))))) (details (@ (class "info")) (summary "Details")