Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get committer names from Apache #390

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions scripts/check_committers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@
# See https://home.apache.org/phonebook-about.html
# for available resources
committers_url = "https://whimsy.apache.org/public/public_ldap_projects.json"
people_url = "https://whimsy.apache.org/public/public_ldap_people.json"

Roster = namedtuple('Roster', ('committers', 'pmcs'))
Committers = namedtuple('Committers', ('apache_id', 'name'))
PMCs = namedtuple('PMCs', ('apache_id', 'name'))

def get_asf_roster():
r = requests.get(committers_url)
Expand All @@ -48,6 +51,19 @@ def get_asf_roster():
committers = set(proj['members']) - pmcs
return Roster(committers, pmcs)

def get_names(ids):
r = requests.get(people_url)
j = r.json()
names = {}
for id in ids:
names[id] = j['people'][id]['name']
return names

def print_names_and_ids(names):
print("{:<15} {:<40}".format('Apache Id','NAME'))
for key, value in names.items():
print("{:<15} {:<40}".format(key,value))

def get_duplicates():
with open(committers_yaml, "r") as f:
d = yaml.safe_load(f)
Expand Down Expand Up @@ -91,10 +107,14 @@ def get_local_roster():
missing_pmcs = asf_roster.pmcs - local_roster.pmcs

if missing_pmcs:
print("Missing PMCs in local list:", sorted(missing_pmcs))
missing_pmcs_names = get_names(missing_pmcs)
print("Missing PMCs in local list")
print_names_and_ids(missing_pmcs_names)
missing_committers = asf_roster.committers - local_roster.committers
if missing_committers:
print("Missing committers in local list:", sorted(missing_committers))
missing_committers_names = get_names(missing_committers)
print("Missing committers in local list:")
print_names_and_ids(missing_committers_names)
unexpected_members = ((local_roster.pmcs | local_roster.committers) -
(asf_roster.pmcs | asf_roster.committers))
if unexpected_members:
Expand Down