Skip to content
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

KeyError: login in github_utils adding author #178

Open
navignaw opened this issue May 2, 2024 · 1 comment
Open

KeyError: login in github_utils adding author #178

navignaw opened this issue May 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@navignaw
Copy link

navignaw commented May 2, 2024

Describe the bug
revup upload fails with a python KeyError if a reviewer author is missing the "login" attribute.

I am fairly sure this is due to a review from an automated app, i.e.
Screenshot 2024-05-02 at 8 05 24 AM

as it started failing immediately after this reviewer left an automated comment on the PR.

Expected behavior
revup upload works as intended

To Reproduce

  1. Create a PR with an automated reviewer. One way to do so is to set up the GHA https://github.com/googleapis/code-suggester, but there are probably easier ways to automate adding a reviewer
  2. Run revup upload against that topic

Logs

Traceback (most recent call last):
  File "/usr/local/bin/revup", line 8, in <module>
    sys.exit(_main())
  File "/usr/local/lib/python3.8/site-packages/revup/__main__.py", line 18, in _main
    sys.exit(asyncio.run(main()))
  File "/usr/local/Cellar/python@3.8/3.8.18/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/Cellar/python@3.8/3.8.18/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/site-packages/revup/revup.py", line 393, in main
    return await upload.main(
  File "/usr/local/lib/python3.8/site-packages/revup/upload.py", line 48, in main
    await topics.query_github()
  File "/usr/local/lib/python3.8/site-packages/revup/topic_stack.py", line 1015, in query_github
    ) = await github_utils.query_everything(
  File "/usr/local/lib/python3.8/site-packages/revup/github_utils.py", line 276, in query_everything
    reviewers.add(revs["author"]["login"])
KeyError: 'login'
@navignaw navignaw added the bug Something isn't working label May 2, 2024
@navignaw
Copy link
Author

navignaw commented May 22, 2024

It looks like there is a check for login in the reviewRequests case. Any objections to just adding the same if "login" in X check to the other branch?

elif "login" in revs["requestedReviewer"]:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant