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

Unified Diff: appengine/findit/waterfall/buildbot.py

Issue 2116073002: [Findit] Fix redirect bug and update template for waterfall/culprit. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Add one unittest. Created 4 years, 5 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
Index: appengine/findit/waterfall/buildbot.py
diff --git a/appengine/findit/waterfall/buildbot.py b/appengine/findit/waterfall/buildbot.py
index 0709671b2cdcc27543316f8ed9e0b12eb7c93096..01ffb61ee4b2fbd59fe5562d17c77456909cdb6d 100644
--- a/appengine/findit/waterfall/buildbot.py
+++ b/appengine/findit/waterfall/buildbot.py
@@ -178,10 +178,16 @@ def GetBuildStartTime(build_data_json):
times = build_data_json.get('times')
if not times:
return None
- # TODO: convert to PST time?
return datetime.utcfromtimestamp(times[0])
+def GetBuildEndTime(build_data_json):
+ times = build_data_json.get('times')
+ if not times or len(times) < 2 or not times[1]:
+ return None
+ return datetime.utcfromtimestamp(times[1])
+
+
def GetBuildResult(build_data_json):
return build_data_json.get('results')
@@ -195,6 +201,7 @@ def ExtractBuildInfo(master_name, builder_name, build_number, build_data):
data_json.get('properties', []), 'got_revision')
build_info.build_start_time = GetBuildStartTime(data_json)
+ build_info.build_end_time = GetBuildEndTime(data_json)
build_info.chromium_revision = chromium_revision
build_info.completed = data_json.get('currentStep') is None
build_info.result = GetBuildResult(data_json)
« no previous file with comments | « appengine/findit/waterfall/build_util.py ('k') | appengine/findit/waterfall/send_notification_for_culprit_pipeline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698