Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(876)

Unified Diff: appengine/chromium_rietveld/codereview/models.py

Issue 2123093009: Rietveld: add CQ status URL instead of comment. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/chromium_rietveld/codereview/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/chromium_rietveld/codereview/models.py
diff --git a/appengine/chromium_rietveld/codereview/models.py b/appengine/chromium_rietveld/codereview/models.py
index 1c23e349f47a166f74011ba85df4a7a293695ebf..98ca609867fa144a993eaf3c24e8a5d9b7bc871a 100644
--- a/appengine/chromium_rietveld/codereview/models.py
+++ b/appengine/chromium_rietveld/codereview/models.py
@@ -504,6 +504,27 @@ class Issue(ndb.Model):
return datetime.datetime.now() - landed
return None
+ def update_cq_status_url_if_any(self, cq_message):
+ """Parses the cq_message for CQ status url and updates corresponding
+ patchset with it.
+ """
+ url, issue_num, patchset_num = utils.parse_cq_status_url_message(cq_message)
+ if not url:
+ return
+ if self.key.id() != issue_num:
+ logging.error('CQ posted CQ Status URL %s to the wrong issue %s',
+ url, self.key.id())
+ return
+ for patchset in self.patchsets:
+ if patchset.key.id() == patchset_num:
+ patchset.cq_status_url = url
+ patchset.put()
+ logging.info('saved cq_status_url %s to patchset %s', url, patchset.key)
+ return
+ logging.error('CQ posted CQ Status URL %s with unrecognized patchset %s',
+ url, patchset_num)
+
+
def can_skip_checks_on_revert(landed_age):
"""Returns whether CQ checks on revert can be skipped."""
@@ -666,6 +687,7 @@ class PatchSet(ndb.Model):
build_results = ndb.StringProperty(repeated=True)
depends_on_patchset = ndb.StringProperty()
dependent_patchsets = ndb.StringProperty(repeated=True)
+ cq_status_url = ndb.StringProperty()
@property
def depends_on_tokens(self):
« no previous file with comments | « no previous file | appengine/chromium_rietveld/codereview/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698