)]}'
{"zuul/driver/sql/sqlconnection.py":[{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"b77d8fc9af0e2164e4be31e01d7db7261935f17e","unresolved":false,"context_lines":[{"line_number":359,"context_line":"            def duration(self):"},{"line_number":360,"context_line":"                if self.start_time and self.end_time:"},{"line_number":361,"context_line":"                    return (self.end_time -"},{"line_number":362,"context_line":"                            self.start_time).total_seconds()"},{"line_number":363,"context_line":"                else:"},{"line_number":364,"context_line":"                    return None"},{"line_number":365,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"c78a0234_b79ec8ca","line":362,"updated":"2021-09-14 22:09:55.000000000","message":"Good point, this was copy-pasta from code that didn\u0027t anticipate multiple actors.","commit_id":"635c06820085d649791462af77f38a234cdd7c13"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"4e3059771d7f23717bf3b95a564ea8b2ad23c657","unresolved":true,"context_lines":[{"line_number":359,"context_line":"            def duration(self):"},{"line_number":360,"context_line":"                if self.start_time and self.end_time:"},{"line_number":361,"context_line":"                    return (self.end_time -"},{"line_number":362,"context_line":"                            self.start_time).total_seconds()"},{"line_number":363,"context_line":"                else:"},{"line_number":364,"context_line":"                    return None"},{"line_number":365,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"aeed4dbc_5acd0e8c","line":362,"updated":"2021-09-14 22:00:38.000000000","message":"Should you return a min value of 0 here just in case the clocks get skewed away from each other?","commit_id":"635c06820085d649791462af77f38a234cdd7c13"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"bba2e3e42b0d350177033a22062b42fd43b41d84","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                     uuid, buildset_id)"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"            @property"},{"line_number":384,"context_line":"            def duration(self):"},{"line_number":385,"context_line":"                if self.start_time and self.end_time:"},{"line_number":386,"context_line":"                    return max(0.0,"},{"line_number":387,"context_line":"                               (self.end_time -"}],"source_content_type":"text/x-python","patch_set":8,"id":"d175aa85_a4c7cde0","line":384,"updated":"2021-09-20 19:06:54.000000000","message":"Correct.  We could get rid of it.","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"0b2138ee4b54880c69f5fa1693a81fe000432b8b","unresolved":true,"context_lines":[{"line_number":381,"context_line":"                     uuid, buildset_id)"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"            @property"},{"line_number":384,"context_line":"            def duration(self):"},{"line_number":385,"context_line":"                if self.start_time and self.end_time:"},{"line_number":386,"context_line":"                    return max(0.0,"},{"line_number":387,"context_line":"                               (self.end_time -"}],"source_content_type":"text/x-python","patch_set":8,"id":"b4272fcb_a5454ac2","line":384,"updated":"2021-09-20 18:54:47.000000000","message":"This code doesn\u0027t appear to be used anymore?","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"2b287f0cf7675f648cf2056e1234e31884c6689e","unresolved":false,"context_lines":[{"line_number":497,"context_line":"                return None"},{"line_number":498,"context_line":"            times \u003d [t.t0, t.t1, t.t2, t.t3, t.t4,"},{"line_number":499,"context_line":"                     t.t5, t.t6, t.t7, t.t8, t.t9]"},{"line_number":500,"context_line":"            times \u003d [x for x in times if x is not None]"},{"line_number":501,"context_line":"            if len(times):"},{"line_number":502,"context_line":"                return int(sum(times) / len(times))"},{"line_number":503,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":8,"id":"2c6efcc4_c4696ade","line":500,"updated":"2021-09-20 20:28:10.000000000","message":"For posterity:\n* list comprehension is a little faster than filter(lambda) (probably not enough to worry about in most cases)\n* filter(None) is *much faster* than list comprehension, but filters out 0 which would be wrong here.  Worth using in other cases where it would be correct.","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"0b2138ee4b54880c69f5fa1693a81fe000432b8b","unresolved":true,"context_lines":[{"line_number":497,"context_line":"                return None"},{"line_number":498,"context_line":"            times \u003d [t.t0, t.t1, t.t2, t.t3, t.t4,"},{"line_number":499,"context_line":"                     t.t5, t.t6, t.t7, t.t8, t.t9]"},{"line_number":500,"context_line":"            times \u003d [x for x in times if x is not None]"},{"line_number":501,"context_line":"            if len(times):"},{"line_number":502,"context_line":"                return int(sum(times) / len(times))"},{"line_number":503,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":8,"id":"f4387306_b2ca0685","line":500,"updated":"2021-09-20 18:54:47.000000000","message":"This could be replaced with https://docs.python.org/3/library/functions.html#filter but is equivalent. Not sure if filter might have a quicker internal implementation thoughl","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"bba2e3e42b0d350177033a22062b42fd43b41d84","unresolved":false,"context_lines":[{"line_number":497,"context_line":"                return None"},{"line_number":498,"context_line":"            times \u003d [t.t0, t.t1, t.t2, t.t3, t.t4,"},{"line_number":499,"context_line":"                     t.t5, t.t6, t.t7, t.t8, t.t9]"},{"line_number":500,"context_line":"            times \u003d [x for x in times if x is not None]"},{"line_number":501,"context_line":"            if len(times):"},{"line_number":502,"context_line":"                return int(sum(times) / len(times))"},{"line_number":503,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":8,"id":"2f8835f7_b7060dcf","line":500,"updated":"2021-09-20 19:06:54.000000000","message":"filter/map have been available in Python since 1.5.2, at least.  I remember when list comprehensions were touted as far superior for readability.  Here\u0027s a blast from the past: \n\n  https://www.oreilly.com/library/view/python-cookbook/0596001673/ch01s11.html\n\nAnyway, it probably suffices to say I\u0027m aware of filter and this was a deliberate choice.  We can all handle reading both forms, and we probably don\u0027t need to nitpick it?","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"7692ae5370c79ac77e40c7785785a77c44c61445","unresolved":false,"context_lines":[{"line_number":497,"context_line":"                return None"},{"line_number":498,"context_line":"            times \u003d [t.t0, t.t1, t.t2, t.t3, t.t4,"},{"line_number":499,"context_line":"                     t.t5, t.t6, t.t7, t.t8, t.t9]"},{"line_number":500,"context_line":"            times \u003d [x for x in times if x is not None]"},{"line_number":501,"context_line":"            if len(times):"},{"line_number":502,"context_line":"                return int(sum(times) / len(times))"},{"line_number":503,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":8,"id":"c6bdfc48_ef66ca83","line":500,"in_reply_to":"2f8835f7_b7060dcf","updated":"2021-09-20 19:11:11.000000000","message":"Huh I vastly prefer the functional methods because they have well defined behaviors. But I can understand if others prefer comprehensions because they are more explicitly written out.\n\nI only mentioned it here because I wasn\u0027t sure of the performance equivalence (they are functionally equivalent). Didn\u0027t meant to nitpick but noticed since sum was used below.","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"bba2e3e42b0d350177033a22062b42fd43b41d84","unresolved":false,"context_lines":[{"line_number":499,"context_line":"                     t.t5, t.t6, t.t7, t.t8, t.t9]"},{"line_number":500,"context_line":"            times \u003d [x for x in times if x is not None]"},{"line_number":501,"context_line":"            if len(times):"},{"line_number":502,"context_line":"                return int(sum(times) / len(times))"},{"line_number":503,"context_line":"            return None"},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    def addTime(self, tenant, project, branch, job_name, elapsed):"}],"source_content_type":"text/x-python","patch_set":8,"id":"774d71f4_0074ea06","line":502,"updated":"2021-09-20 19:06:54.000000000","message":"My thought was to have this object deal consistently with integers rather than have an outlier here.","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"0b2138ee4b54880c69f5fa1693a81fe000432b8b","unresolved":true,"context_lines":[{"line_number":499,"context_line":"                     t.t5, t.t6, t.t7, t.t8, t.t9]"},{"line_number":500,"context_line":"            times \u003d [x for x in times if x is not None]"},{"line_number":501,"context_line":"            if len(times):"},{"line_number":502,"context_line":"                return int(sum(times) / len(times))"},{"line_number":503,"context_line":"            return None"},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    def addTime(self, tenant, project, branch, job_name, elapsed):"}],"source_content_type":"text/x-python","patch_set":8,"id":"8abeb16c_959a1e57","line":502,"updated":"2021-09-20 18:54:47.000000000","message":"We convert this back to a float when we use it. Would it be better to return a float here and not bother with the translation in the scheduler?","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"}],"zuul/driver/sql/sqlreporter.py":[{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"d42b1d18e1d6d85210c09b0c7f012a87209ed1cd","unresolved":true,"context_lines":[{"line_number":141,"context_line":"            else:"},{"line_number":142,"context_line":"                elapsed \u003d None"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        if (final and build.result \u003d\u003d \u0027SUCCES\u0027 and elapsed is not None):"},{"line_number":145,"context_line":"            buildset \u003d build.build_set"},{"line_number":146,"context_line":"            try:"},{"line_number":147,"context_line":"                self.connection.addTime("}],"source_content_type":"text/x-python","patch_set":7,"id":"a95e0112_b128f5c6","line":144,"updated":"2021-09-18 06:05:36.000000000","message":"typo: SUCCESS","commit_id":"2ad60a00ae2300ed2e134db9e805d4d42044be21"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"0b2138ee4b54880c69f5fa1693a81fe000432b8b","unresolved":true,"context_lines":[{"line_number":137,"context_line":"                elapsed \u003d int("},{"line_number":138,"context_line":"                    calendar.timegm(db_build.end_time.utctimetuple()) -"},{"line_number":139,"context_line":"                    calendar.timegm(db_build.start_time.utctimetuple())"},{"line_number":140,"context_line":"                )"},{"line_number":141,"context_line":"            else:"},{"line_number":142,"context_line":"                elapsed \u003d None"},{"line_number":143,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"d29f60ad_35c08886","line":140,"updated":"2021-09-20 18:54:47.000000000","message":"As mentioned on a previous patchset do we need to guard against negative elapsed times? We know it is at least 0?","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"bba2e3e42b0d350177033a22062b42fd43b41d84","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                elapsed \u003d int("},{"line_number":138,"context_line":"                    calendar.timegm(db_build.end_time.utctimetuple()) -"},{"line_number":139,"context_line":"                    calendar.timegm(db_build.start_time.utctimetuple())"},{"line_number":140,"context_line":"                )"},{"line_number":141,"context_line":"            else:"},{"line_number":142,"context_line":"                elapsed \u003d None"},{"line_number":143,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"f7f9f4cf_3716ad0c","line":140,"updated":"2021-09-20 19:06:54.000000000","message":"It would be good to add that here, yes.","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"0b2138ee4b54880c69f5fa1693a81fe000432b8b","unresolved":true,"context_lines":[{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        return db_build"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    def getBuilds(self, *args, **kw):"},{"line_number":159,"context_line":"        \"\"\"Return a list of Build objects\"\"\""},{"line_number":160,"context_line":"        return self.connection.getBuilds(*args, **kw)"},{"line_number":161,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"12d50926_1d8beaf8","line":158,"updated":"2021-09-20 18:54:47.000000000","message":"I don\u0027t think this method is used.","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"bba2e3e42b0d350177033a22062b42fd43b41d84","unresolved":false,"context_lines":[{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        return db_build"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    def getBuilds(self, *args, **kw):"},{"line_number":159,"context_line":"        \"\"\"Return a list of Build objects\"\"\""},{"line_number":160,"context_line":"        return self.connection.getBuilds(*args, **kw)"},{"line_number":161,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"0a1b29d1_5d599a35","line":158,"updated":"2021-09-20 19:06:54.000000000","message":"Probably not, I can remove it.","commit_id":"debed8ca252069e7b12424b3080d6d477b29bfcb"}],"zuul/lib/times.py":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"675625f866f21157e2e761a2622e0b655b555251","unresolved":true,"context_lines":[{"line_number":57,"context_line":"        while self.running:"},{"line_number":58,"context_line":"            key \u003d self.queue.get()"},{"line_number":59,"context_line":"            if key is None:"},{"line_number":60,"context_line":"                continue"},{"line_number":61,"context_line":"            try:"},{"line_number":62,"context_line":"                # Double check that we haven\u0027t added this key since it"},{"line_number":63,"context_line":"                # was requested"}],"source_content_type":"text/x-python","patch_set":12,"id":"40e84a37_7fe0d50d","line":60,"updated":"2021-09-28 20:33:14.000000000","message":"This appears to be our stop signal. Should we break instead of continuing?","commit_id":"7d7d2f9f2ace827ae1976ae2f8f54e99c7848fef"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"e5ab96c259d83563646c6754f83b35dc7b102e6d","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        while self.running:"},{"line_number":58,"context_line":"            key \u003d self.queue.get()"},{"line_number":59,"context_line":"            if key is None:"},{"line_number":60,"context_line":"                continue"},{"line_number":61,"context_line":"            try:"},{"line_number":62,"context_line":"                # Double check that we haven\u0027t added this key since it"},{"line_number":63,"context_line":"                # was requested"}],"source_content_type":"text/x-python","patch_set":12,"id":"4937df15_abb35699","line":60,"updated":"2021-09-28 20:37:52.000000000","message":"Well, self.running should be false and it\u0027ll exit.  We\u0027re not taking advantage of it now, but I think of the None queue item as just a signal to get out of the \u0027get\u0027 call.  There\u0027s no other signal but \u0027stop\u0027 now, but there could be.","commit_id":"7d7d2f9f2ace827ae1976ae2f8f54e99c7848fef"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"28782b95c11442bf817efa6c76e64de93c6072f8","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        while self.running:"},{"line_number":58,"context_line":"            key \u003d self.queue.get()"},{"line_number":59,"context_line":"            if key is None:"},{"line_number":60,"context_line":"                continue"},{"line_number":61,"context_line":"            try:"},{"line_number":62,"context_line":"                # Double check that we haven\u0027t added this key since it"},{"line_number":63,"context_line":"                # was requested"}],"source_content_type":"text/x-python","patch_set":12,"id":"163ed67d_fc99ede0","line":60,"in_reply_to":"4937df15_abb35699","updated":"2021-09-28 20:39:36.000000000","message":"Got it.","commit_id":"7d7d2f9f2ace827ae1976ae2f8f54e99c7848fef"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"e5ab96c259d83563646c6754f83b35dc7b102e6d","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            result\u003d\u0027SUCCESS\u0027,"},{"line_number":80,"context_line":"            limit\u003d10,"},{"line_number":81,"context_line":"            sort_by_buildset\u003dTrue)"},{"line_number":82,"context_line":"        times \u003d [x.duration for x in previous_builds if x.duration]"},{"line_number":83,"context_line":"        if times:"},{"line_number":84,"context_line":"            estimate \u003d float(sum(times)) / len(times)"},{"line_number":85,"context_line":"            self.cache.setdefault(key, estimate)"}],"source_content_type":"text/x-python","patch_set":12,"id":"a440c134_edc2b8ba","line":82,"updated":"2021-09-28 20:37:52.000000000","message":"Maybe?  But duration\u003d0 builds probably have something wrong with them anyway.","commit_id":"7d7d2f9f2ace827ae1976ae2f8f54e99c7848fef"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"675625f866f21157e2e761a2622e0b655b555251","unresolved":true,"context_lines":[{"line_number":79,"context_line":"            result\u003d\u0027SUCCESS\u0027,"},{"line_number":80,"context_line":"            limit\u003d10,"},{"line_number":81,"context_line":"            sort_by_buildset\u003dTrue)"},{"line_number":82,"context_line":"        times \u003d [x.duration for x in previous_builds if x.duration]"},{"line_number":83,"context_line":"        if times:"},{"line_number":84,"context_line":"            estimate \u003d float(sum(times)) / len(times)"},{"line_number":85,"context_line":"            self.cache.setdefault(key, estimate)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1990c644_5e740731","line":82,"range":{"start_line":82,"start_character":53,"end_line":82,"end_character":66},"updated":"2021-09-28 20:33:14.000000000","message":"Should this be:\n\n  if x.duration is not None\n\n?","commit_id":"7d7d2f9f2ace827ae1976ae2f8f54e99c7848fef"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"28782b95c11442bf817efa6c76e64de93c6072f8","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            result\u003d\u0027SUCCESS\u0027,"},{"line_number":80,"context_line":"            limit\u003d10,"},{"line_number":81,"context_line":"            sort_by_buildset\u003dTrue)"},{"line_number":82,"context_line":"        times \u003d [x.duration for x in previous_builds if x.duration]"},{"line_number":83,"context_line":"        if times:"},{"line_number":84,"context_line":"            estimate \u003d float(sum(times)) / len(times)"},{"line_number":85,"context_line":"            self.cache.setdefault(key, estimate)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9c687dbe_c73c738a","line":82,"in_reply_to":"a440c134_edc2b8ba","updated":"2021-09-28 20:39:36.000000000","message":"I brought it up due to our testing of any() and list comprehensions previously. Don\u0027t feel super strongly about it.","commit_id":"7d7d2f9f2ace827ae1976ae2f8f54e99c7848fef"}]}
