From 3b5b658f3ca6284c87dc14ebbdf951d5e9e8c1e3 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 15 Sep 2016 14:20:40 +0200 Subject: [PATCH] Fixing gogs integration --- taiga/hooks/gogs/event_hooks.py | 2 +- tests/integration/test_hooks_gogs.py | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/taiga/hooks/gogs/event_hooks.py b/taiga/hooks/gogs/event_hooks.py index 8e68b8db..b392afe2 100644 --- a/taiga/hooks/gogs/event_hooks.py +++ b/taiga/hooks/gogs/event_hooks.py @@ -37,7 +37,7 @@ class PushEventHook(BaseGogsEventHook, BasePushEventHook): def get_data(self): result = [] commits = self.payload.get("commits", []) - project_url = self.payload.get("repository", {}).get("url", None) + project_url = self.payload.get("repository", {}).get("html_url", None) for commit in filter(None, commits): user_name = commit.get('author', {}).get('username', None) diff --git a/tests/integration/test_hooks_gogs.py b/tests/integration/test_hooks_gogs.py index 46c33dd9..11685d1a 100644 --- a/tests/integration/test_hooks_gogs.py +++ b/tests/integration/test_hooks_gogs.py @@ -105,7 +105,7 @@ def test_push_event_detected(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } @@ -140,7 +140,7 @@ def test_push_event_epic_processing(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } mail.outbox = [] @@ -170,7 +170,7 @@ def test_push_event_issue_processing(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } mail.outbox = [] @@ -200,7 +200,7 @@ def test_push_event_task_processing(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } mail.outbox = [] @@ -230,7 +230,7 @@ def test_push_event_user_story_processing(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } @@ -261,7 +261,7 @@ def test_push_event_issue_mention(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } mail.outbox = [] @@ -292,7 +292,7 @@ def test_push_event_task_mention(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } mail.outbox = [] @@ -323,7 +323,7 @@ def test_push_event_user_story_mention(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } @@ -357,7 +357,7 @@ def test_push_event_multiple_actions(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } mail.outbox = [] @@ -389,7 +389,7 @@ def test_push_event_processing_case_insensitive(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } mail.outbox = [] @@ -415,7 +415,7 @@ def test_push_event_task_bad_processing_non_existing_ref(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } mail.outbox = [] @@ -443,7 +443,7 @@ def test_push_event_us_bad_processing_non_existing_status(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } @@ -472,7 +472,7 @@ def test_push_event_bad_processing_non_existing_status(client): } ], "repository": { - "url": "http://test-url/test/project" + "html_url": "http://test-url/test/project" } } @@ -511,7 +511,7 @@ def test_api_patch_project_modules(client): data = { "gogs": { "secret": "test_secret", - "url": "test_url", + "html_url": "test_url", } } response = client.patch(url, json.dumps(data), content_type="application/json")