revup
revup copied to clipboard
KeyError: login in github_utils adding author
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.
as it started failing immediately after this reviewer left an automated comment on the PR.
Expected behavior
revup upload works as intended
To Reproduce
- 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
- Run
revup uploadagainst 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/[email protected]/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/[email protected]/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'