Skip to content

Handle anonymous contributors#1357

Open
CodingFeng101 wants to merge 1 commit into
sigmavirus24:mainfrom
CodingFeng101:codex/anonymous-contributors
Open

Handle anonymous contributors#1357
CodingFeng101 wants to merge 1 commit into
sigmavirus24:mainfrom
CodingFeng101:codex/anonymous-contributors

Conversation

@CodingFeng101

Copy link
Copy Markdown

What changed

Contributor now handles anonymous contributor records returned by the contributors API when anon=true. Anonymous records keep their name, email, and contribution count without trying to parse missing user URL/avatar fields.

Why

This addresses #891. GitHub can return anonymous contributor records that do not include the full user payload. The previous parsing path always used _User._update_attributes(), so it raised IncompleteResponse from a missing field such as avatar_url before iteration could continue.

Validation

  • python -m pytest tests\unit\test_users.py::TestContributor -q
  • python -m pytest tests\unit\test_repos_repo.py::TestRepositoryIterator::test_contributors tests\unit\test_repos_repo.py::TestRepositoryIterator::test_contributors_with_anon -q
  • python -m compileall -q src\github3\users.py tests\unit\test_users.py
  • python -m black --check src\github3\users.py tests\unit\test_users.py
  • python -m flake8 src\github3\users.py tests\unit\test_users.py
  • git diff --check

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