Crash whilst generating report
Describe the bug
Hi there, and happy new year 🎉
I'm trying out this action on relatively large organization (~1k repositories) and finding that it crashes out after a minute or so, in approximately the same place each time.
The traceback isn't obviously about rate limiting so I thought I'd raise an issue:
Traceback (most recent call last):
File "/action/workspace/stale_repos.py", line 424, in <module>
main()
~~~~^^
File "/action/workspace/stale_repos.py", line 55, in main
inactive_repos = get_inactive_repos(
github_connection, inactive_days_threshold, organization, additional_metrics
)
File "/action/workspace/stale_repos.py", line 146, in get_inactive_repos
repo_data = set_repo_data(
repo, days_inactive, active_date_disp, visibility, additional_metrics
)
File "/action/workspace/stale_repos.py", line 404, in set_repo_data
repo_data["days_since_last_release"] = get_days_since_last_release(repo)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/action/workspace/stale_repos.py", line 167, in get_days_since_last_release
last_release = next(repo.releases())
File "/usr/local/lib/python3.13/site-packages/github3/structs.py", line 142, in __next__
return next(self.__i__)
File "/usr/local/lib/python3.13/site-packages/github3/structs.py", line 131, in __iter__
yield cls(i)
~~~^^^
File "/usr/local/lib/python3.13/site-packages/github3/models.py", line 52, in __init__
self._update_attributes(json)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/local/lib/python3.13/site-packages/github3/repos/release.py", line 102, in _update_attributes
self.author = users.ShortUser(release["author"], self)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/github3/models.py", line 52, in __init__
self._update_attributes(json)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/local/lib/python3.13/site-packages/github3/users.py", line 309, in _update_attributes
self.avatar_url = user["avatar_url"]
~~~~^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
Please let me know if there's anything I can provide to help debug.
To Reproduce
Version used: v2.0.1 (d6c45761f4ee2f781251c788006d14ca48c6ec8e).
Expected behavior
N/A
Screenshots
No response
Additional context
No response
@skye-pp thanks for raising this error. I'm looking into it now.
Found a different issue, getting that merged and released. But we are aware of rate limiting needed (reference https://github.com/github/github-ospo/issues/77). I'll work on it this weekend. Again, thank you for raising the flag.
Thanks! Just to make sure I understand, are you saying you think the error is related to rate limiting, or it was related to the separate issue you found and fixed?
@skye-pp I believe your trace lends towards rate limiting. You wouldn't have authenticated successfully (when using a PAT) if it was the other issue (fixed with 2.1.0 release). If you want to pull 2.1.0 and retry, that'd be appreciated to confirm.
@skye-pp I looked at this over the weekend. We have a few paths forward. I'm speaking with other maintainers on how best we want to proceed.
Hey @jmeridth - any word on a path forward? 🙂
@skye-pp Apologies for the delayed response. I have not forgotten about this. We do. We're going to go with ReST rate limiting. And then quick follow to see if GraphQL will just minimize the necessary queries overall. But start with ReST rate limiting first. I hope to get after this in the next day or two.
This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.
@skye-pp I have not forgotten this
This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.
I'm hitting the same issue. Having a operations-per-run here would be great.
@1ucian0 Can you expand on what you mean by having a operations-per-run? What exactly would that track, and how would it be helpful? Thanks for helping me understand your suggestion better.
Because I thought the issue was related to rate limiting. But it seems like it is not. Here a way to reproduce it:
from github3 import GitHub
from stale_repos import get_days_since_last_release
github = GitHub()
repository = github.repository('qiskit-community', 'qiskit-qec')
print(get_days_since_last_release(repository))
It is because https://github.com/sigmavirus24/github3.py/issues/988 , when trying to fetch a release without author, I think.
@zkoppert following you lead, similar fix in https://github.com/github/stale-repos/pull/367 . Thanks!