summaryrefslogtreecommitdiff
path: root/zuul/driver/github
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-03-19 18:22:46 +0000
committerGerrit Code Review <review@openstack.org>2021-03-19 18:22:46 +0000
commit597c74aafb2ce7096d73a67190a31f1459d9ddbe (patch)
tree79840946b5f11bc87d71cea850b65aba128147c4 /zuul/driver/github
parentba938cadf98546c97341b27e25378ab3d3a1dad9 (diff)
parent55ac08d3d6ebe9015798e5cbc5a9b34065052bcb (diff)
downloadzuul-597c74aafb2ce7096d73a67190a31f1459d9ddbe.tar.gz
Merge "Allow (de-)serialization of trigger events"
Diffstat (limited to 'zuul/driver/github')
-rw-r--r--zuul/driver/github/githubmodel.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/zuul/driver/github/githubmodel.py b/zuul/driver/github/githubmodel.py
index 433141ec1..cc4ca747d 100644
--- a/zuul/driver/github/githubmodel.py
+++ b/zuul/driver/github/githubmodel.py
@@ -78,6 +78,29 @@ class GithubTriggerEvent(TriggerEvent):
self.status = None
self.commits = []
+ def toDict(self):
+ d = super().toDict()
+ d["title"] = self.title
+ d["label"] = self.label
+ d["unlabel"] = self.unlabel
+ d["action"] = self.action
+ d["delivery"] = self.delivery
+ d["check_run"] = self.check_run
+ d["status"] = self.status
+ d["commits"] = self.commits
+ return d
+
+ def updateFromDict(self, d):
+ super().updateFromDict(d)
+ self.title = d["title"]
+ self.label = d["label"]
+ self.unlabel = d["unlabel"]
+ self.action = d["action"]
+ self.delivery = d["delivery"]
+ self.check_run = d["check_run"]
+ self.status = d["status"]
+ self.commits = d["commits"]
+
def isPatchsetCreated(self):
if self.type == 'pull_request':
return self.action in ['opened', 'changed']