GNU bug report logs - #78568
[PATCH 0/5] Synchronize team definitions with Codeberg

Previous Next

Package: guix-patches;

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

Date: Fri, 23 May 2025 19:54:02 UTC

Severity: normal

Tags: patch

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

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: 78568 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [bug#78568] [PATCH 2/5] teams: Use suitable team identifiers for Codeberg.
Date: Fri, 23 May 2025 21:55:06 +0200
The “c++” team has to be called “cpp”.

* etc/teams.scm (team-id->forgejo-id): New procedure.
(team->codeowners-snippet): Use it.

Change-Id: I10619d8833b5c747504f26b7b0eedb9d61bfd812
---
 etc/teams.scm | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/etc/teams.scm b/etc/teams.scm
index a57d132787..9fa189a92c 100755
--- a/etc/teams.scm
+++ b/etc/teams.scm
@@ -1024,13 +1024,27 @@ (define (patch->teams patch-file)
        (find-team-by-scope (apply diff-revisions
                                   (git-patch->revisions patch-file)))))
 
+(define (team-id->forgejo-id id)
+  "Return a name (string) suitable as a Forgejo team name."
+  (define valid                                   ;"AlphaDashDot"
+    (char-set-union char-set:ascii (char-set #\-) (char-set #\.)))
+
+  (define (valid? chr)
+    (char-set-contains? valid chr))
+
+  (string-map (match-lambda
+                (#\+ #\p)                         ;special case for "c++"
+                ((? valid? chr) chr)
+                (_ #\-))
+              (symbol->string id)))
+
 (define (team->codeowners-snippet team)
   (string-join (map (lambda (scope)
                       (format #f "~50a @guix/~a"
                               (if (regexp*? scope)
                                   (regexp*-pattern scope)
                                   (regexp-quote scope))
-                              (team-id team)))
+                              (team-id->forgejo-id (team-id team))))
                     (team-scope team))
                "\n"
                'suffix))
-- 
2.49.0





This bug report was last modified 18 days ago.

Previous Next


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