GNU bug report logs - #76938
[PATCH Cuirass 00/13] Forges notification support.

Previous Next

Package: guix-patches;

Reported by: Romain GARBAGE <romain.garbage <at> inria.fr>

Date: Tue, 11 Mar 2025 10:34:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Romain GARBAGE <romain.garbage <at> inria.fr>
To: 76938 <at> debbugs.gnu.org
Cc: ludovic.courtes <at> inria.fr, Romain GARBAGE <romain.garbage <at> inria.fr>
Subject: [bug#76938] [PATCH Cuirass 13/13] base: Add support for forge notification in jobset-monitor.
Date: Tue, 11 Mar 2025 11:34:38 +0100
* src/cuirass/base.scm (jobset-monitor, spawn-jobset-monitor): Add support for forge notification.
(jobset-registry): Transmit the communication channel for event-log to jobset-monitors.
---
 src/cuirass/base.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index c3a0fb6..d62960e 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -25,6 +25,7 @@
   #:use-module (fibers channels)
   #:use-module (cuirass logging)
   #:use-module (cuirass database)
+  #:use-module (cuirass forges notification)
   #:autoload   (cuirass metrics) (db-remove-specification-metrics)
   #:use-module (cuirass remote)
   #:use-module (cuirass specification)
@@ -123,6 +124,10 @@
 ;;;    such as evaluation triggers that can come, for example, from the
 ;;;    /jobset/NAME/hook/evaluate HTTP endpoint.
 ;;;
+;;;  - Each jobset might also be associated with a "forge notifier", started by
+;;;    the "monitor": when applicable, it is responsible for communicating with
+;;;    external forges using the correspondent API.
+;;;
 ;;;  - The "jobset" registry is a directory that maps jobset names to their
 ;;;    monitor.
 ;;;
@@ -874,6 +879,14 @@ notification subscriptions."
                          update-service evaluator event-log)
   (define name (specification-name spec))
 
+  (define forge-notifier (and (assoc-ref (specification-properties spec)
+                                         'forge-type)
+                              (spawn-forge-notification-service spec)))
+
+  (when forge-notifier
+    (put-message event-log
+                 `(subscribe ,forge-notifier)))
+
   (lambda ()
     (log-info "starting monitor for spec '~a'" name)
     (let loop ((spec spec)
@@ -954,6 +967,9 @@ notification subscriptions."
                  (loop spec last-updates))
                 ('terminate
                  (log-info "terminating monitor of jobset '~a'" name)
+                 (when forge-notifier
+                   (put-message event-log
+                                `(unsubscribe ,forge-notifier)))
                  #t)
                 (message
                  (log-warning "jobset '~a' got bogus message: ~s"
@@ -976,6 +992,9 @@ notification subscriptions."
              (loop spec last-updates))
             ('terminate
              (log-info "terminating monitor of inactive jobset '~a'" name)
+             (when forge-notifier
+               (put-message event-log
+                            `(unsubscribe ,forge-notifier)))
              #t)
             (message
              (log-warning "inactive jobset '~a' got unexpected message: ~s"
-- 
2.48.1





This bug report was last modified 68 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.