Make lkgr builder detect recovers from transient build failures.

For each builder, group builds into buckets by commit id, then sort
each bucket by update time, then take only the latest build in each
bucket.

The explicit sorting by update time instead of start time was
suggested by jetski to better handle scheduled builds, which have no
start time yet, makes sense to me.

Change-Id: I8bcb6b96c96c4286b2a91243b41475fc54da141a
Reviewed-on: https://dart-review.googlesource.com/c/recipes/+/501060
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
1 file changed