Merge "gitlab: an "update" event isn't always a "labeled" action"
This commit is contained in:
commit
e4a199e5eb
|
@ -1867,13 +1867,13 @@ class FakeGitlabMergeRequest(object):
|
|||
'action': action
|
||||
},
|
||||
}
|
||||
data['labels'] = [{'title': label} for label in self.labels]
|
||||
data['changes'] = {}
|
||||
|
||||
if include_labels:
|
||||
data['labels'] = [{'title': label} for label in self.labels]
|
||||
data['changes'] = {
|
||||
'labels': {
|
||||
'previous': [],
|
||||
'current': data['labels']
|
||||
}
|
||||
data['changes']['labels'] = {
|
||||
'previous': [],
|
||||
'current': data['labels']
|
||||
}
|
||||
return (name, data)
|
||||
|
||||
|
|
|
@ -132,9 +132,9 @@ class GitlabEventConnector(threading.Thread):
|
|||
event.action = 'opened'
|
||||
elif attrs['action'] == 'merge':
|
||||
event.action = 'merged'
|
||||
elif attrs['action'] == 'update' and "labels" not in body:
|
||||
elif attrs['action'] == 'update' and "labels" not in body["changes"]:
|
||||
event.action = 'changed'
|
||||
elif attrs['action'] == 'update' and "labels" in body:
|
||||
elif attrs['action'] == 'update' and "labels" in body["changes"]:
|
||||
event.action = 'labeled'
|
||||
previous_labels = [
|
||||
label["title"] for
|
||||
|
|
Loading…
Reference in New Issue