Skip to content

admin/annual-review: updates for 2022 #59

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

Merged
merged 1 commit into from
Jul 31, 2022
Merged
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
42 changes: 26 additions & 16 deletions administrative/annual-ompi-github-committer-review.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@
all_members = dict()
repos = dict()
for repo in ompi_org.get_repos():
print("Found Org Repo: {repo}".format(repo=repo.name))
print(f"Found Org Repo: {repo.name}")

if repo.archived:
print("--> NOTE: This repo is archived")

# For each repo, get the teams on that repo
repo_teams = dict()
repo_teams = dict()
for team in repo.get_teams():
out = (" Found team on repo {org}/{repo}: {team} ({perm}) "
.format(org=ompi_org.name, repo=repo.name,
team=team.name, perm=team.permission))
out = f" Found team on repo {ompi_org.name}/{repo.name}: {team.name} ({team.permission}) "
# We only care about teams with push permissions
if team.permission == "pull":
print("{out} -- SKIPPED".format(out=out))
print(f"{out} -- SKIPPED")
continue

print(out)
Expand All @@ -56,8 +57,7 @@
team_members = dict()
member_teams = dict()
for member in team.get_members():
print(" Found member: {name}"
.format(name=member.login))
print(f" Found member: {member.login}")
team_members[member.id] = member

if member.id not in all_members:
Expand All @@ -81,7 +81,6 @@
'repo_teams' : repo_teams,
}


print("All the repos:")
pprint(repos)
pprint(all_members)
Expand All @@ -92,24 +91,31 @@
fieldnames = ['login', 'name', 'email', 'company']

# Add all the repo names
for _, rentry in repos.items():
#
# Skip archived repos -- they're read-only, and thereare are
# effectively just noise in the annual review process.
repo_names = list()
for rentry in repos.values():
repo = rentry['repo']
fieldnames.append("{org}/{repo}"
.format(org=ompi_org.login,
repo=repo.name))
if not repo.archived:
# Used to include the org name in here, but it was always
# "open-mpi", and it just made the colun need to be wider.
repo_names.append(repo.name)

fieldnames.extend(sorted(repo_names))

#--------------------------------------------------------------------

# Now write out the CSV
outfile = 'permissions.csv'
print("Writing: ".format(outfile=outfile))
print(f"Writing: {outfile}")
with open(outfile, 'w', newline='') as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=fieldnames,
quoting=csv.QUOTE_ALL)
writer.writeheader()
for mid, mentry in all_members.items():
member = mentry['member']
print(" Writing member: {member}".format(member=member.login))
print(f" Writing member: {member.login}")

# Initial entries about the user
row = {
Expand All @@ -123,12 +129,16 @@
for _, rentry in repos.items():
repo = rentry['repo']

# Per above, skip archived repos
if repo.archived:
continue

found = list()
for tid, tentry in rentry['repo_teams'].items():
if tid in mentry['member_teams']:
team = tentry['team']
found.append(team.name)

row[repo.full_name] = ', '.join(found)
row[repo.name] = ', '.join(found)

writer.writerow(row)