Title: Add tests for problems exposed by cosmic-ray · Issue #11 · bloomberg/python-github-webhook · GitHub
Open Graph Title: Add tests for problems exposed by cosmic-ray · Issue #11 · bloomberg/python-github-webhook
X Title: Add tests for problems exposed by cosmic-ray · Issue #11 · bloomberg/python-github-webhook
Description: job ID 1f37d3c49055482e8dbcea3a1d3f8830:survived:github_webhook.webhook command: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p e r a t o r 1 --- mutation diff --- --- ...
Open Graph Description: job ID 1f37d3c49055482e8dbcea3a1d3f8830:survived:github_webhook.webhook command: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p ...
X Description: job ID 1f37d3c49055482e8dbcea3a1d3f8830:survived:github_webhook.webhook command: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p ...
Opengraph URL: https://github.com/bloomberg/python-github-webhook/issues/11
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add tests for problems exposed by cosmic-ray","articleBody":"```diff\r\njob ID 1f37d3c49055482e8dbcea3a1d3f8830:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p e r a t o r 1\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -13,7 +13,7 @@\r\n app.add_url_rule(rule=endpoint, endpoint=endpoint, view_func=self._postreceive, methods=['POST'])\r\n self._hooks = collections.defaultdict(list)\r\n self._logger = logging.getLogger('webhook')\r\n- if ((secret is not None) and (not isinstance(secret, six.binary_type))):\r\n+ if ((secret != None) and (not isinstance(secret, six.binary_type))):\r\n secret = secret.encode('utf-8')\r\n self._secret = secret\r\n\r\n\r\njob ID 2e66309c18ed4f9c8953fc622f5f5211:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p e r a t o r 1 0\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -32,7 +32,7 @@\r\n def _postreceive(self):\r\n 'Callback from Flask'\r\n digest = self._get_digest()\r\n- if (digest is not None):\r\n+ if (digest != None):\r\n sig_parts = _get_header('X-Hub-Signature').split('=', 1)\r\n if (not isinstance(digest, six.text_type)):\r\n digest = six.text_type(digest)\r\n\r\njob ID 634be3d1ff434425bf254ead62935081:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p e r a t o r 1 9\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -36,7 +36,7 @@\r\n sig_parts = _get_header('X-Hub-Signature').split('=', 1)\r\n if (not isinstance(digest, six.text_type)):\r\n digest = six.text_type(digest)\r\n- if ((len(sig_parts) \u003c 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n+ if ((len(sig_parts) != 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n abort(400, 'Invalid signature')\r\n event_type = _get_header('X-Github-Event')\r\n data = request.get_json()\r\n\r\njob ID 5ae6d0a91c2d4684b02aaa340d9d3eab:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p e r a t o r 2 1\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -36,7 +36,7 @@\r\n sig_parts = _get_header('X-Hub-Signature').split('=', 1)\r\n if (not isinstance(digest, six.text_type)):\r\n digest = six.text_type(digest)\r\n- if ((len(sig_parts) \u003c 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n+ if ((len(sig_parts) \u003e 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n abort(400, 'Invalid signature')\r\n event_type = _get_header('X-Github-Event')\r\n data = request.get_json()\r\n\r\njob ID 4a2be988d3894f3d8d9fdc46b55fa306:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p e r a t o r 2 4\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -36,7 +36,7 @@\r\n sig_parts = _get_header('X-Hub-Signature').split('=', 1)\r\n if (not isinstance(digest, six.text_type)):\r\n digest = six.text_type(digest)\r\n- if ((len(sig_parts) \u003c 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n+ if ((len(sig_parts) is not 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n abort(400, 'Invalid signature')\r\n event_type = _get_header('X-Github-Event')\r\n data = request.get_json()\r\n\r\njob ID 3933a0d64fe546699d25aed4d58afece:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p e r a t o r 2 8\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -36,7 +36,7 @@\r\n sig_parts = _get_header('X-Hub-Signature').split('=', 1)\r\n if (not isinstance(digest, six.text_type)):\r\n digest = six.text_type(digest)\r\n- if ((len(sig_parts) \u003c 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n+ if ((len(sig_parts) \u003c 2) or (sig_parts[0] \u003c 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n abort(400, 'Invalid signature')\r\n event_type = _get_header('X-Github-Event')\r\n data = request.get_json()\r\n\r\njob ID f8a284e6c67f4f669de506b73523cb11:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p e r a t o r 3 0\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -36,7 +36,7 @@\r\n sig_parts = _get_header('X-Hub-Signature').split('=', 1)\r\n if (not isinstance(digest, six.text_type)):\r\n digest = six.text_type(digest)\r\n- if ((len(sig_parts) \u003c 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n+ if ((len(sig_parts) \u003c 2) or (sig_parts[0] \u003e 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n abort(400, 'Invalid signature')\r\n event_type = _get_header('X-Github-Event')\r\n data = request.get_json()\r\n\r\njob ID d7f60eb0989f4aacabd62e9086d87975:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p e r a t o r 3 2\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -36,7 +36,7 @@\r\n sig_parts = _get_header('X-Hub-Signature').split('=', 1)\r\n if (not isinstance(digest, six.text_type)):\r\n digest = six.text_type(digest)\r\n- if ((len(sig_parts) \u003c 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n+ if ((len(sig_parts) \u003c 2) or (sig_parts[0] is 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n abort(400, 'Invalid signature')\r\n event_type = _get_header('X-Github-Event')\r\n data = request.get_json()\r\n\r\njob ID 12a01fb33247430394d523dce2bdf91a:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p e r a t o r 3 4\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -36,7 +36,7 @@\r\n sig_parts = _get_header('X-Hub-Signature').split('=', 1)\r\n if (not isinstance(digest, six.text_type)):\r\n digest = six.text_type(digest)\r\n- if ((len(sig_parts) \u003c 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n+ if ((len(sig_parts) \u003c 2) or (sig_parts[0] not in 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n abort(400, 'Invalid signature')\r\n event_type = _get_header('X-Github-Event')\r\n data = request.get_json()\r\n\r\njob ID a300f614a83a4c109e266885c72fc6c0:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p e r a t o r 3 5\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -40,7 +40,7 @@\r\n abort(400, 'Invalid signature')\r\n event_type = _get_header('X-Github-Event')\r\n data = request.get_json()\r\n- if (data is None):\r\n+ if (data == None):\r\n abort(400, 'Request body must contain json')\r\n self._logger.info('%s (%s)', _format_event(event_type, data), _get_header('X-Github-Delivery'))\r\n for hook in self._hooks.get(event_type, []):\r\n\r\njob ID 498e409e8cff49ceb7a6af2505d8ea98:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ u n a r y _ o p e r a t o r 1\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -34,7 +34,7 @@\r\n digest = self._get_digest()\r\n if (digest is not None):\r\n sig_parts = _get_header('X-Hub-Signature').split('=', 1)\r\n- if (not isinstance(digest, six.text_type)):\r\n+ if isinstance(digest, six.text_type):\r\n digest = six.text_type(digest)\r\n if ((len(sig_parts) \u003c 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n abort(400, 'Invalid signature')\r\n\r\njob ID af7031344c8f4fb4ae68441982768390:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k n u m b e r _ r e p l a c e r 0\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -33,7 +33,7 @@\r\n 'Callback from Flask'\r\n digest = self._get_digest()\r\n if (digest is not None):\r\n- sig_parts = _get_header('X-Hub-Signature').split('=', 1)\r\n+ sig_parts = _get_header('X-Hub-Signature').split('=', 2)\r\n if (not isinstance(digest, six.text_type)):\r\n digest = six.text_type(digest)\r\n if ((len(sig_parts) \u003c 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n\r\njob ID e6f95eb27afc43149a31b00e09224996:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k n u m b e r _ r e p l a c e r 6\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -45,7 +45,7 @@\r\n self._logger.info('%s (%s)', _format_event(event_type, data), _get_header('X-Github-Delivery'))\r\n for hook in self._hooks.get(event_type, []):\r\n hook(data)\r\n- return ('', 204)\r\n+ return ('', 205)\r\n\r\n def _get_header(key):\r\n 'Return message header'\r\n\r\njob ID a3c71ec1bc31429c97003395b4ab6389:survived:github_webhook.webhook\r\ncommand: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k r e p l a c e _ o r _ w i t h _ a n d 1\r\n--- mutation diff ---\r\n--- a/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n+++ b/Users/fphillips7/Code/python-github-webhook/github_webhook/webhook.py\r\n@@ -36,7 +36,7 @@\r\n sig_parts = _get_header('X-Hub-Signature').split('=', 1)\r\n if (not isinstance(digest, six.text_type)):\r\n digest = six.text_type(digest)\r\n- if ((len(sig_parts) \u003c 2) or (sig_parts[0] != 'sha1') or (not hmac.compare_digest(sig_parts[1], digest))):\r\n+ if (((len(sig_parts) \u003c 2) and (sig_parts[0] != 'sha1')) or (not hmac.compare_digest(sig_parts[1], digest))):\r\n abort(400, 'Invalid signature')\r\n event_type = _get_header('X-Github-Event')\r\n data = request.get_json()\r\n\r\ntotal jobs: 79\r\ncomplete: 79 (100.00%)\r\nsurvival rate: 17.72%\r\n```","author":{"url":"https://github.com/fophillips","@type":"Person","name":"fophillips"},"datePublished":"2017-10-30T09:59:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/11/python-github-webhook/issues/11"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a5bfe53b-fea5-2af1-128b-0c6a34c3049c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA10:FE603:ABAC5F:DF2001:696AFBC1 |
| html-safe-nonce | 07a059c6e811bc07b61b65e3a6922e0c85f8926b5fb8af2b6660168d7a3b4b40 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTEwOkZFNjAzOkFCQUM1RjpERjIwMDE6Njk2QUZCQzEiLCJ2aXNpdG9yX2lkIjoiMzY3OTU4ODU5MjY2NTY4OTAyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7bf82e6a871c16dd9e2135aec4003ea7efd71c42040d6809af9a602c7cf6b540 |
| hovercard-subject-tag | issue:269540228 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bloomberg/python-github-webhook/11/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dc791bdd6aad75fd728ad105ec646237768aee5a04592c98408574ac15ed937b/bloomberg/python-github-webhook/issues/11 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dc791bdd6aad75fd728ad105ec646237768aee5a04592c98408574ac15ed937b/bloomberg/python-github-webhook/issues/11 |
| og:image:alt | job ID 1f37d3c49055482e8dbcea3a1d3f8830:survived:github_webhook.webhook command: c o s m i c - r a y w o r k e r g i t h u b _ w e b h o o k . w e b h o o k m u t a t e _ c o m p a r i s o n _ o p ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fophillips |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/bloomberg/python-github-webhook git https://github.com/bloomberg/python-github-webhook.git |
| octolytics-dimension-user_id | 1416818 |
| octolytics-dimension-user_login | bloomberg |
| octolytics-dimension-repository_id | 50692237 |
| octolytics-dimension-repository_nwo | bloomberg/python-github-webhook |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 50692237 |
| octolytics-dimension-repository_network_root_nwo | bloomberg/python-github-webhook |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width