Show More
@@ -118,26 +118,26 b' class EEIntegration(IntegrationTypeBase)' | |||
|
118 | 118 | |
|
119 | 119 | # common vars for url template |
|
120 | 120 | CI_URL_VARS = [ |
|
121 | 'repo_name', | |
|
122 | 'repo_type', | |
|
123 | 'repo_id', | |
|
124 | 'repo_url', | |
|
121 | ('event_name', 'Unique name of the event type, e.g pullrequest-update'), | |
|
122 | ('repo_name', 'Full name of the repository'), | |
|
123 | ('repo_type', 'VCS type of repository'), | |
|
124 | ('repo_id', 'Unique id of repository'), | |
|
125 | ('repo_url', 'Repository url'), | |
|
125 | 126 | # extra repo fields |
|
126 | 'extra:<extra_key_name>', | |
|
127 | ('extra:<extra_key_name>', 'Extra repo variables, read from its settings.'), | |
|
127 | 128 | |
|
128 | 129 | # special attrs below that we handle, using multi-call |
|
129 | 'branch', | |
|
130 | 'commit_id', | |
|
130 | ('branch', 'Name of each brach submitted, if any.'), | |
|
131 | ('commit_id', 'Id of each commit submitted, if any.'), | |
|
131 | 132 | |
|
132 | 133 | # pr events vars |
|
133 | 'pull_request_id', | |
|
134 | 'pull_request_url', | |
|
135 | 'pull_request_shadow_url', | |
|
134 | ('pull_request_id', 'Unique ID of the pull request.'), | |
|
135 | ('pull_request_url', 'Pull request url.'), | |
|
136 | ('pull_request_shadow_url', 'Pull request shadow repo clone url.'), | |
|
136 | 137 | |
|
137 | 138 | # user who triggers the call |
|
138 | 'username', | |
|
139 | 'user_id', | |
|
140 | ||
|
139 | ('username', 'User who triggered the call.'), | |
|
140 | ('user_id', 'User id who triggered the call.'), | |
|
141 | 141 | ] |
|
142 | 142 | |
|
143 | 143 | |
@@ -151,4 +151,4 b' def get_auth(settings):' | |||
|
151 | 151 | |
|
152 | 152 | |
|
153 | 153 | def get_url_vars(url_vars): |
|
154 |
return ', '.join('${' + |
|
|
154 | return ', '.join('${' + key + '}' for key, explanation in url_vars) |
@@ -20,7 +20,7 b'' | |||
|
20 | 20 | |
|
21 | 21 | from __future__ import unicode_literals |
|
22 | 22 | import string |
|
23 | from collections import OrderedDict | |
|
23 | import collections | |
|
24 | 24 | |
|
25 | 25 | import deform |
|
26 | 26 | import deform.widget |
@@ -42,26 +42,26 b' log = logging.getLogger(__name__)' | |||
|
42 | 42 | |
|
43 | 43 | # updating this required to update the `common_vars` passed in url calling func |
|
44 | 44 | WEBHOOK_URL_VARS = [ |
|
45 | 'repo_name', | |
|
46 | 'repo_type', | |
|
47 | 'repo_id', | |
|
48 | 'repo_url', | |
|
45 | ('event_name', 'Unique name of the event type, e.g pullrequest-update'), | |
|
46 | ('repo_name', 'Full name of the repository'), | |
|
47 | ('repo_type', 'VCS type of repository'), | |
|
48 | ('repo_id', 'Unique id of repository'), | |
|
49 | ('repo_url', 'Repository url'), | |
|
49 | 50 | # extra repo fields |
|
50 | 'extra:<extra_key_name>', | |
|
51 | ('extra:<extra_key_name>', 'Extra repo variables, read from its settings.'), | |
|
51 | 52 | |
|
52 | 53 | # special attrs below that we handle, using multi-call |
|
53 | 'branch', | |
|
54 | 'commit_id', | |
|
54 | ('branch', 'Name of each brach submitted, if any.'), | |
|
55 | ('commit_id', 'Id of each commit submitted, if any.'), | |
|
55 | 56 | |
|
56 | 57 | # pr events vars |
|
57 | 'pull_request_id', | |
|
58 | 'pull_request_url', | |
|
59 | 'pull_request_shadow_url', | |
|
58 | ('pull_request_id', 'Unique ID of the pull request.'), | |
|
59 | ('pull_request_url', 'Pull request url.'), | |
|
60 | ('pull_request_shadow_url', 'Pull request shadow repo clone url.'), | |
|
60 | 61 | |
|
61 | 62 | # user who triggers the call |
|
62 | 'username', | |
|
63 | 'user_id', | |
|
64 | ||
|
63 | ('username', 'User who triggered the call.'), | |
|
64 | ('user_id', 'User id who triggered the call.'), | |
|
65 | 65 | ] |
|
66 | 66 | URL_VARS = get_url_vars(WEBHOOK_URL_VARS) |
|
67 | 67 | |
@@ -84,7 +84,8 b' class WebhookHandler(object):' | |||
|
84 | 84 | 'repo_id': data['repo']['repo_id'], |
|
85 | 85 | 'repo_url': data['repo']['url'], |
|
86 | 86 | 'username': data['actor']['username'], |
|
87 | 'user_id': data['actor']['user_id'] | |
|
87 | 'user_id': data['actor']['user_id'], | |
|
88 | 'event_name': data['name'] | |
|
88 | 89 | } |
|
89 | 90 | |
|
90 | 91 | extra_vars = {} |
@@ -98,11 +99,11 b' class WebhookHandler(object):' | |||
|
98 | 99 | def repo_push_event_handler(self, event, data): |
|
99 | 100 | url = self.get_base_parsed_template(data) |
|
100 | 101 | url_cals = [] |
|
101 | branch_data = OrderedDict() | |
|
102 | branch_data = collections.OrderedDict() | |
|
102 | 103 | for obj in data['push']['branches']: |
|
103 | 104 | branch_data[obj['name']] = obj |
|
104 | 105 | |
|
105 | branches_commits = OrderedDict() | |
|
106 | branches_commits = collections.OrderedDict() | |
|
106 | 107 | for commit in data['push']['commits']: |
|
107 | 108 | if commit.get('git_ref_change'): |
|
108 | 109 | # special case for GIT that allows creating tags, |
General Comments 0
You need to be logged in to leave comments.
Login now