[v2,0/6] maintainer_utils.py: general cleanups

Message ID bmm.hlw1gcuuvc.gcc.gcc.rearnsha.222.2.0@forge-stage.sourceware.org
Headers
Series maintainer_utils.py: general cleanups |

Message

Richard Earnshaw via Sourceware Forge Sept. 1, 2026, 2:36 p.m. UTC
  This series is a general cleanup of the maintainer_utils code and associated helper scripts.  The main change is to move the MAINTAINERS.yml DCO entries for a user from the 'roles' section to a separate list for each user.  It also adds some additional validation of the data.

Other than moving the DCO entries, no other fixups were needed to the current MAINTAINERS.yml.


---
This is a forge pull request published on the gcc-patches mailing list mailing list
as requested by Richard Earnshaw via Sourceware Forge <forge-bot+rearnsha@forge-stage.sourceware.org>.
Forge discussion: https://forge.sourceware.org/gcc/gcc/pulls/222

Get it locally using:
```
git fetch forge-upstream "+refs/versioned_pull/222/*:refs/versioned_pull/222/*"
git switch -c "pr-222-v2" "refs/versioned_pull/222/2/head"
```
Or, download the patch at: https://forge.sourceware.org/gcc/gcc/pulls/222.diff
Created on: 2026-08-20 14:39:50+00:00
Latest update: 2026-09-01 14:36:28+00:00
Changes: 4 changed files, 281 additions, 121 deletions
Head revision: rearnsha/gcc ref mntutils-store commit e0c068b90f85ced75698301c0a19c264653e1416
Base revision: gcc/gcc ref trunk commit a2f39ed4bdbdb8b26b3bd3de6a8007903d03159d r17-3814-ga2f39ed4bdbdb8
Merge base: a2f39ed4bdbdb8b26b3bd3de6a8007903d03159d
Requested Reviewers: rdfm

Changed files:
- M: MAINTAINERS.yml
- M: contrib/add-write-after.py
- M: contrib/gen-MAINTAINERS.py
- M: contrib/maintainer_utils.py

Richard Earnshaw (6):
  maintainer_utils.py: Add a store method
  maintainer_utils: Fix errors in schema.
  maintainer_utils: Move DCO entries outside of roles.
  maintainer_utils: support inactive_DCO
  maintainer_utils: Ensure the list of user data is sorted.
  maintainer_utils: more array size verification.

 MAINTAINERS.yml             | 199 +++++++++++++++++++++++-------------
 contrib/add-write-after.py  |  32 +++---
 contrib/gen-MAINTAINERS.py  |  40 ++++++--
 contrib/maintainer_utils.py | 131 +++++++++++++++++++-----
 4 files changed, 281 insertions(+), 121 deletions(-)

Range-diff against v1:
1:  15116004e5de5 = 1:  a32bc75fa32cb maintainer_utils.py: Add a store method
2:  c18173a30cb4a = 2:  0555ec2bc05db maintainer_utils: Fix errors in schema.
3:  0f30e2ab0333e ! 3:  66c26b5261785 maintainer_utils: Move DCO entries outside of roles.
    @@ MAINTAINERS.yml: users:
      - sn: Dardis
        cn: Simon Dardis
        email:
    +@@ MAINTAINERS.yml: users:
    +   roles:
    +   - Reviewer: CTF, BTF, bpf port
    +   - WriteAfter
    +-  - DCO: david.faust@oss.qualcomm.com
    +   account: dfaust
    +   inactive_email:
    +   - david.faust@oracle.com
    ++  DCO:
    ++  - david.faust@oss.qualcomm.com
    + - sn: Feifer
    +   cn: Sam Feifer
    +   email:
     @@ MAINTAINERS.yml: users:
        - kaelfandrew@gmail.com
        roles:
    @@ MAINTAINERS.yml: users:
        - Maintainer: Rust
        - Maintainer: libgrust
        - WriteAfter
    +-  - DCO: pierre.emmanuel.patry@opensrcsec.com
     -  - DCO: pierre-emmanuel.patry@embecosm.com
    +   inactive_email:
    +   - pierre-emmanuel.patry@embecosm.com
        account: pep
     +  DCO:
    ++  - pierre.emmanuel.patry@opensrcsec.com
     +  - pierre-emmanuel.patry@embecosm.com
      - sn: Pavenis
        cn: Andris Pavenis
-:  ------------- > 4:  2d8c7ef893c61 maintainer_utils: support inactive_DCO
4:  dfe972ba7624b ! 5:  8bfe6f3c173d5 maintainer_utils: Ensure the list of user data is sorted.
    @@ contrib/maintainer_utils.py: def _check_schema(data):
          # An email addrss in a DCO entry must also be listed in either the
          # active emails list, or the inactive_emails list.
     @@ contrib/maintainer_utils.py: def _check_dco(user):
    -             _error(f"User: {user['cn']} DCO {dco} not listed in other emails")
    +             _error(f"User: {user['cn']} inactive_DCO {dco} also listed in DCO")
      
      
     +def sort_users(user_data):
5:  f80bc9e4fed54 ! 6:  e0c068b90f85c maintainer_utils: more array size verification.
    @@ Metadata
      ## Commit message ##
         maintainer_utils: more array size verification.
     
    -    Thare always needs to be one email address associated with a user and
    +    There always needs to be one email address associated with a user and
         the inactive_emails and aliases entries should be omitted if empty,
         so set the minimum size of all three to 1.
  

Comments

Claudio Bantaloukas via Sourceware Forge Sept. 2, 2026, 3:41 p.m. UTC | #1
Claudio Bantaloukas (rdfm) <rdfm@sourceware.org> approved the changes:
LGTM


--
https://forge.sourceware.org/gcc/gcc/pulls/222#issuecomment-7393
  
Richard Earnshaw via Sourceware Forge Sept. 2, 2026, 4:53 p.m. UTC | #2
Pushed

--
https://forge.sourceware.org/gcc/gcc/pulls/222#issuecomment-7406
  
Richard Earnshaw via Sourceware Forge Sept. 2, 2026, 4:54 p.m. UTC | #3
This is a summary of discussions relative to the merge request created by Richard Earnshaw (rearnsha) <rearnsha@arm.com> titled
maintainer_utils.py: general cleanups
since its creation.

Description: This series is a general cleanup of the maintainer_utils code and associated helper scripts.  The main change is to move the MAINTAINERS.yml DCO entries for a user from the 'roles' section to a separate list for each user.  It also adds some additional validation of the data.

Other than moving the DCO entries, no other fixups were needed to the current MAINTAINERS.yml.

Changes since v1: Add support for inactive_DCO

The full and up to date discussion can be found at https://forge.sourceware.org/gcc/gcc/pulls/222

The merge request has been closed without being merged directly on the forge repository.

On 2026-08-20 18:26:31+00:00, Claudio Bantaloukas (rdfm) <rdfm@sourceware.org> approved the changes:
Other than a typo in the commit message after "maintainer_utils: more array size verification" and a wishlist that can be dealt with in a later patch, code LGTM, but I'm not a global maintainer.

> +++ contrib/maintainer_utils.py
> @@ -299,0 +301,4 @@
> +    validate(data)
> +    if file:
> +        fd = open(file, "w", encoding="utf-8")
> +    print("# If you edit this file, please validate with:",
I would rather if this tried to open `pathlib.Path(__file__).parent.parent / "MAINTAINERS.yml"`, read the first comment lines and reproduced them in the output. It's ok if opening fails, don't print anything in that case.
This will avoid us having to keep two files in sync, allow us to write better commentary in MAINTAINERS.yml and work with the overwhelming majority of uses of store.

That being said, I'm happy with this change and the comment above is an improvement that can come in a later patch.
> +++ contrib/maintainer_utils.py
> @@ -299,0 +301,4 @@
> +    validate(data)
> +    if file:
> +        fd = open(file, "w", encoding="utf-8")
> +    print("# If you edit this file, please validate with:",
The script doesn't assume that MAINTAINERS.yml lives in a specific location.  I'd like to preserve that property.
> +++ contrib/maintainer_utils.py
> @@ -299,0 +301,4 @@
> +    validate(data)
> +    if file:
> +        fd = open(file, "w", encoding="utf-8")
> +    print("# If you edit this file, please validate with:",
I guess this is because you use separate files for testing? If this is so, it would be good to have them as part of a proper test suite. But this should not hold back this change as it's a step in the right direction IMO :)


On 2026-09-02 15:41:49+00:00, Claudio Bantaloukas (rdfm) <rdfm@sourceware.org> approved the changes:
LGTM



On 2026-09-02 16:53:54+00:00, Richard Earnshaw (rearnsha) wrote:

Pushed