From 5c3425b32b7a382d3b9dfec920e1f1da6da02b3b Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Jan 25 2021 17:12:08 +0000 Subject: web: add comment explaining null start_time values Explain why kojiweb falls back to creation_ts when start_ts is unavailable. Thanks MikeM for the explanation. --- diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py index a85f18c..c838335 100644 --- a/www/kojiweb/index.py +++ b/www/kojiweb/index.py @@ -1300,6 +1300,11 @@ def buildinfo(environ, buildID): if field not in values: values[field] = None + # We added the start_time field in 2015 as part of Koji's content + # generator feature. Builds before that point have a null value for + # start_time. Fall back to creation_ts in those cases. + # Currently new_build() has data.setdefault('start_time', 'NOW'), so all + # recent builds should have a value for the field. values['start_ts'] = build.get('start_ts') or build['creation_ts'] # the build start time is not accurate for maven and win builds, get it from the # task start time instead