Skip to content

Commit 43d0fc6

Browse files
committed
admin/annual-review: updates for 2022
- Don't list archived github repos - Sort the repos that we do list - Don't include "open-mpi/" in the repo name; it just makes the spreadsheet columns wider Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 36934c6 commit 43d0fc6

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

administrative/annual-ompi-github-committer-review.py

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,18 @@
3737
all_members = dict()
3838
repos = dict()
3939
for repo in ompi_org.get_repos():
40-
print("Found Org Repo: {repo}".format(repo=repo.name))
40+
print(f"Found Org Repo: {repo.name}")
41+
42+
if repo.archived:
43+
print("--> NOTE: This repo is archived")
4144

4245
# For each repo, get the teams on that repo
43-
repo_teams = dict()
46+
repo_teams = dict()
4447
for team in repo.get_teams():
45-
out = (" Found team on repo {org}/{repo}: {team} ({perm}) "
46-
.format(org=ompi_org.name, repo=repo.name,
47-
team=team.name, perm=team.permission))
48+
out = f" Found team on repo {ompi_org.name}/{repo.name}: {team.name} ({team.permission}) "
4849
# We only care about teams with push permissions
4950
if team.permission == "pull":
50-
print("{out} -- SKIPPED".format(out=out))
51+
print(f"{out} -- SKIPPED")
5152
continue
5253

5354
print(out)
@@ -56,8 +57,7 @@
5657
team_members = dict()
5758
member_teams = dict()
5859
for member in team.get_members():
59-
print(" Found member: {name}"
60-
.format(name=member.login))
60+
print(f" Found member: {member.login}")
6161
team_members[member.id] = member
6262

6363
if member.id not in all_members:
@@ -81,7 +81,6 @@
8181
'repo_teams' : repo_teams,
8282
}
8383

84-
8584
print("All the repos:")
8685
pprint(repos)
8786
pprint(all_members)
@@ -92,24 +91,31 @@
9291
fieldnames = ['login', 'name', 'email', 'company']
9392

9493
# Add all the repo names
95-
for _, rentry in repos.items():
94+
#
95+
# Skip archived repos -- they're read-only, and thereare are
96+
# effectively just noise in the annual review process.
97+
repo_names = list()
98+
for rentry in repos.values():
9699
repo = rentry['repo']
97-
fieldnames.append("{org}/{repo}"
98-
.format(org=ompi_org.login,
99-
repo=repo.name))
100+
if not repo.archived:
101+
# Used to include the org name in here, but it was always
102+
# "open-mpi", and it just made the colun need to be wider.
103+
repo_names.append(repo.name)
104+
105+
fieldnames.extend(sorted(repo_names))
100106

101107
#--------------------------------------------------------------------
102108

103109
# Now write out the CSV
104110
outfile = 'permissions.csv'
105-
print("Writing: ".format(outfile=outfile))
111+
print(f"Writing: {outfile}")
106112
with open(outfile, 'w', newline='') as csvfile:
107113
writer = csv.DictWriter(csvfile, fieldnames=fieldnames,
108114
quoting=csv.QUOTE_ALL)
109115
writer.writeheader()
110116
for mid, mentry in all_members.items():
111117
member = mentry['member']
112-
print(" Writing member: {member}".format(member=member.login))
118+
print(f" Writing member: {member.login}")
113119

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

132+
# Per above, skip archived repos
133+
if repo.archived:
134+
continue
135+
126136
found = list()
127137
for tid, tentry in rentry['repo_teams'].items():
128138
if tid in mentry['member_teams']:
129139
team = tentry['team']
130140
found.append(team.name)
131141

132-
row[repo.full_name] = ', '.join(found)
142+
row[repo.name] = ', '.join(found)
133143

134144
writer.writerow(row)

0 commit comments

Comments
 (0)