From 9868ae30a5a1ac846ad21d9201fdb9339fc704a3 Mon Sep 17 00:00:00 2001 From: Ikechukwu Uchendu Date: Fri, 3 Nov 2023 01:01:30 +0000 Subject: [PATCH] Fixed broken link to book in contributors. Fixes #27. --- .all-contributorsrc | 267 +++++++----------- .github/workflows/auto-add-contributors.yml | 2 +- .../contributors/update_contributors.py | 94 +++--- README.md | 48 ++-- contributors.qmd | 48 ++-- 5 files changed, 210 insertions(+), 249 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 56a9a1b9..fd4c1864 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7,226 +7,177 @@ ], "contributors": [ { - "login": "mmaz", - "name": "Mark Mazumder", - "avatar_url": "https://avatars.githubusercontent.com/mmaz", - "profile": "https://github.com/mmaz", - "contributions": [ - "doc" - ] - }, - { - "login": "profvjreddi", - "name": "Vijay Janapa Reddi", - "avatar_url": "https://avatars.githubusercontent.com/profvjreddi", - "profile": "https://github.com/profvjreddi", - "contributions": [ - "doc" - ] + "login": "Mjrovai", + "name": "Marcelo Rovai", + "avatar_url": "https://avatars.githubusercontent.com/Mjrovai", + "profile": "https://github.com/Mjrovai", + "contributions": [] }, { - "login": "happyappledog", - "name": "happyappledog", - "avatar_url": "https://avatars.githubusercontent.com/happyappledog", - "profile": "https://github.com/happyappledog", - "contributions": [ - "doc" - ] + "login": "aptl26", + "name": "aptl26", + "avatar_url": "https://avatars.githubusercontent.com/aptl26", + "profile": "https://github.com/aptl26", + "contributions": [] }, { - "login": "jessicaquaye", - "name": "Jessica Quaye", - "avatar_url": "https://avatars.githubusercontent.com/jessicaquaye", - "profile": "https://github.com/jessicaquaye", - "contributions": [ - "doc" - ] + "login": "AditiR-42", + "name": "AditiR_42", + "avatar_url": "https://avatars.githubusercontent.com/AditiR-42", + "profile": "https://github.com/AditiR-42", + "contributions": [] }, { - "login": "Mjrovai", - "name": "Marcelo Rovai", - "avatar_url": "https://avatars.githubusercontent.com/Mjrovai", - "profile": "https://github.com/Mjrovai", - "contributions": [ - "doc" - ] + "login": "ShvetankPrakash", + "name": "Shvetank Prakash", + "avatar_url": "https://avatars.githubusercontent.com/ShvetankPrakash", + "profile": "https://github.com/ShvetankPrakash", + "contributions": [] }, { - "login": "DivyaAmirtharaj", - "name": "Divya", - "avatar_url": "https://avatars.githubusercontent.com/DivyaAmirtharaj", - "profile": "https://github.com/DivyaAmirtharaj", - "contributions": [ - "doc" - ] + "login": "alxrod", + "name": "alxrod", + "avatar_url": "https://avatars.githubusercontent.com/alxrod", + "profile": "https://github.com/alxrod", + "contributions": [] }, { - "login": "Naeemkh", - "name": "naeemkh", - "avatar_url": "https://avatars.githubusercontent.com/Naeemkh", - "profile": "https://github.com/Naeemkh", - "contributions": [ - "doc" - ] + "login": "ishapira1", + "name": "ishapira", + "avatar_url": "https://avatars.githubusercontent.com/ishapira1", + "profile": "https://github.com/ishapira1", + "contributions": [] }, { - "login": "sjohri20", - "name": "sjohri20", - "avatar_url": "https://avatars.githubusercontent.com/sjohri20", - "profile": "https://github.com/sjohri20", - "contributions": [ - "doc" - ] + "login": "mmaz", + "name": "Mark Mazumder", + "avatar_url": "https://avatars.githubusercontent.com/mmaz", + "profile": "https://github.com/mmaz", + "contributions": [] }, { "login": "jaysonzlin", "name": "Jayson Lin", "avatar_url": "https://avatars.githubusercontent.com/jaysonzlin", "profile": "https://github.com/jaysonzlin", - "contributions": [ - "doc" - ] + "contributions": [] + }, + { + "login": "colbybanbury", + "name": "Colby Banbury", + "avatar_url": "https://avatars.githubusercontent.com/colbybanbury", + "profile": "https://github.com/colbybanbury", + "contributions": [] }, { "login": "18jeffreyma", "name": "Jeffrey Ma", "avatar_url": "https://avatars.githubusercontent.com/18jeffreyma", "profile": "https://github.com/18jeffreyma", - "contributions": [ - "doc" - ] + "contributions": [] }, { - "login": "ishapira1", - "name": "ishapira", - "avatar_url": "https://avatars.githubusercontent.com/ishapira1", - "profile": "https://github.com/ishapira1", - "contributions": [ - "doc" - ] + "login": "jessicaquaye", + "name": "Jessica Quaye", + "avatar_url": "https://avatars.githubusercontent.com/jessicaquaye", + "profile": "https://github.com/jessicaquaye", + "contributions": [] }, { - "login": "ShvetankPrakash", - "name": "Shvetank Prakash", - "avatar_url": "https://avatars.githubusercontent.com/ShvetankPrakash", - "profile": "https://github.com/ShvetankPrakash", - "contributions": [ - "doc" - ] + "login": "BaeHenryS", + "name": "Henry Bae", + "avatar_url": "https://avatars.githubusercontent.com/BaeHenryS", + "profile": "https://github.com/BaeHenryS", + "contributions": [] }, { - "login": "oishib", - "name": "oishib", - "avatar_url": "https://avatars.githubusercontent.com/oishib", - "profile": "https://github.com/oishib", - "contributions": [ - "doc" - ] + "login": "uchendui", + "name": "Ikechukwu Uchendu", + "avatar_url": "https://avatars.githubusercontent.com/uchendui", + "profile": "https://github.com/uchendui", + "contributions": [] }, { - "login": "aptl26", - "name": "aptl26", - "avatar_url": "https://avatars.githubusercontent.com/aptl26", - "profile": "https://github.com/aptl26", - "contributions": [ - "doc" - ] + "login": "mpstewart1", + "name": "Matthew Stewart", + "avatar_url": "https://avatars.githubusercontent.com/mpstewart1", + "profile": "https://github.com/mpstewart1", + "contributions": [] }, { - "login": "colbybanbury", - "name": "Colby Banbury", - "avatar_url": "https://avatars.githubusercontent.com/colbybanbury", - "profile": "https://github.com/colbybanbury", - "contributions": [ - "doc" - ] + "login": "jared-ni", + "name": "Jared Ni", + "avatar_url": "https://avatars.githubusercontent.com/jared-ni", + "profile": "https://github.com/jared-ni", + "contributions": [] }, { - "login": "BaeHenryS", - "name": "Henry Bae", - "avatar_url": "https://avatars.githubusercontent.com/BaeHenryS", - "profile": "https://github.com/BaeHenryS", - "contributions": [ - "doc" - ] + "login": "DivyaAmirtharaj", + "name": "Divya", + "avatar_url": "https://avatars.githubusercontent.com/DivyaAmirtharaj", + "profile": "https://github.com/DivyaAmirtharaj", + "contributions": [] + }, + { + "login": "oishib", + "name": "oishib", + "avatar_url": "https://avatars.githubusercontent.com/oishib", + "profile": "https://github.com/oishib", + "contributions": [] + }, + { + "login": "sjohri20", + "name": "sjohri20", + "avatar_url": "https://avatars.githubusercontent.com/sjohri20", + "profile": "https://github.com/sjohri20", + "contributions": [] }, { "login": "marcozennaro", "name": "Marco Zennaro", "avatar_url": "https://avatars.githubusercontent.com/marcozennaro", "profile": "https://github.com/marcozennaro", - "contributions": [ - "doc" - ] + "contributions": [] }, { "login": "michael-schnebly", "name": "Michael Schnebly", "avatar_url": "https://avatars.githubusercontent.com/michael-schnebly", "profile": "https://github.com/michael-schnebly", - "contributions": [ - "doc" - ] + "contributions": [] }, { - "login": "mpstewart1", - "name": "Matthew Stewart", - "avatar_url": "https://avatars.githubusercontent.com/mpstewart1", - "profile": "https://github.com/mpstewart1", - "contributions": [ - "doc" - ] + "login": "happyappledog", + "name": "happyappledog", + "avatar_url": "https://avatars.githubusercontent.com/happyappledog", + "profile": "https://github.com/happyappledog", + "contributions": [] }, { - "login": "uchendui", - "name": "Ikechukwu Uchendu", - "avatar_url": "https://avatars.githubusercontent.com/uchendui", - "profile": "https://github.com/uchendui", - "contributions": [ - "doc" - ] + "login": "profvjreddi", + "name": "Vijay Janapa Reddi", + "avatar_url": "https://avatars.githubusercontent.com/profvjreddi", + "profile": "https://github.com/profvjreddi", + "contributions": [] + }, + { + "login": "Naeemkh", + "name": "naeemkh", + "avatar_url": "https://avatars.githubusercontent.com/Naeemkh", + "profile": "https://github.com/Naeemkh", + "contributions": [] }, { "login": "sophiacho1", "name": "sophiacho1", "avatar_url": "https://avatars.githubusercontent.com/sophiacho1", "profile": "https://github.com/sophiacho1", - "contributions": [ - "doc" - ] - }, - { - "login": "alxrod", - "name": "alxrod", - "avatar_url": "https://avatars.githubusercontent.com/alxrod", - "profile": "https://github.com/alxrod", - "contributions": [ - "doc" - ] - }, - { - "login": "jared-ni", - "name": "Jared Ni", - "avatar_url": "https://avatars.githubusercontent.com/jared-ni", - "profile": "https://github.com/jared-ni", - "contributions": [ - "doc" - ] - }, - { - "login": "AditiR-42", - "name": "AditiR_42", - "avatar_url": "https://avatars.githubusercontent.com/AditiR-42", - "profile": "https://github.com/AditiR-42", - "contributions": [ - "doc" - ] + "contributions": [] } ], "repoType": "github", "contributorsPerLine": 5, "repoHost": "https=//github.com", "commitConvention": "angular", - "skipCi": true, - "commitType": "docs" + "skipCi": true } \ No newline at end of file diff --git a/.github/workflows/auto-add-contributors.yml b/.github/workflows/auto-add-contributors.yml index 765e2afb..2fbe39ff 100644 --- a/.github/workflows/auto-add-contributors.yml +++ b/.github/workflows/auto-add-contributors.yml @@ -2,7 +2,7 @@ name: Automatically Add Contributors on: push: branches: - - main + - main jobs: update-contributors: runs-on: ubuntu-latest diff --git a/.github/workflows/contributors/update_contributors.py b/.github/workflows/contributors/update_contributors.py index e9f19509..fd5b0418 100644 --- a/.github/workflows/contributors/update_contributors.py +++ b/.github/workflows/contributors/update_contributors.py @@ -5,9 +5,9 @@ from absl import app import requests -CONTRIBUTORS_FILE = '.all-contributorsrc' +CONTRIBUTORS_FILE = ".all-contributorsrc" -EXCLUDED_USERS = {'web-flow', 'github-actions[bot]', 'mrdragonbear', 'jveejay'} +EXCLUDED_USERS = {"web-flow", "github-actions[bot]", "mrdragonbear", "jveejay"} OWNER = "harvard-edge" REPO = "cs249r_book" @@ -17,19 +17,19 @@ def main(_): token = os.environ["GH_TOKEN"] - headers = { - "Authorization": f"token {token}" - } + headers = {"Authorization": f"token {token}"} data = [] - next_page = f'https://api.github.com/repos/{OWNER}/{REPO}/commits?sha={BRANCH}&per_page=100' + next_page = ( + f"https://api.github.com/repos/{OWNER}/{REPO}/commits?sha={BRANCH}&per_page=100" + ) last_page = None while next_page != last_page: - print(f'Fetching page: {next_page}') + print(f"Fetching page: {next_page}") res = requests.get(next_page, headers=headers) data.extend(res.json()) - next_page = res.links.get('next', {}).get('url', None) - last_page = res.links.get('last', {}).get('url', None) + next_page = res.links.get("next", {}).get("url", None) + last_page = res.links.get("last", {}).get("url", None) user_to_name_dict = dict() name_to_user_dict = dict() @@ -37,24 +37,26 @@ def main(_): user_full_names_from_api = set() for node in data: - commit_info = node.get('commit', None) - commit_author_info = commit_info.get('author', None) - commit_commiter_info = commit_info.get('committer', None) - author_info = node.get('author', None) - committer_info = node.get('committer', None) - committer_login_info = committer_info.get('login', None) if committer_info else None + commit_info = node.get("commit", None) + commit_author_info = commit_info.get("author", None) + commit_commiter_info = commit_info.get("committer", None) + author_info = node.get("author", None) + committer_info = node.get("committer", None) + committer_login_info = ( + committer_info.get("login", None) if committer_info else None + ) user_full_name = None username = None if commit_author_info: - user_full_name = commit_author_info['name'] + user_full_name = commit_author_info["name"] elif commit_commiter_info: - user_full_name = commit_commiter_info['name'] + user_full_name = commit_commiter_info["name"] if author_info: - username = author_info['login'] + username = author_info["login"] elif committer_login_info: - username = committer_login_info['login'] + username = committer_login_info["login"] if user_full_name: name_to_user_dict[user_full_name] = username if username else None @@ -63,25 +65,28 @@ def main(_): user_to_name_dict[username] = user_full_name if user_full_name else None users_from_api.add(username) - print('Users pulled from API: ', users_from_api) + print("Users pulled from API: ", users_from_api) - with open(CONTRIBUTORS_FILE, 'r') as contrib_file: + with open(CONTRIBUTORS_FILE, "r") as contrib_file: existing_contributor_data = json.load(contrib_file) - existing_contributors = existing_contributor_data['contributors'] + existing_contributors = existing_contributor_data["contributors"] existing_contributor_logins = [] for existing_contributor in existing_contributors: - user_to_name_dict[existing_contributor['login']] = existing_contributor['name'] - existing_contributor_logins.append(existing_contributor['login']) + user_to_name_dict[existing_contributor["login"]] = existing_contributor[ + "name" + ] + existing_contributor_logins.append(existing_contributor["login"]) existing_contributor_logins_set = set(existing_contributor_logins) - print('Existing contributors: ', existing_contributor_logins_set) + print("Existing contributors: ", existing_contributor_logins_set) existing_contributor_logins_set -= EXCLUDED_USERS # All contributors in the file should be in the API assert existing_contributor_logins_set.issubset( - users_from_api), 'All contributors in the .all-contributorsrc file should be pulled using the API' + users_from_api + ), "All contributors in the .all-contributorsrc file should be pulled using the API" new_contributor_logins = users_from_api - existing_contributor_logins_set - print('New contributors: ', new_contributor_logins - EXCLUDED_USERS) + print("New contributors: ", new_contributor_logins - EXCLUDED_USERS) result = users_from_api - EXCLUDED_USERS @@ -89,30 +94,35 @@ def main(_): projectName=REPO, projectOwner=OWNER, files=["contributors.qmd", "README.md"], - contributors=[dict(login=user, - name=user_to_name_dict[user] or user, - # If the user has no full name listed, use their username - avatar_url=f'https://avatars.githubusercontent.com/{user}', - profile=f'https://github.com/{user}', - contributions=['doc'], ) for - user in result], - - repoType='github', + contributors=[ + dict( + login=user, + name=user_to_name_dict[user] or user, + # If the user has no full name listed, use their username + avatar_url=f"https://avatars.githubusercontent.com/{user}", + profile=f"https://github.com/{user}", + # contributions=["doc"], + contributions=[], + ) + for user in result + ], + repoType="github", contributorsPerLine=5, repoHost="https=//github.com", - commitConvention='angular', + commitConvention="angular", skipCi=True, - commitType="docs" + # commitType="docs" ) print(final_result) - json_string = json.dumps(final_result, - indent=4) # The indent parameter is optional, but it formats the output to be more readable + json_string = json.dumps( + final_result, indent=4 + ) # The indent parameter is optional, but it formats the output to be more readable print(json_string) - with open(CONTRIBUTORS_FILE, 'w') as contrib_file: + with open(CONTRIBUTORS_FILE, "w") as contrib_file: contrib_file.write(json_string) -if __name__ == '__main__': +if __name__ == "__main__": app.run(main) diff --git a/README.md b/README.md index da3e98f6..edab891d 100644 --- a/README.md +++ b/README.md @@ -88,38 +88,38 @@ quarto render - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + +
Mark Mazumder
Mark Mazumder

📖
Vijay Janapa Reddi
Vijay Janapa Reddi

📖
happyappledog
happyappledog

📖
Jessica Quaye
Jessica Quaye

📖
Marcelo Rovai
Marcelo Rovai

📖
Marcelo Rovai
Marcelo Rovai

aptl26
aptl26

AditiR_42
AditiR_42

Shvetank Prakash
Shvetank Prakash

alxrod
alxrod

Divya
Divya

📖
naeemkh
naeemkh

📖
sjohri20
sjohri20

📖
Jayson Lin
Jayson Lin

📖
Jeffrey Ma
Jeffrey Ma

📖
ishapira
ishapira

Mark Mazumder
Mark Mazumder

Jayson Lin
Jayson Lin

Colby Banbury
Colby Banbury

Jeffrey Ma
Jeffrey Ma

ishapira
ishapira

📖
Shvetank Prakash
Shvetank Prakash

📖
oishib
oishib

📖
aptl26
aptl26

📖
Colby Banbury
Colby Banbury

📖
Jessica Quaye
Jessica Quaye

Henry Bae
Henry Bae

Ikechukwu Uchendu
Ikechukwu Uchendu

Matthew Stewart
Matthew Stewart

Jared Ni
Jared Ni

Henry Bae
Henry Bae

📖
Marco Zennaro
Marco Zennaro

📖
Michael Schnebly
Michael Schnebly

📖
Matthew Stewart
Matthew Stewart

📖
Ikechukwu Uchendu
Ikechukwu Uchendu

📖
Divya
Divya

oishib
oishib

sjohri20
sjohri20

Marco Zennaro
Marco Zennaro

Michael Schnebly
Michael Schnebly

sophiacho1
sophiacho1

📖
alxrod
alxrod

📖
Jared Ni
Jared Ni

📖
AditiR_42
AditiR_42

📖
happyappledog
happyappledog

Vijay Janapa Reddi
Vijay Janapa Reddi

naeemkh
naeemkh

sophiacho1
sophiacho1

diff --git a/contributors.qmd b/contributors.qmd index 023b6db6..3e506f56 100644 --- a/contributors.qmd +++ b/contributors.qmd @@ -8,38 +8,38 @@ We extend our sincere thanks to the diverse group of individuals who have genero - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + +
Mark Mazumder
Mark Mazumder

📖
Vijay Janapa Reddi
Vijay Janapa Reddi

📖
happyappledog
happyappledog

📖
Jessica Quaye
Jessica Quaye

📖
Marcelo Rovai
Marcelo Rovai

📖
Marcelo Rovai
Marcelo Rovai

aptl26
aptl26

AditiR_42
AditiR_42

Shvetank Prakash
Shvetank Prakash

alxrod
alxrod

Divya
Divya

📖
naeemkh
naeemkh

📖
sjohri20
sjohri20

📖
Jayson Lin
Jayson Lin

📖
Jeffrey Ma
Jeffrey Ma

📖
ishapira
ishapira

Mark Mazumder
Mark Mazumder

Jayson Lin
Jayson Lin

Colby Banbury
Colby Banbury

Jeffrey Ma
Jeffrey Ma

ishapira
ishapira

📖
Shvetank Prakash
Shvetank Prakash

📖
oishib
oishib

📖
aptl26
aptl26

📖
Colby Banbury
Colby Banbury

📖
Jessica Quaye
Jessica Quaye

Henry Bae
Henry Bae

Ikechukwu Uchendu
Ikechukwu Uchendu

Matthew Stewart
Matthew Stewart

Jared Ni
Jared Ni

Henry Bae
Henry Bae

📖
Marco Zennaro
Marco Zennaro

📖
Michael Schnebly
Michael Schnebly

📖
Matthew Stewart
Matthew Stewart

📖
Ikechukwu Uchendu
Ikechukwu Uchendu

📖
Divya
Divya

oishib
oishib

sjohri20
sjohri20

Marco Zennaro
Marco Zennaro

Michael Schnebly
Michael Schnebly

sophiacho1
sophiacho1

📖
alxrod
alxrod

📖
Jared Ni
Jared Ni

📖
AditiR_42
AditiR_42

📖
happyappledog
happyappledog

Vijay Janapa Reddi
Vijay Janapa Reddi

naeemkh
naeemkh

sophiacho1
sophiacho1