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

Side by Side Diff: appengine/chromium_rietveld/codereview/models.py

Issue 1155513002: [Rietveld] Add support for patchset dependencies (Closed) Base URL: https://chromium.googlesource.com/infra/infra@master
Patch Set: Make get_depends_on_patchset return JSON instead of text Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 # Copyright 2008 Google Inc. 1 # Copyright 2008 Google Inc.
2 # 2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); 3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License. 4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at 5 # You may obtain a copy of the License at
6 # 6 #
7 # http://www.apache.org/licenses/LICENSE-2.0 7 # http://www.apache.org/licenses/LICENSE-2.0
8 # 8 #
9 # Unless required by applicable law or agreed to in writing, software 9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, 10 # distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 issue_key = ndb.KeyProperty(name='issue', kind=Issue) # == parent 607 issue_key = ndb.KeyProperty(name='issue', kind=Issue) # == parent
608 message = ndb.StringProperty() 608 message = ndb.StringProperty()
609 data = ndb.BlobProperty() 609 data = ndb.BlobProperty()
610 url = ndb.StringProperty() 610 url = ndb.StringProperty()
611 created = ndb.DateTimeProperty(auto_now_add=True) 611 created = ndb.DateTimeProperty(auto_now_add=True)
612 modified = ndb.DateTimeProperty(auto_now=True) 612 modified = ndb.DateTimeProperty(auto_now=True)
613 n_comments = ndb.IntegerProperty(default=0) 613 n_comments = ndb.IntegerProperty(default=0)
614 # TODO(maruel): Deprecated, remove once the live instance has all its data 614 # TODO(maruel): Deprecated, remove once the live instance has all its data
615 # converted to TryJobResult instances. 615 # converted to TryJobResult instances.
616 build_results = ndb.StringProperty(repeated=True) 616 build_results = ndb.StringProperty(repeated=True)
617 depends_on_patchset = ndb.StringProperty()
618 dependent_patchsets = ndb.StringProperty(repeated=True)
617 619
618 @property 620 @property
619 def num_patches(self): 621 def num_patches(self):
620 """Return the number of patches in this patchset.""" 622 """Return the number of patches in this patchset."""
621 return Patch.query(ancestor=self.key).count( 623 return Patch.query(ancestor=self.key).count(
622 settings.MAX_PATCHES_PER_PATCHSET) 624 settings.MAX_PATCHES_PER_PATCHSET)
623 625
624 @property 626 @property
625 def patches(self): 627 def patches(self):
626 def reading_order(patch): 628 def reading_order(patch):
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1830 out.issues = sum((i.issues for i in items), []) 1832 out.issues = sum((i.issues for i in items), [])
1831 out.latencies = sum((i.latencies for i in items), []) 1833 out.latencies = sum((i.latencies for i in items), [])
1832 out.lgtms = sum((i.lgtms for i in items), []) 1834 out.lgtms = sum((i.lgtms for i in items), [])
1833 out.review_types = sum((i.review_types for i in items), []) 1835 out.review_types = sum((i.review_types for i in items), [])
1834 out.score = compute_score(out) 1836 out.score = compute_score(out)
1835 return ( 1837 return (
1836 prev_issues != out.issues or 1838 prev_issues != out.issues or
1837 prev_latencies != out.latencies or 1839 prev_latencies != out.latencies or
1838 prev_lgtms != out.lgtms or 1840 prev_lgtms != out.lgtms or
1839 prev_review_types != out.review_types) 1841 prev_review_types != out.review_types)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698