-
Notifications
You must be signed in to change notification settings - Fork 27
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
self.avatar_url = user["avatar_url"] TypeError: 'NoneType' object is not subscriptable #173
Comments
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. |
Started looking at this today. |
Got a potential fix for this in #184. @kolbeface Any thoughts on this? Would you be able to test if this fixes your issue? |
@zkoppert if a ghost user is encountered will it still add the stale repo to the list? I tried to solve this problem myself but I got a bit lost in the github3 code. Still a bit of a novice. I appreciate you looking into this! |
Yes, it will still add the repo to the list but it will not be able to compute the last release or pr details. No worries, I also get lost in that code. 😁 |
Well in that case, I love it! Thank you so much! |
Describe the bug
I seem to be failing when subscripting through my stale repos. I believe the issue is that a ghost user created this particular repo. An older version of your code seems to not have this issue.
Here is the full output with some redacted repository information.
I believe it is failing on repository GG/light which was created by Bitrise Buildbot this bot is not a part of our org and I believe might be seen as a ghost user here is possibly a similar issue
Run github/stale-repos@v1 /usr/bin/docker run --name ghcriogithubstale_reposv1_056a4e --label 16a7a4 --workdir /github/workspace --rm -e "GH_TOKEN" -e "ORGANIZATION" -e "EXEMPT_TOPICS" -e "INACTIVE_DAYS" -e "ACTIVITY_METHOD" -e "ADDITIONAL_METRICS" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/security_services/security_services":"/github/workspace" ghcr.io/github/stale_repos:v1 Starting stale repo search... Exempt topics: ['keep', 'template'] https://github.com/GG/repo-Android: 3717 days inactive https://github.com/GG/repo: 3813 days inactive https://github.com/GG/repo-ios: 3449 days inactive https://github.com/GG/repo-spain-ios: 2986 days inactive https://github.com/GG/repo: 3393 days inactive https://github.com/GG/repo-automation: 504 days inactive https://github.com/GG/repo-styled: 2097 days inactive https://github.com/GG/repo-policy-reporter: 603 days inactive https://github.com/GG/repo: 418 days inactive https://github.com/GG/repo-ios: 1139 days inactive https://github.com/GG/repo-metrics: 1735 days inactive https://github.com/GG/repo-exercise-ios: 734 days inactive https://github.com/GG/repo: 1330 days inactive https://github.com/GG/repo-exercise-android: 1898 days inactive https://github.com/GG/repo-service: 568 days inactive https://github.com/GG/repo-wm-business-v2: 413 days inactive https://github.com/GG/repo-tests: 559 days inactive https://github.com/GG/repo-tf: 399 days inactive https://github.com/GG/repo: 545 days inactive https://github.com/GG/repo-jobs: 617 days inactive https://github.com/GG/repo-analytics: 412 days inactive https://github.com/GG/light: 435 days inactive Traceback (most recent call last): File "/action/workspace/stale_repos.py", line 408, in <module> main() File "/action/workspace/stale_repos.py", line 55, in main inactive_repos = get_inactive_repos( ^^^^^^^^^^^^^^^^^^^ File "/action/workspace/stale_repos.py", line 146, in get_inactive_repos repo_data = set_repo_data( ^^^^^^^^^^^^^^ File "/action/workspace/stale_repos.py", line 399, 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.12/site-packages/github3/structs.py", line 142, in __next__ return next(self.__i__) ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/github3/structs.py", line 131, in __iter__ yield cls(i) ^^^^^^ File "/usr/local/lib/python3.12/site-packages/github3/models.py", line 52, in __init__ self._update_attributes(json) File "/usr/local/lib/python3.12/site-packages/github3/repos/release.py", line 102, in _update_attributes self.author = users.ShortUser(release["author"], self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/github3/models.py", line 52, in __init__ self._update_attributes(json) File "/usr/local/lib/python3.12/site-packages/github3/users.py", line 309, in _update_attributes self.avatar_url = user["avatar_url"] ~~~~^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not subscriptable
Here is the problematic code:
And here is an older version that behaves as expected:
To Reproduce
run the program on a repo built by a ghost user, in our case the user is
Bitrise Buildbot
Expected behavior
Expected behavior is to create a github issue with stale repos
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: