From patchwork Sat May 10 15:17:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 42509 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 A0F9327BC4B; Sat, 10 May 2025 16:19:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 C23A927BC4A for ; Sat, 10 May 2025 16:19:24 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uDlys-0007jw-Hq; Sat, 10 May 2025 11:19:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uDlyi-0007hZ-K8 for guix-patches@gnu.org; Sat, 10 May 2025 11:19:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uDlyi-0000uf-At; Sat, 10 May 2025 11:19:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=O6vn12L+y2gYO75BDP63uEHNFOoOpyrtwnMyqfZdroo=; b=KWlms3roGQ+OfYwiyGH0yUwSVOgmGAvbEeLUJaYygTRover3MrXr+nnw7VZFfFWxIHJ/p+E+hLR+e1vt9ft3RuyCHIewHG0m/B25aaO1X83mQl6F40pc9ZzGvfc6kf/UdtpOAIKybgIYtoSh4IjbMBqtdZDVDACYjTxkH6UQ98cdF6t9aZZoNw+DesE0Eb0i1hEA2BgLFz2PabZRNJBct+OSUUtuFKhtzH0Djtj/YJZ2YteoUYQvZ0qJz745etlAB8yhUgnBwEUDmqoL9s+3W8tJYX/WX100n3SchEuLVIaf4FSIdL2i2DYKqXSzstE8jFgdOvoc20Cw5/QC6dy58g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uDlyg-0007aX-Ew; Sat, 10 May 2025 11:19:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78354] [PATCH] teams: Add =?utf-8?b?4oCcY29kZW93bmVyc+KAnQ==?= action. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: gabriel@erlikon.ch, ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 10 May 2025 15:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78354 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78354@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Gabriel Wicki , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Gabriel Wicki , Ludovic =?utf-8?q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by submit@debbugs.gnu.org id=B.174689028829027 (code B ref -1); Sat, 10 May 2025 15:19:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 May 2025 15:18:08 +0000 Received: from localhost ([127.0.0.1]:48156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uDlxn-0007Y7-VW for submit@debbugs.gnu.org; Sat, 10 May 2025 11:18:08 -0400 Received: from lists.gnu.org ([2001:470:142::17]:41974) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uDlxk-0007XM-JV for submit@debbugs.gnu.org; Sat, 10 May 2025 11:18:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uDlxf-00077k-7m for guix-patches@gnu.org; Sat, 10 May 2025 11:17:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uDlxe-0000fu-W8; Sat, 10 May 2025 11:17:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=O6vn12L+y2gYO75BDP63uEHNFOoOpyrtwnMyqfZdroo=; b=dndcG6b/J0Y4cI XtlRpEd1Jcp6yn6qmn11+9yfOQsSY69z+NVPLgn4IbiYskaa3TS6QaCMqNCJyEx81Vi9lWfaXbcvP zEaMTaQlsrR/YYOUYoerRKY+cv9+jEymcYmgOpYuVqBHLDnvkqJxNkGAkMEBkYHmCNQlCGv++gNFB U+0ArrlRlV5hUskxB+yuYK+PVfpohje4PwnYCLARKyy4yo/YqcH7blRgtb7H/ghmziwvZ39rQ4u5u 8kejis5542oBsf578gVjQV5NqESrmkiFrOn42ENWnYS+dVFcq6qpRaCXH9/d2JOmPfJjuo8S5fUVM eDR3MCkHuZrxcSrVKi4A==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 10 May 2025 17:17:38 +0200 Message-ID: <9b439e84c1b6298141f3b440b91946a012ba3adb.1746890038.git.ludo@gnu.org> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * etc/teams.scm (team->codeowners-snippet, export-codeowners): New procedures. (main): Add “codeowners” action. * doc/contributing.texi (Teams): Document it. Change-Id: I601443981af374d85160833f7096d8c973873fb1 --- doc/contributing.texi | 7 +++++++ etc/teams.scm | 31 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) Hello, This patch enhances ‘etc/teams.scm’ so it can generate a ‘CODEOWNERS’ file. Forgejo can read that file to direct reviews to the right people. The result here is a 357-line file, which looks like this: --8<---------------cut here---------------start------------->8--- gnu/packages/audio\.scm @guix/audio gnu/packages/commencement\.scm @guix/bootstrap gnu/packages/mes\.scm @guix/bootstrap gnu/build-system/cmake\.scm @guix/c++ gnu/build/cmake-build-system\.scm @guix/c++ gnu/packages/c\.scm @guix/c++ gnu/packages/cmake\.scm @guix/c++ gnu/packages/cpp\.scm @guix/c++ gnu/packages/ninja\.scm @guix/c++ gnu/packages/valgrind\.scm @guix/c++ --8<---------------cut here---------------end--------------->8--- Of course we’ll have to create those teams on Codeberg so it can be on any use. Ludo’. base-commit: 2e1ead7c8b449b58d571d8f16c1586b675c13ab4 diff --git a/doc/contributing.texi b/doc/contributing.texi index f62939dc44..e98407edfd 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -2733,6 +2733,13 @@ Teams [env]$ git send-email --to=@var{ISSUE_NUMBER}@@debbugs.gnu.org -2 @end example +To generate a @file{CODEOWNERS} file, which Forgejo uses to determine +which team or person should review changes to a given set of files, run: + +@example +./etc/teams.scm codeowners > CODEOWNERS +@end example + @node Making Decisions @section Making Decisions diff --git a/etc/teams.scm b/etc/teams.scm index 17b5d4d1fe..5d5e104a48 100755 --- a/etc/teams.scm +++ b/etc/teams.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2022 Simon Tournier ;;; Copyright © 2025 Jelle Licht ;;; Copyright © 2025 Cayetano Santos +;;; Copyright © 2025 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -1016,6 +1017,34 @@ (define (patch->teams patch-file) (find-team-by-scope (apply diff-revisions (git-patch->revisions patch-file))))) +(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-scope team)) + "\n" + 'suffix)) + +(define (export-codeowners port) + (let ((teams (sort-teams + (hash-map->list (lambda (_ value) value) %teams)))) + (display "\ +# This -*- conf -*- file was generated by './etc/teams.scm codeowners'. +# +# It describes the expected reviewers for a pull request based on the +# changed files. Unlike what the name of the file suggests they don't +# own the code (ownership is collective in this house!) but merely have +# a good understanding of that area of the codebase and therefore are +# usually suited as a reviewer.\n\n" + port) + (for-each (lambda (team) + (display (team->codeowners-snippet team) port) + (newline port)) + teams))) + (define (main . args) (match args @@ -1049,6 +1078,8 @@ (define (main . args) team-names)) (("show" . team-names) (list-teams team-names)) + (("codeowners") + (export-codeowners (current-output-port))) (anything (format (current-error-port) "Usage: etc/teams.scm []