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

Unified Diff: appengine/swarming/handlers_frontend.py

Issue 2267363004: Add CIPD pin reporting to swarming. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: Fix bottest Created 4 years, 4 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 | « appengine/swarming/handlers_bot_test.py ('k') | appengine/swarming/message_conversion.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/handlers_frontend.py
diff --git a/appengine/swarming/handlers_frontend.py b/appengine/swarming/handlers_frontend.py
index 158d74e69cf2a76feb3f490e776fd3193791e53c..22088e7f4fb0642f6ffa0cc46532355bd2d7210e 100644
--- a/appengine/swarming/handlers_frontend.py
+++ b/appengine/swarming/handlers_frontend.py
@@ -616,6 +616,17 @@ class BaseTaskHandler(auth.AuthenticatingHandler):
class TaskHandler(BaseTaskHandler):
"""Show the full text of a task request and its result."""
+ @staticmethod
+ def packages_grouped_by_path(flat_packages):
+ """Returns sorted [(path, [PinInfo, ...])].
+
+ Used by user_task.html.
+ """
+ retval = collections.defaultdict(list)
+ for pkg in flat_packages:
+ retval[pkg.path].append(pkg)
+ return sorted(retval.iteritems())
+
@auth.autologin
@auth.require(acl.is_user)
def get(self, task_id):
@@ -663,9 +674,27 @@ class TaskHandler(BaseTaskHandler):
parent_task = parent_task_future.get_result()
children_tasks = [c.get_result() for c in children_tasks_futures]
+ cipd = None
+ if request.properties.cipd_input:
+ cipd = {
+ 'server': request.properties.cipd_input.server,
+ 'client_package': request.properties.cipd_input.client_package,
+ 'packages': self.packages_grouped_by_path(
+ request.properties.cipd_input.packages),
+ }
+
+ cipd_pins = None
+ if result.cipd_pins:
+ cipd_pins = {
+ 'client_package': result.cipd_pins.client_package,
+ 'packages': self.packages_grouped_by_path(result.cipd_pins.packages),
+ }
+
params = {
'bot': bot_future.get_result() if bot_future else None,
'children_tasks': children_tasks,
+ 'cipd': cipd,
+ 'cipd_pins': cipd_pins,
'is_admin': acl.is_admin(),
'is_gae_admin': users.is_current_user_admin(),
'is_privileged_user': acl.is_privileged_user(),
« no previous file with comments | « appengine/swarming/handlers_bot_test.py ('k') | appengine/swarming/message_conversion.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698