Log github delivery ids properly
Previously we were doing a get for 'X-GitHub-Delivery' on a python dict which didn't have this key. The key in the dict is 'x-github-delivery'. Because of this we were logging None as the delivery id. Fix this by updating the key used which will give us logging data that is helpful for debugging. Side note. The header as sent by github to the zuul web server appears to be 'X-GitHub-Delivery' with that case. But somewhere along the line things get normalized to lower case. This is true for the other headers we lookat in the events as well. Change-Id: I8acbc910e7e50aa53c1ade0fa2ce6f2afed053d7
This commit is contained in:
parent
f67bdd0f35
commit
cdcc8f304d
|
@ -1085,7 +1085,9 @@ class FakeGithubConnection(githubconnection.GithubConnection):
|
||||||
payload = json.dumps(data).encode('utf8')
|
payload = json.dumps(data).encode('utf8')
|
||||||
secret = self.connection_config['webhook_token']
|
secret = self.connection_config['webhook_token']
|
||||||
signature = githubconnection._sign_request(payload, secret)
|
signature = githubconnection._sign_request(payload, secret)
|
||||||
headers = {'x-github-event': name, 'x-hub-signature': signature}
|
headers = {'x-github-event': name,
|
||||||
|
'x-hub-signature': signature,
|
||||||
|
'x-github-delivery': str(uuid.uuid4())}
|
||||||
|
|
||||||
if use_zuulweb:
|
if use_zuulweb:
|
||||||
return requests.post(
|
return requests.post(
|
||||||
|
|
|
@ -110,7 +110,7 @@ class GithubGearmanWorker(object):
|
||||||
headers = args.get("headers")
|
headers = args.get("headers")
|
||||||
body = args.get("body")
|
body = args.get("body")
|
||||||
|
|
||||||
delivery = headers.get('X-GitHub-Delivery')
|
delivery = headers.get('x-github-delivery')
|
||||||
self.log.debug("Github Webhook Received: {delivery}".format(
|
self.log.debug("Github Webhook Received: {delivery}".format(
|
||||||
delivery=delivery))
|
delivery=delivery))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue