diff options
author | Oliver Stannard <oliver.stannard@linaro.org> | 2021-01-05 10:30:56 +0000 |
---|---|---|
committer | Oliver Stannard <oliver.stannard@linaro.org> | 2021-01-05 10:43:32 +0000 |
commit | 46e9903ddb235ca770cecf8aeacb5eea4e754c19 (patch) | |
tree | ee232b82bf314adceacf3b14b6fae7667a97ceb9 | |
parent | 8473b934cb29e378c1399712d0e768dc7982cd2b (diff) |
[LLVM Monitor] Sort builds by number to find most recent
The data returned by the buildbot looks like it is sorted by build
number, but it isn't actually, so we need to do the sorting ourselves.
Change-Id: Iac0febe60a4d3ac33ae018f708b22b0e37d2009d
-rwxr-xr-x | monitor/bot-status.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/monitor/bot-status.py b/monitor/bot-status.py index 2536fa4..39fcb82 100755 --- a/monitor/bot-status.py +++ b/monitor/bot-status.py @@ -71,7 +71,7 @@ def get_bot_status(session, bot, base_url, builder_url, build_url): builds = contents status = {} - reversed_builds = reversed(builds['builds']) + reversed_builds = iter(sorted(builds['builds'], key=lambda b: -b["number"])) for build in reversed_builds: if build['complete']: status['builderid'] = build['builderid'] |