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

Webhooks fail with 500 HTTP error #1952

Closed
karlcow opened this issue Dec 4, 2017 · 1 comment
Closed

Webhooks fail with 500 HTTP error #1952

karlcow opened this issue Dec 4, 2017 · 1 comment
Assignees

Comments

@karlcow
Copy link
Member

karlcow commented Dec 4, 2017

Testing locally.

127.0.0.1 - - [04/Dec/2017 14:27:01] "POST /webhooks/labeler HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/Users/karl/.virtualenvs/webcompatcom/lib/python2.7/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/karl/.virtualenvs/webcompatcom/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/karl/.virtualenvs/webcompatcom/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/karl/.virtualenvs/webcompatcom/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/karl/.virtualenvs/webcompatcom/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/karl/.virtualenvs/webcompatcom/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/karl/.virtualenvs/webcompatcom/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/karl/.virtualenvs/webcompatcom/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/karl/code/webcompat.com/webcompat/webhooks/__init__.py", line 47, in hooklistener
    response = new_opened_issue(payload)
  File "/Users/karl/code/webcompat.com/webcompat/webhooks/helpers.py", line 157, in new_opened_issue
    metadata_dict = extract_metadata_labels(issue_body)
NameError: global name 'extract_metadata_labels' is not defined

Oooops.

    metadata_dict = extract_metadata_labels(issue_body)
NameError: global name 'extract_metadata_labels' is not defined

let's see. Rho…

→ nosetests
.......................................................................
----------------------------------------------------------------------
Ran 71 tests in 2.266s

OK

We have a missing test or a false positive.

See this part

def extract_metadata(body):
"""Parse all the hidden comments for issue metadata
<!-- @foo: bar -->.
Returns a dict with all such comments as members,
with foo, bar as key, value.
"""
match_list = re.findall(r'<!--\s@(\w+):\s(.+)\s-->', body)
# Reverse the list before creating a dict, because we want to keep
# the first instance (in case there are duplicates added by the user after)
metadata_dict = dict(reversed(match_list))
return metadata_dict

which is supposed to be called

metadata_dict = extract_metadata_labels(issue_body)

but function have changed names? o_0

This commit!
c516370#diff-53c7dc964488671110b629cf6885fb3e

@karlcow
Copy link
Member Author

karlcow commented Dec 4, 2017

There is another 500 in there.

msg = 'failed to set labels on issue {issue}'.format(

This should be

msg = 'failed to set labels on issue {issue}'.format(issue=issue['number'])

karlcow added a commit to karlcow/webcompat.com that referenced this issue Dec 4, 2017
karlcow added a commit to karlcow/webcompat.com that referenced this issue Dec 4, 2017
@karlcow karlcow self-assigned this Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants