 Chromium Code Reviews
 Chromium Code Reviews Issue 2267363004:
  Add CIPD pin reporting to swarming.  (Closed) 
  Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
    
  
    Issue 2267363004:
  Add CIPD pin reporting to swarming.  (Closed) 
  Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master| Index: appengine/swarming/server/task_result.py | 
| diff --git a/appengine/swarming/server/task_result.py b/appengine/swarming/server/task_result.py | 
| index b905db0cb14a90cdc7ef7c361d44232f105af5cd..f427345398fc4268ef8fddbe6506aaf010beee64 100644 | 
| --- a/appengine/swarming/server/task_result.py | 
| +++ b/appengine/swarming/server/task_result.py | 
| @@ -58,6 +58,7 @@ Graph of schema: | 
| +---------------+ +---------------+ | 
| """ | 
| +import collections | 
| import datetime | 
| import logging | 
| import random | 
| @@ -306,6 +307,21 @@ class PerformanceStats(ndb.Model): | 
| 'PerformanceStats.bot_overhead is required') | 
| +class CipdPins(ndb.Model): | 
| + """Specifies which CIPD client and packages were actually installed. | 
| + | 
| + A part of TaskRunResult. | 
| 
M-A Ruel
2016/08/26 23:19:51
This is misleading, since this is in TaskResultSum
 
iannucci
2016/08/29 22:08:40
erp, sorry.
 | 
| + """ | 
| + # CIPD package of CIPD client to use. | 
| + # client_package.package_name and version are provided. | 
| + # client_package.path will be None. | 
| + client_package = ndb.LocalStructuredProperty(task_request.CipdPackage) | 
| + | 
| + # List of packages to install in $CIPD_PATH prior task execution. | 
| + packages = ndb.LocalStructuredProperty(task_request.CipdPackage, | 
| 
M-A Ruel
2016/08/26 23:19:51
I'd like the entities to be sorted the same way th
 
iannucci
2016/08/29 22:08:40
yep, absolutely true, don't know what I was thinki
 
M-A Ruel
2016/08/30 02:18:07
Yes, so the check will have to be done in a valida
 | 
| + repeated=True) | 
| + | 
| + | 
| class _TaskResultCommon(ndb.Model): | 
| """Contains properties that is common to both TaskRunResult and | 
| TaskResultSummary. | 
| @@ -373,6 +389,9 @@ class _TaskResultCommon(ndb.Model): | 
| # set. The isolateserver and namespace should match. | 
| outputs_ref = ndb.LocalStructuredProperty(task_request.FilesRef) | 
| + # The pinned versions of all the CIPD packages used in the task. | 
| + cipd_pins = ndb.LocalStructuredProperty(CipdPins) | 
| + | 
| @property | 
| def can_be_canceled(self): | 
| """Returns True if the task is in a state that can be canceled.""" | 
| @@ -782,6 +801,7 @@ class TaskResultSummary(_TaskResultCommon): | 
| def reset_to_pending(self): | 
| """Resets this entity to pending state.""" | 
| + self.cipd_pins = None | 
| self.duration = None | 
| self.exit_code = None | 
| self.internal_failure = False |