fix: TypeError when processing pull requests with ghost users#585
Merged
fix: TypeError when processing pull requests with ghost users#585
Conversation
Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] TypeError: 'NoneType' object is not subscriptable
Fix TypeError when processing pull requests with ghost users
Sep 2, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a TypeError that occurs when processing pull requests containing ghost users (deleted GitHub accounts). The error happens when the github3 library attempts to access repository owner information that is None for deleted accounts.
- Wraps the problematic
pull_request()call in a try-catch block to handle TypeError exceptions - Adds comprehensive test coverage for the ghost user scenario
- Follows the established error handling pattern used elsewhere in the codebase
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| issue_metrics.py | Adds try-catch error handling around pull_request() call to gracefully handle ghost user scenarios |
| test_issue_metrics.py | Adds comprehensive test case to verify proper handling of TypeError when processing pull requests with ghost users |
Collaborator
|
@copilot can you fix this issue There's inconsistent spacing in the comment. The # type:ignore comment should have a space after the colon: # type: ignore. |
Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Contributor
Author
zkoppert
approved these changes
Sep 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
# type: ignorecomments to be consistent with code style💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.