This repository was archived by the owner on Mar 14, 2023. It is now read-only.
This repository was archived by the owner on Mar 14, 2023. It is now read-only.
Highfive crashes where a PR has no description #184
Closed
Description
When a PR is opened but has no description (like rust-lang/rust#56989), highfive crashes before assigning a reviewer or commenting.
Traceback (most recent call last):
File "/home/ec2-user/highfive/highfive/newpr.py", line 433, in <module>
handler.run()
File "/home/ec2-user/highfive/highfive/newpr.py", line 71, in run
self.new_pr()
File "/home/ec2-user/highfive/highfive/newpr.py", line 359, in new_pr
reviewer = self.find_reviewer(msg)
File "/home/ec2-user/highfive/highfive/newpr.py", line 238, in find_reviewer
match = reviewer_re.search(msg)
TypeError: expected string or buffer
This is caused by GitHub setting the body to null
instead of an empty string where there is no PR description:
{
"action": "opened",
"number": 56989,
"pull_request": {
"number": 56989,
"state": "open",
"locked": false,
"title": "Fix compiletest `trim` deprecation warnings",
"user": {
"login": "phansch",
"id": 2042399,
...
},
"body": null,
...
}
}