Skip to content
Merged
Show file tree
Hide file tree
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
149 changes: 149 additions & 0 deletions workload/test/SimSysCodeReviewers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
[
{
"login": "yaswant",
"id": 2984440,
"node_id": "MDQ6VXNlcjI5ODQ0NDA=",
"avatar_url": "https://avatars.githubusercontent.com/u/2984440?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/yaswant",
"html_url": "https://github.com/yaswant",
"followers_url": "https://api.github.com/users/yaswant/followers",
"following_url": "https://api.github.com/users/yaswant/following{/other_user}",
"gists_url": "https://api.github.com/users/yaswant/gists{/gist_id}",
"starred_url": "https://api.github.com/users/yaswant/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yaswant/subscriptions",
"organizations_url": "https://api.github.com/users/yaswant/orgs",
"repos_url": "https://api.github.com/users/yaswant/repos",
"events_url": "https://api.github.com/users/yaswant/events{/privacy}",
"received_events_url": "https://api.github.com/users/yaswant/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
},
{
"login": "christophermaynard",
"id": 13464564,
"node_id": "MDQ6VXNlcjEzNDY0NTY0",
"avatar_url": "https://avatars.githubusercontent.com/u/13464564?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/christophermaynard",
"html_url": "https://github.com/christophermaynard",
"followers_url": "https://api.github.com/users/christophermaynard/followers",
"following_url": "https://api.github.com/users/christophermaynard/following{/other_user}",
"gists_url": "https://api.github.com/users/christophermaynard/gists{/gist_id}",
"starred_url": "https://api.github.com/users/christophermaynard/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/christophermaynard/subscriptions",
"organizations_url": "https://api.github.com/users/christophermaynard/orgs",
"repos_url": "https://api.github.com/users/christophermaynard/repos",
"events_url": "https://api.github.com/users/christophermaynard/events{/privacy}",
"received_events_url": "https://api.github.com/users/christophermaynard/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
},
{
"login": "jennyhickson",
"id": 61183013,
"node_id": "MDQ6VXNlcjYxMTgzMDEz",
"avatar_url": "https://avatars.githubusercontent.com/u/61183013?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/jennyhickson",
"html_url": "https://github.com/jennyhickson",
"followers_url": "https://api.github.com/users/jennyhickson/followers",
"following_url": "https://api.github.com/users/jennyhickson/following{/other_user}",
"gists_url": "https://api.github.com/users/jennyhickson/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jennyhickson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jennyhickson/subscriptions",
"organizations_url": "https://api.github.com/users/jennyhickson/orgs",
"repos_url": "https://api.github.com/users/jennyhickson/repos",
"events_url": "https://api.github.com/users/jennyhickson/events{/privacy}",
"received_events_url": "https://api.github.com/users/jennyhickson/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
},
{
"login": "MGEX82",
"id": 103578442,
"node_id": "U_kgDOBix7Sg",
"avatar_url": "https://avatars.githubusercontent.com/u/103578442?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MGEX82",
"html_url": "https://github.com/MGEX82",
"followers_url": "https://api.github.com/users/MGEX82/followers",
"following_url": "https://api.github.com/users/MGEX82/following{/other_user}",
"gists_url": "https://api.github.com/users/MGEX82/gists{/gist_id}",
"starred_url": "https://api.github.com/users/MGEX82/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MGEX82/subscriptions",
"organizations_url": "https://api.github.com/users/MGEX82/orgs",
"repos_url": "https://api.github.com/users/MGEX82/repos",
"events_url": "https://api.github.com/users/MGEX82/events{/privacy}",
"received_events_url": "https://api.github.com/users/MGEX82/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
},
{
"login": "james-bruten-mo",
"id": 109733895,
"node_id": "U_kgDOBopoBw",
"avatar_url": "https://avatars.githubusercontent.com/u/109733895?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/james-bruten-mo",
"html_url": "https://github.com/james-bruten-mo",
"followers_url": "https://api.github.com/users/james-bruten-mo/followers",
"following_url": "https://api.github.com/users/james-bruten-mo/following{/other_user}",
"gists_url": "https://api.github.com/users/james-bruten-mo/gists{/gist_id}",
"starred_url": "https://api.github.com/users/james-bruten-mo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/james-bruten-mo/subscriptions",
"organizations_url": "https://api.github.com/users/james-bruten-mo/orgs",
"repos_url": "https://api.github.com/users/james-bruten-mo/repos",
"events_url": "https://api.github.com/users/james-bruten-mo/events{/privacy}",
"received_events_url": "https://api.github.com/users/james-bruten-mo/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
},
{
"login": "oakleybrunt",
"id": 130391369,
"node_id": "U_kgDOB8WdSQ",
"avatar_url": "https://avatars.githubusercontent.com/u/130391369?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/oakleybrunt",
"html_url": "https://github.com/oakleybrunt",
"followers_url": "https://api.github.com/users/oakleybrunt/followers",
"following_url": "https://api.github.com/users/oakleybrunt/following{/other_user}",
"gists_url": "https://api.github.com/users/oakleybrunt/gists{/gist_id}",
"starred_url": "https://api.github.com/users/oakleybrunt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/oakleybrunt/subscriptions",
"organizations_url": "https://api.github.com/users/oakleybrunt/orgs",
"repos_url": "https://api.github.com/users/oakleybrunt/repos",
"events_url": "https://api.github.com/users/oakleybrunt/events{/privacy}",
"received_events_url": "https://api.github.com/users/oakleybrunt/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
},
{
"login": "MetBenjaminWent",
"id": 136574563,
"node_id": "U_kgDOCCP2Yw",
"avatar_url": "https://avatars.githubusercontent.com/u/136574563?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/MetBenjaminWent",
"html_url": "https://github.com/MetBenjaminWent",
"followers_url": "https://api.github.com/users/MetBenjaminWent/followers",
"following_url": "https://api.github.com/users/MetBenjaminWent/following{/other_user}",
"gists_url": "https://api.github.com/users/MetBenjaminWent/gists{/gist_id}",
"starred_url": "https://api.github.com/users/MetBenjaminWent/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MetBenjaminWent/subscriptions",
"organizations_url": "https://api.github.com/users/MetBenjaminWent/orgs",
"repos_url": "https://api.github.com/users/MetBenjaminWent/repos",
"events_url": "https://api.github.com/users/MetBenjaminWent/events{/privacy}",
"received_events_url": "https://api.github.com/users/MetBenjaminWent/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
}
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 15 additions & 17 deletions workload/workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@
"growss",
]

# Ideally get this list another way but for now hardcode it.
other_reviewers = [
"MetBenjaminWent",
"jedbakerMO",
# Chris Maynard
# James CS
# Oakley Brunt
]
adminID = "MGEX82" # person in github teams as a central admin but not relevant here


class ProjectData:
Expand All @@ -52,7 +45,7 @@ def fetch_project_data(self, test: bool, capture: bool):
Retrieve data from GitHub API or a from a test file.
"""
if test:
file = Path(__file__).with_name("test.json")
file = Path(__file__).parent / "test" / "test.json"
with open(file) as f:
self.data = json.loads(f.read())

Expand All @@ -67,7 +60,7 @@ def fetch_project_data(self, test: bool, capture: bool):
self.data = json.loads(output.stdout)

if capture:
file = Path(__file__).with_name("test.json")
file = Path(__file__).parent / "test" / "test.json"
with open(file, "w") as f:
json.dump(self.data, f)
print(
Expand Down Expand Up @@ -134,7 +127,8 @@ def set_team_members(self, test: bool):
"""

if test:
file = Path(__file__).with_name(self.github_id + ".json")
team_file = self.github_id + ".json"
file = Path(__file__).parent / "test" / team_file
with open(file) as f:
full_data = json.loads(f.read())
else:
Expand All @@ -155,7 +149,9 @@ def set_team_members(self, test: bool):
full_data = json.loads(output.stdout)

for item in full_data:
self.members.append(item["login"])
person_id = item["login"]
if person_id != adminID:
self.members.append(person_id)

self.members = sorted(self.members, key=str.lower)

Expand Down Expand Up @@ -265,14 +261,11 @@ def main(total: bool, test: bool, capture_project: bool):
# Extract data from github about the reviews and team members.
data = ProjectData(test, capture_project)

other_team = Team(test=test)
other_team.members = other_reviewers

teams = {
"SSD": Team("ssdteam", test),
"CCD": Team("core-capability-development", test),
"TCD": Team("toolscollabdev", test),
"Other": other_team,
"Other": Team("SimSysCodeReviewers", test),
}

# Create tables for each combination of reviewers and reposotories
Expand All @@ -287,7 +280,12 @@ def main(total: bool, test: bool, capture_project: bool):
repo_list = lfric_repositories
reviewers = []
for team in teams.values():
reviewers += team.get_team_members()
members = team.get_team_members()
# Not using sets to deduplicate to preserve list order, keeping
# people in their teams.
for person in members:
if person not in reviewers:
reviewers.append(person)
tables["LFRic"] = build_table(data, reviewers, repo_list)

# Print tables
Expand Down