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

Fixes error resolving collaboration commit author in edge cases #384

Merged

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Mar 13, 2024

Error: https://github.com/coronasafe/leaderboard-data/actions/runs/8258085927/job/22589738046

In certain cases, GitHub returns the event with commit.author being null and hence have to use the commit.commit.author.name instead.

Sample Response 1
{
    "sha": "b381289d451f9ea75879ccab892fa7db5adb4cde",
    "node_id": "C_kwDOLdtyR9oAKGIzODEyODlkNDUxZjllYTc1ODc5Y2NhYjg5MmZhN2RiNWFkYjRjZGU",
    "commit": {
        "author": {
            "name": "Dareenfadel",
            "email": "https://github.com/Dareenfadel",
            "date": "2024-03-08T21:57:06Z"
        },
        "committer": {
            "name": "Dareenfadel",
            "email": "https://github.com/Dareenfadel",
            "date": "2024-03-08T21:57:06Z"
        },
        "message": "\"Fix issue #7361: Block users from entering date out of range\"",
        "tree": {
            "sha": "960cf92901c4d9aec108c039b7325b95ac073689",
            "url": "https://api.github.com/repos/coronasafe/care_fe/git/trees/960cf92901c4d9aec108c039b7325b95ac073689"
        },
        "url": "https://api.github.com/repos/coronasafe/care_fe/git/commits/b381289d451f9ea75879ccab892fa7db5adb4cde",
        "comment_count": 0,
        "verification": {
            "verified": false,
            "reason": "unsigned",
            "signature": null,
            "payload": null
        }
    },
    "url": "https://api.github.com/repos/coronasafe/care_fe/commits/b381289d451f9ea75879ccab892fa7db5adb4cde",
    "html_url": "https://github.com/coronasafe/care_fe/commit/b381289d451f9ea75879ccab892fa7db5adb4cde",
    "comments_url": "https://api.github.com/repos/coronasafe/care_fe/commits/b381289d451f9ea75879ccab892fa7db5adb4cde/comments",
    "author": null,
    "committer": null,
    "parents": [
        {
            "sha": "83dc92fd31cf5f50f775d6e6e4c40e9b567368b9",
            "url": "https://api.github.com/repos/coronasafe/care_fe/commits/83dc92fd31cf5f50f775d6e6e4c40e9b567368b9",
            "html_url": "https://github.com/coronasafe/care_fe/commit/83dc92fd31cf5f50f775d6e6e4c40e9b567368b9"
        }
    ]
}
Sample Response 2
{
    "sha": "e8ea0ebbc48dcb58d424265520a81210a412740c",
    "node_id": "C_kwDOLZIQONoAKGU4ZWEwZWJiYzQ4ZGNiNThkNDI0MjY1NTIwYTgxMjEwYTQxMjc0MGM",
    "commit": {
        "author": {
            "name": "mohanrajnambe",
            "email": "mohanrajnambe@gmail.com",
            "date": "2024-03-07T06:14:19Z"
        },
        "committer": {
            "name": "mohanrajnambe",
            "email": "mohanrajnambe@gmail.com",
            "date": "2024-03-07T06:15:00Z"
        },
        "message": "Remove unnecessary null checks added in Consultation card",
        "tree": {
            "sha": "a05679cbe857e3d1284b069cfe24d475f6965c8d",
            "url": "https://api.github.com/repos/coronasafe/care_fe/git/trees/a05679cbe857e3d1284b069cfe24d475f6965c8d"
        },
        "url": "https://api.github.com/repos/coronasafe/care_fe/git/commits/e8ea0ebbc48dcb58d424265520a81210a412740c",
        "comment_count": 0,
        "verification": {
            "verified": false,
            "reason": "unsigned",
            "signature": null,
            "payload": null
        }
    },
    "url": "https://api.github.com/repos/coronasafe/care_fe/commits/e8ea0ebbc48dcb58d424265520a81210a412740c",
    "html_url": "https://github.com/coronasafe/care_fe/commit/e8ea0ebbc48dcb58d424265520a81210a412740c",
    "comments_url": "https://api.github.com/repos/coronasafe/care_fe/commits/e8ea0ebbc48dcb58d424265520a81210a412740c/comments",
    "author": {
        "login": "mohanrajnambe",
        "id": 55721773,
        "node_id": "MDQ6VXNlcjU1NzIxNzcz",
        "avatar_url": "https://avatars.githubusercontent.com/u/55721773?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/mohanrajnambe",
        "html_url": "https://github.com/mohanrajnambe",
        "followers_url": "https://api.github.com/users/mohanrajnambe/followers",
        "following_url": "https://api.github.com/users/mohanrajnambe/following{/other_user}",
        "gists_url": "https://api.github.com/users/mohanrajnambe/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/mohanrajnambe/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/mohanrajnambe/subscriptions",
        "organizations_url": "https://api.github.com/users/mohanrajnambe/orgs",
        "repos_url": "https://api.github.com/users/mohanrajnambe/repos",
        "events_url": "https://api.github.com/users/mohanrajnambe/events{/privacy}",
        "received_events_url": "https://api.github.com/users/mohanrajnambe/received_events",
        "type": "User",
        "site_admin": false
    },
    "committer": {
        "login": "mohanrajnambe",
        "id": 55721773,
        "node_id": "MDQ6VXNlcjU1NzIxNzcz",
        "avatar_url": "https://avatars.githubusercontent.com/u/55721773?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/mohanrajnambe",
        "html_url": "https://github.com/mohanrajnambe",
        "followers_url": "https://api.github.com/users/mohanrajnambe/followers",
        "following_url": "https://api.github.com/users/mohanrajnambe/following{/other_user}",
        "gists_url": "https://api.github.com/users/mohanrajnambe/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/mohanrajnambe/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/mohanrajnambe/subscriptions",
        "organizations_url": "https://api.github.com/users/mohanrajnambe/orgs",
        "repos_url": "https://api.github.com/users/mohanrajnambe/repos",
        "events_url": "https://api.github.com/users/mohanrajnambe/events{/privacy}",
        "received_events_url": "https://api.github.com/users/mohanrajnambe/received_events",
        "type": "User",
        "site_admin": false
    },
    "parents": [
        {
            "sha": "a6106d294dd876289509a24819e60bb9f9b80289",
            "url": "https://api.github.com/repos/coronasafe/care_fe/commits/a6106d294dd876289509a24819e60bb9f9b80289",
            "html_url": "https://github.com/coronasafe/care_fe/commit/a6106d294dd876289509a24819e60bb9f9b80289"
        }
    ]
}

Copy link

vercel bot commented Mar 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
leaderboard 🔄 Building (Inspect) Visit Preview Mar 13, 2024 3:56am

@rithviknishad rithviknishad requested a review from sainak March 13, 2024 03:57
@rithviknishad rithviknishad merged commit 28c12c4 into main Mar 13, 2024
2 of 3 checks passed
@rithviknishad rithviknishad deleted the fixes-error-resolving-collaboration-commit-author branch March 13, 2024 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant