servo / homu

A bot that integrates with GitHub and your favorite continuous integration service
MIT License
328 stars 51 forks source link

Traceback with missing `max_priority` #163

Open Valloric opened 6 years ago

Valloric commented 6 years ago

Updating to latest homu, we're now seeing a traceback on this line about missing max_priority:

https://github.com/servo/homu/blob/68e4dd921067b8f22f38439b2f5cec9c23ffc961/homu/action.py#L120

Adding the following k-v under github the way the sample config has it:

# Priority values above max_priority will be refused.
max_priority = 9001

does NOT fix the issue.

Valloric commented 6 years ago

cc @alexrs

Valloric commented 6 years ago

BTW, worked around it locally with a patch that changes the line to:

 if pvalue > cfg.get('max_priority', 10000):
Valloric commented 6 years ago

Full traceback (apologies for formatting, it's from syslog):

Jul  6 16:05:58 homu-bot homu[614]: INFO:homu.server:Synchronizing ycmd...
Jul  6 16:08:09 homu-bot homu[614]: Traceback (most recent call last):
Jul  6 16:08:09 homu-bot homu[614]: File "/home/valloric/homu/homu/server.py", line 710, in sync_repo
Jul  6 16:08:09 homu-bot homu[614]: g.my_username, g.repo_labels)
Jul  6 16:08:09 homu-bot homu[614]: File "/home/valloric/homu/homu/main.py", line 1315, in synchronize
Jul  6 16:08:09 homu-bot homu[614]: states,
Jul  6 16:08:09 homu-bot homu[614]: File "/home/valloric/homu/homu/main.py", line 476, in parse_commands
Jul  6 16:08:09 homu-bot homu[614]: if not action.set_priority(state, realtime, word[len('p='):], cfg):
Jul  6 16:08:09 homu-bot homu[614]: File "/home/valloric/homu/homu/action.py", line 120, in set_priority
Jul  6 16:08:09 homu-bot homu[614]: if pvalue > cfg['max_priority']:
Jul  6 16:08:09 homu-bot homu[614]: KeyError: 'max_priority'
jdm commented 6 years ago

The code should be looking for cfg['github']['max_priority'] to match the example configuration file.

Manishearth commented 6 years ago

Fixed by https://github.com/servo/homu/pull/168