From patchwork Thu Dec 16 01:14:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Whatson X-Patchwork-Id: 35255 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 9548327BBE9; Thu, 16 Dec 2021 01:15:43 +0000 (GMT) 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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,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 D4E6827BBEA for ; Thu, 16 Dec 2021 01:15:39 +0000 (GMT) Received: from localhost ([::1]:49186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxfMw-0005uo-VX for patchwork@mira.cbaines.net; Wed, 15 Dec 2021 20:15:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxfMN-0005uX-Ip for guix-patches@gnu.org; Wed, 15 Dec 2021 20:15:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxfMM-00053t-Lo for guix-patches@gnu.org; Wed, 15 Dec 2021 20:15:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxfMM-00061e-8v for guix-patches@gnu.org; Wed, 15 Dec 2021 20:15:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52532] [PATCH] ci: Restrict substitute search to guix jobset. Resent-From: Andrew Whatson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 01:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52532 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52532@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163961725923086 (code B ref -1); Thu, 16 Dec 2021 01:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Dec 2021 01:14:19 +0000 Received: from localhost ([127.0.0.1]:34064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxfLe-00060I-JV for submit@debbugs.gnu.org; Wed, 15 Dec 2021 20:14:18 -0500 Received: from lists.gnu.org ([209.51.188.17]:50840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxfLd-00060A-4y for submit@debbugs.gnu.org; Wed, 15 Dec 2021 20:14:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxfLd-0005sR-0b for guix-patches@gnu.org; Wed, 15 Dec 2021 20:14:17 -0500 Received: from [2607:f8b0:4864:20::b35] (port=42650 helo=mail-yb1-xb35.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxfLb-0004BK-79 for guix-patches@gnu.org; Wed, 15 Dec 2021 20:14:16 -0500 Received: by mail-yb1-xb35.google.com with SMTP id j2so60002233ybg.9 for ; Wed, 15 Dec 2021 17:14:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=SuLrehA/DVqr0fpEpfmAEfHzIEm5GKFpmKlwpmZ25OM=; b=nyi8gi0bEtIXO4KqA8KOCRRprjcDV3uYliaviWnLH2RkR+ZXN4U0HGRmN8didPuEHR pGYaxaN4GGJdQ/Vx6Jr/3mJLawBv0rOGadMIKCAff4WjzbMInoM0wUHJt75LyvgzX8U6 3hnF6aZFW2HA2Majv1so0JdcRUCwCtB938O2gjG9XDA3RYB6z0x8IImqFfTOszHPeBql ynkrp+96W4cMnC6n9CGtP7yS4zbQbqNgBpiFucwDwQYWxwr+Q0PvEE6PJofu5Yb9sIJo 1zwiVdCr8U1G9kdUDjSofYZMMRCbAxiBGNC4fwmH+ho/z82kRldzUlepQnyeNLedr7un PU/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=SuLrehA/DVqr0fpEpfmAEfHzIEm5GKFpmKlwpmZ25OM=; b=LwGSlHkpZNLu4ZXsJjj5QVje7zEzDse+RnTMp7DLLBMTkoWmmvO4cMCwcEVaqHMm2+ X8Ie1CcNjsBDNtSUTezrxsA/kfMGJN/kp6cwwO845CLDQQ6W+ym75zuh9WLcyfpDHmkt 5Nq5nKHIn4+jBO54Ly3Nq6jOP7jOaLkUhlk4obBvwELGbvIlFDtOWZXTsLqn9ZucfaDS z9+U+bvqbk1EEMjNPCUKinmACHkmegsmgtuqR1nMXWXAbcn1x0EmNCo3Mkw2LqiZBdCV yn1QnPdCe9lsoDCg+ffgb74BwaGj5AoBmXsfxv2xtS0poEyk0KZA2ubpEPHD7JNpDkYy 1VJQ== X-Gm-Message-State: AOAM530ByiVzUNt6+mfEinuPNz7MU5XYm2Aqxd1f0zR2jOXzoFF97kLL 4H0UUufi9opRPFDJaRdxf9++s+wbgltl5UsjHevesA9x X-Google-Smtp-Source: ABdhPJw9kKfdP16SXmZ584suuJ8rQgUASOVnbGCWWwt5lXeY+9wArXlh5aePglP4lhmo+/pbhfEmx+XhEQlft7uba4U= X-Received: by 2002:a5b:904:: with SMTP id a4mr9699265ybq.727.1639617253406; Wed, 15 Dec 2021 17:14:13 -0800 (PST) MIME-Version: 1.0 From: Andrew Whatson Date: Thu, 16 Dec 2021 01:14:02 +0000 Message-ID: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::b35 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::b35; envelope-from=whatson@gmail.com; helo=mail-yb1-xb35.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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 Hi! I've been using channel-with-substitutes-available recently, and noticed that at one point it's returned a commit from the staging branch instead of master. On further investigation, it seems the API needs a jobset parameter to restrict the results to only main guix builds. eg. http://ci.guix.gnu.org/api/latestbuilds?nr=5&job=guix.x86_64-linux vs. http://ci.guix.gnu.org/api/latestbuilds?nr=5&job=guix.x86_64-linux&jobset=guix Hopefully the above shows the problem, the first link includes builds with jobset "staging" which probably shouldn't be returned as a suitable guix revision for guix pull. This patch adds a jobset parameter to restrict the substitute search. Cheers, Andrew commit 2206caf8851068109078a48bd6651f4a9b0d7ef3 Author: Andrew Whatson Date: Thu Dec 16 11:00:35 2021 +1000 ci: Restrict substitute search to guix jobset. * guix/ci.scm (latest-builds): Add jobset keyword. (find-latest-commit-with-substitutes): Pass jobset "guix". diff --git a/guix/ci.scm b/guix/ci.scm index 01b493b3af..88b80f781d 100644 --- a/guix/ci.scm +++ b/guix/ci.scm @@ -208,7 +208,7 @@ (define* (queued-builds url #:optional (limit %query-limit)) (map json->build (vector->list queue)))) (define* (latest-builds url #:optional (limit %query-limit) - #:key evaluation system job status) + #:key evaluation system job jobset status) "Return the latest builds performed by the CI server at URL. If EVALUATION is an integer, restrict to builds of EVALUATION. If SYSTEM is true (a system string such as \"x86_64-linux\"), restrict to builds for SYSTEM." @@ -218,6 +218,7 @@ (define* (latest-builds url #:optional (limit %query-limit) `("evaluation" ,evaluation) `("system" ,system) `("job" ,job) + `("jobset" ,jobset) `("status" ,status)))) ;; Note: Hydra does not provide a "derivation" field for entries in ;; 'latestbuilds', but Cuirass does. @@ -286,6 +287,7 @@ (define (find-latest-commit-with-substitutes url) (let* ((job-name (string-append "guix." (%current-system))) (build (match (latest-builds url 1 #:job job-name + #:jobset "guix" #:status 0) ;success ((build) build) (_ #f)))