From 580dca31146fce090fa71521ed9fadb786ea3e63 Mon Sep 17 00:00:00 2001 From: Sebb Date: Mon, 29 Jul 2024 16:46:41 +0100 Subject: [PATCH 1/3] GHA to check members.md --- .github/workflows/members_check.yml | 20 +++++++ members_check.py | 81 +++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 .github/workflows/members_check.yml create mode 100644 members_check.py diff --git a/.github/workflows/members_check.yml b/.github/workflows/members_check.yml new file mode 100644 index 0000000000..9d70593e2c --- /dev/null +++ b/.github/workflows/members_check.yml @@ -0,0 +1,20 @@ +name: Check members.md listings +on: + push: + paths: + - 'content/foundation/members.md' + - 'members_check.py' + - '.github/workflows/members_check.yml' + pull_request: + paths: + - 'content/foundation/members.md' + - 'members_check.py' + - '.github/workflows/members_check.yml' + workflow_dispatch: +jobs: + build-pelican: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + python3 members_check.py diff --git a/members_check.py b/members_check.py new file mode 100644 index 0000000000..3cafe3c807 --- /dev/null +++ b/members_check.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# + +# Check contents of members.md to ensure entries are valid ids and in the correct section +# Intended to be run by a GitHub Action, but can also be run from a local checkout + +import sys +import requests + +MEMBER_INFO = 'https://whimsy.apache.org/public/member-info.json' +MEMBERS_MD ='content/foundation/members.md' + +def main(): + member_info = requests.get(MEMBER_INFO).json() + members = member_info['members'] + ex_members = member_info['ex_members'] + errors = 0 + with open(MEMBERS_MD, 'r', encoding='utf-8') as md: + section = None + for line in md: + if line.startswith('| Id | Name | Projects |'): + section = 'members' + print("Checking members section") + continue + elif line.startswith('| Id | Name |'): + section = 'emeritus' + print("Checking emeritus section") + continue + elif len(line.strip()) == 0: + section = None + continue + elif line.startswith('|---'): + continue + if section is None: + continue + if not line.startswith('| '): + print("Unexpected format:") + print(line.strip()) + errors += 1 + parts = line.strip().split('|') + parts.pop(0) + availid = parts.pop(0).strip() + name = parts.pop(0).strip() + if section == 'members': + if not availid in members: + print(f"Not listed in members: {availid} {name} Status: {ex_members.get(availid, 'Unknown')}") + errors += 1 + elif section == 'emeritus': + if availid != '?' and not availid in ex_members: + if availid in members: + status = 'ASF Member' + else: + status = 'Unknown' + print(f"Not listed in ex_members: {availid} {name} Status: {status}") + errors += 1 + if errors > 0: + print(f"Detected {errors} error(s). ") + sys.exit(1) + else: + print("No errors detected") + +if __name__ == '__main__': + main() From 89484afff5070864af29e0ca5dcff9b6d6366a0e Mon Sep 17 00:00:00 2001 From: Sebb Date: Mon, 29 Jul 2024 16:49:11 +0100 Subject: [PATCH 2/3] Claude went emeritus --- content/foundation/members.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/foundation/members.md b/content/foundation/members.md index ef801e653e..8186d8a866 100644 --- a/content/foundation/members.md +++ b/content/foundation/members.md @@ -92,7 +92,6 @@ This table shows current and emeritus members who have manually added themselves | chrisg | Christian Geisert | [XML Graphics](http://xmlgraphics.apache.org/) , [FOP](http://xmlgraphics.apache.org/fop/)| | christ | Chris Thistlethwaite | Infrastructure , [Warble (incubating)](http://warble.apache.org/) | | chtompki | [Rob Tompkins](http://www.robtompkins.com) | [Commons](http://commons.apache.org) | -| claude | Claude N. Warren, Jr. | [Jena](http://jena.apache.org), [Commons Collections](https://commons.apache.org/proper/commons-collections/), [RAT](https://creadur.apache.org/rat/), [Incubator](https://incubator.apache.org), [Pekko (incubating)](https://pekko.apache.org/), [Cassandra](https://cassandra.apache.org), [Community over Code - EU (Formerly ApacheCon)](https://eu.communityovercode.org/) | | clr | Craig L Russell | [JDO](http://db.apache.org/jdo) ; [Incubator](http://incubator.apache.org/) ; [OpenJPA](http://openjpa.apache.org/)| | cmccabe | Colin P. McCabe | | cmpilato | C. Michael Pilato | @@ -529,6 +528,7 @@ Members may choose to move to [emeritus](/foundation/bylaws.html#4.2) status by | chirino | Hiram Chirino | | cholet | Eric Cholet | | chuck | Chuck Murcko | +| claude | Claude N. Warren, Jr. | [Jena](http://jena.apache.org), [Commons Collections](https://commons.apache.org/proper/commons-collections/), [RAT](https://creadur.apache.org/rat/), [Incubator](https://incubator.apache.org), [Pekko (incubating)](https://pekko.apache.org/), [Cassandra](https://cassandra.apache.org), [Community over Code - EU (Formerly ApacheCon)](https://eu.communityovercode.org/) | | cliff | Cliff Skolnick | [httpd](http://httpd.apache.org/)| | cliffs | Cliff Schmidt | | cmueller | Christian Müller | [Camel](http://camel.apache.org) | From cc3c2bf162e73c5571bf44eac15ee0fcd7190554 Mon Sep 17 00:00:00 2001 From: Sebb Date: Mon, 29 Jul 2024 16:53:52 +0100 Subject: [PATCH 3/3] Better name for job --- .github/workflows/members_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/members_check.yml b/.github/workflows/members_check.yml index 9d70593e2c..595ca1f750 100644 --- a/.github/workflows/members_check.yml +++ b/.github/workflows/members_check.yml @@ -12,7 +12,7 @@ on: - '.github/workflows/members_check.yml' workflow_dispatch: jobs: - build-pelican: + members-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4