all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrew Whatson <whatson@gmail.com>
To: 52532@debbugs.gnu.org
Subject: [bug#52532] [PATCH] ci: Restrict substitute search to guix jobset.
Date: Thu, 16 Dec 2021 01:14:02 +0000	[thread overview]
Message-ID: <CAPE069f4Lxz_hEh=8_UeiB4i_HBq6n7MQ6TtU-oDAVHCF3WyFA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 696 bytes --]

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

[-- Attachment #2: guix-restrict-substitute-jobset.patch --]
[-- Type: text/x-patch, Size: 1761 bytes --]

commit 2206caf8851068109078a48bd6651f4a9b0d7ef3
Author: Andrew Whatson <whatson@gmail.com>
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)))

             reply	other threads:[~2021-12-16  1:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16  1:14 Andrew Whatson [this message]
2021-12-19 15:30 ` bug#52532: [PATCH] ci: Restrict substitute search to guix jobset Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPE069f4Lxz_hEh=8_UeiB4i_HBq6n7MQ6TtU-oDAVHCF3WyFA@mail.gmail.com' \
    --to=whatson@gmail.com \
    --cc=52532@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.