Skip to content

fix(github): report rate-limited or failed repo and event lookups - #452

Merged
NovaCode37 merged 3 commits into
NovaCode37:mainfrom
n-o-t-mugen:fix/github-recon-followup-rate-limit
Oct 1, 2026
Merged

NovaCode37 merged 3 commits into
NovaCode37:mainfrom
n-o-t-mugen:fix/github-recon-followup-rate-limit

Conversation

@n-o-t-mugen

Copy link
Copy Markdown

_get_repos and _emails_from_events swallowed every failure and returned an empty list, so a 403/429 on the follow-up calls produced status ok, repo_count 0 and no commit emails next to a profile with public repos.

Both helpers now return (data, failure). A failed call is annotated as RATE_LIMITED with the GITHUB_TOKEN hint, or ERROR, the profile is kept, and repo_count / emails are left as None for the part not checked.

Closes #445

_get_repos and _emails_from_events swallowed every failure and returned
an empty list, so a 403/429 on the follow-up calls produced status ok,
repo_count 0 and no commit emails next to a profile with public repos.

Both helpers now return (data, failure). A failed call is annotated as
RATE_LIMITED with the GITHUB_TOKEN hint, or ERROR, the profile is kept,
and repo_count / emails are left as None for the part not checked.

Closes NovaCode37#445
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Thanks for the first pull request here. CI needs a maintainer to approve the run before it starts, so it may sit for a bit before anything happens. pytest tests/ -q passing is the main thing I look at.

@github-actions github-actions Bot added the python Pull requests that update python code label Oct 1, 2026
@NovaCode37

Copy link
Copy Markdown
Owner

Thanks, this is close. Splitting "none found" from "could not check" and keeping the profile on a partial failure is exactly right, and the tests cover it.

One thing to change, and it is partly the issue's fault for saying to leave the email list as None: when the events call fails, result["emails"] = None also throws away the email from the profile, which was fetched successfully a few lines earlier (if u.get("email"): result["emails"].append(...)). That is a real finding lost.

Keep emails as a list containing what was actually found, and mark only the commit-email part as unchecked, for example "commit_emails_checked": False. The RATE_LIMITED / ERROR annotation already tells the reader the result is partial. repo_count = None is fine as it is, since nothing is known about repos in that case.

Please add a test where the profile has an email and the events call returns 403, and check the email is still there.

@xiasan1992

Copy link
Copy Markdown

I opened a small follow-up PR against your branch: n-o-t-mugen#1. It preserves the profile email when the events request fails and exposes commit_emails_checked so an unchecked commit-email lookup is explicit. The GitHub Recon tests pass (9/9); the follow-up is ready to merge or cherry-pick into this branch. I also see your CI checks are green.

@NovaCode37

Copy link
Copy Markdown
Owner

@xiasan1992's follow-up (n-o-t-mugen#1) is exactly the change I asked for: the profile email stays and commit_emails_checked marks what was not verified. @n-o-t-mugen, if you merge it into your branch, I will merge this PR once CI is green, and you both end up credited in the history.

@n-o-t-mugen

Copy link
Copy Markdown
Author

Pulled in @xiasan1992's two commits from n-o-t-mugen#1 (1c598b3, 0774096): the profile email is now kept when the events call fails, commit_emails_checked marks the unchecked part, and there's a test for the profile-email + events 403 case.

I didn't include the later 1c6bd62, since it changes behaviour beyond the review (defaults when the profile call fails). Full suite passes locally.

@xiasan1992

Copy link
Copy Markdown

@n-o-t-mugen Thanks for confirming and for incorporating 1c598b3 and 0774096. I understand 1c6bd62 was left out because it extends beyond the review scope. I’ll keep that change separate. I appreciate the review and the credit in the commit history.

@NovaCode37
NovaCode37 merged commit 163b2bf into NovaCode37:main Oct 1, 2026
8 checks passed
@NovaCode37 NovaCode37 added the hacktoberfest-accepted Counts toward Hacktoberfest label Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Counts toward Hacktoberfest python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

github_recon says ok with 0 repos and no commit emails when the follow-up calls are rate limited

3 participants