-
Notifications
You must be signed in to change notification settings - Fork 407
Don't expect commit_id for PullReview #944
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
Don't expect commit_id for PullReview #944
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a simple code change, and the code itself looks fine. I want to see the docstring updated to inform consumers why this value might be None
.
I've checked with GitHub and it is expected that this can be None
, and we're confirming the scenario in which it would be (current assumption is that it was a review on a commit that was force pushed out of the branch).
Can you ask GitHub support for an explanation? |
I have an open request internally for more information. |
Pull-request updated, HEAD is now c096b61 |
e88fa45
to
c096b61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good enough as is, but I'm going to wait to hear from GitHub on the real reasoning. It may. not be until next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, changing to approve to clear the previous rejection. The suggested change does not block the PR.
In some cases, a PullReview may not have a commit_id (I am not sure why that is). In this case, we should not always expect it to be there. 2019-05-30 21:20:25,678 ERROR zuul.GithubEventConnector: Exception moving GitHub event: Traceback (most recent call last): File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/github3/models.py", line 48, in __init__ self._update_attributes(json) File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/github3/pulls.py", line 961, in _update_attributes self.commit_id = review["commit_id"] KeyError: 'commit_id' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 484, in run GithubEventProcessor(self, data).run() File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 218, in run self._handle_event() File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 265, in _handle_event refresh=True) File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 903, in _getChange self._updateChange(change) File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 1008, in _updateChange change.number) File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 1246, in getPullReviews revs = [review.as_dict() for review in pr_obj.reviews()] File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 1246, in <listcomp> revs = [review.as_dict() for review in pr_obj.reviews()] File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/github3/structs.py", line 122, in __iter__ yield cls(i) File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/github3/models.py", line 50, in __init__ raise exceptions.IncompleteResponse(json, kerr) github3.exceptions.IncompleteResponse: None The library was expecting more data in the response (KeyError('commit_id',)). Either GitHub modified it's response body, or your token is not prop erly scoped to retrieve this information. https://api.github.com/repos/ansible/ansible/pulls/45469/reviews Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Pull-request updated, HEAD is now 2ce81e7 |
c096b61
to
2ce81e7
Compare
Confirmed from internal, this is due to commit_id being lost due to force push.
|
In some cases, a PullReview may not have a commit_id (I am not sure why
that is). In this case, we should not always expect it to be there.
2019-05-30 21:20:25,678 ERROR zuul.GithubEventConnector: Exception moving GitHub event:
Traceback (most recent call last):
File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/github3/models.py", line 48, in init
self._update_attributes(json)
File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/github3/pulls.py", line 961, in _update_attributes
self.commit_id = review["commit_id"]
KeyError: 'commit_id'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 484, in run
GithubEventProcessor(self, data).run()
File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 218, in run
self._handle_event()
File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 265, in _handle_event
refresh=True)
File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 903, in _getChange
self._updateChange(change)
File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 1008, in _updateChange
change.number)
File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 1246, in getPullReviews
revs = [review.as_dict() for review in pr_obj.reviews()]
File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 1246, in
revs = [review.as_dict() for review in pr_obj.reviews()]
File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/github3/structs.py", line 122, in iter
yield cls(i)
File "/opt/venv/zuul-3.8.1/lib/python3.6/site-packages/github3/models.py", line 50, in init
raise exceptions.IncompleteResponse(json, kerr)
github3.exceptions.IncompleteResponse: None The library was expecting more data in the response (KeyError('commit_id',)). Either GitHub modified it's response body, or your token is not prop
erly scoped to retrieve this information.
https://api.github.com/repos/ansible/ansible/pulls/45469/reviews
Signed-off-by: Paul Belanger pabelanger@redhat.com