OLD | NEW |
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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 issue_key = ndb.KeyProperty(name='issue', kind=Issue) # == parent | 606 issue_key = ndb.KeyProperty(name='issue', kind=Issue) # == parent |
607 message = ndb.StringProperty() | 607 message = ndb.StringProperty() |
608 data = ndb.BlobProperty() | 608 data = ndb.BlobProperty() |
609 url = ndb.StringProperty() | 609 url = ndb.StringProperty() |
610 created = ndb.DateTimeProperty(auto_now_add=True) | 610 created = ndb.DateTimeProperty(auto_now_add=True) |
611 modified = ndb.DateTimeProperty(auto_now=True) | 611 modified = ndb.DateTimeProperty(auto_now=True) |
612 n_comments = ndb.IntegerProperty(default=0) | 612 n_comments = ndb.IntegerProperty(default=0) |
613 # TODO(maruel): Deprecated, remove once the live instance has all its data | 613 # TODO(maruel): Deprecated, remove once the live instance has all its data |
614 # converted to TryJobResult instances. | 614 # converted to TryJobResult instances. |
615 build_results = ndb.StringProperty(repeated=True) | 615 build_results = ndb.StringProperty(repeated=True) |
| 616 depends_on_patchset = ndb.StringProperty() |
| 617 dependent_patchsets = ndb.StringProperty(repeated=True) |
616 | 618 |
617 @property | 619 @property |
618 def num_patches(self): | 620 def num_patches(self): |
619 """Return the number of patches in this patchset.""" | 621 """Return the number of patches in this patchset.""" |
620 return Patch.query(ancestor=self.key).count( | 622 return Patch.query(ancestor=self.key).count( |
621 settings.MAX_PATCHES_PER_PATCHSET) | 623 settings.MAX_PATCHES_PER_PATCHSET) |
622 | 624 |
623 @property | 625 @property |
624 def patches(self): | 626 def patches(self): |
625 def reading_order(patch): | 627 def reading_order(patch): |
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1829 out.issues = sum((i.issues for i in items), []) | 1831 out.issues = sum((i.issues for i in items), []) |
1830 out.latencies = sum((i.latencies for i in items), []) | 1832 out.latencies = sum((i.latencies for i in items), []) |
1831 out.lgtms = sum((i.lgtms for i in items), []) | 1833 out.lgtms = sum((i.lgtms for i in items), []) |
1832 out.review_types = sum((i.review_types for i in items), []) | 1834 out.review_types = sum((i.review_types for i in items), []) |
1833 out.score = compute_score(out) | 1835 out.score = compute_score(out) |
1834 return ( | 1836 return ( |
1835 prev_issues != out.issues or | 1837 prev_issues != out.issues or |
1836 prev_latencies != out.latencies or | 1838 prev_latencies != out.latencies or |
1837 prev_lgtms != out.lgtms or | 1839 prev_lgtms != out.lgtms or |
1838 prev_review_types != out.review_types) | 1840 prev_review_types != out.review_types) |
OLD | NEW |