OLD | NEW |
1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
4 | 4 |
5 """Task execution result models. | 5 """Task execution result models. |
6 | 6 |
7 This module doesn't do the scheduling itself. It only describes the entities to | 7 This module doesn't do the scheduling itself. It only describes the entities to |
8 store tasks results. | 8 store tasks results. |
9 | 9 |
10 - TaskResultSummary represents the overall result for the TaskRequest taking in | 10 - TaskResultSummary represents the overall result for the TaskRequest taking in |
11 account retries. | 11 account retries. |
12 - TaskRunResult represents the result for one 'try'. There can | 12 - TaskRunResult represents the result for one 'try'. There can |
13 be multiple tries for one job, for example if a bot dies. | 13 be multiple tries for one job, for example if a bot dies. |
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 if tags: | 1229 if tags: |
1230 # Add TaskResultSummary indexes if desired. | 1230 # Add TaskResultSummary indexes if desired. |
1231 if sort != 'created_ts': | 1231 if sort != 'created_ts': |
1232 raise ValueError( | 1232 raise ValueError( |
1233 'Add needed indexes for sort:%s and tags if desired' % sort) | 1233 'Add needed indexes for sort:%s and tags if desired' % sort) |
1234 tags_filter = TaskResultSummary.tags == tags[0] | 1234 tags_filter = TaskResultSummary.tags == tags[0] |
1235 for tag in tags[1:]: | 1235 for tag in tags[1:]: |
1236 tags_filter = ndb.AND(tags_filter, TaskResultSummary.tags == tag) | 1236 tags_filter = ndb.AND(tags_filter, TaskResultSummary.tags == tag) |
1237 query = query.filter(tags_filter) | 1237 query = query.filter(tags_filter) |
1238 return _filter_query(TaskResultSummary, query, start, end, sort, state) | 1238 return _filter_query(TaskResultSummary, query, start, end, sort, state) |
OLD | NEW |