diff options
author | Zuul <zuul@review.opendev.org> | 2021-03-19 18:22:46 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2021-03-19 18:22:46 +0000 |
commit | 597c74aafb2ce7096d73a67190a31f1459d9ddbe (patch) | |
tree | 79840946b5f11bc87d71cea850b65aba128147c4 /zuul/driver/github | |
parent | ba938cadf98546c97341b27e25378ab3d3a1dad9 (diff) | |
parent | 55ac08d3d6ebe9015798e5cbc5a9b34065052bcb (diff) | |
download | zuul-597c74aafb2ce7096d73a67190a31f1459d9ddbe.tar.gz |
Merge "Allow (de-)serialization of trigger events"
Diffstat (limited to 'zuul/driver/github')
-rw-r--r-- | zuul/driver/github/githubmodel.py | 23 |
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'] |