unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#52532] [PATCH] ci: Restrict substitute search to guix jobset.
@ 2021-12-16  1:14 Andrew Whatson
  2021-12-19 15:30 ` bug#52532: " Mathieu Othacehe
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Whatson @ 2021-12-16  1:14 UTC (permalink / raw)
  To: 52532

[-- 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)))

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#52532: [PATCH] ci: Restrict substitute search to guix jobset.
  2021-12-16  1:14 [bug#52532] [PATCH] ci: Restrict substitute search to guix jobset Andrew Whatson
@ 2021-12-19 15:30 ` Mathieu Othacehe
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Othacehe @ 2021-12-19 15:30 UTC (permalink / raw)
  To: Andrew Whatson; +Cc: 52532-done


Hey Andrew,

> 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.

Oh I guess it picked the "guix" package from the staging specification
which has noting to do with the "guix" package from the "guix"
specification. Hard to follow, naming could probably be improved here
:).

The first one is the package from (gnu packages package-management)
while the second is the guix modular package from the (build-self)
module.

Anyway your patch should prevent this problem from happening. Pushed as
11334d15d590073c631c574436d2110aa1ea2142.

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-19 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16  1:14 [bug#52532] [PATCH] ci: Restrict substitute search to guix jobset Andrew Whatson
2021-12-19 15:30 ` bug#52532: " Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).