@@ -1501,8 +1501,8 @@ def v4_global_status():
1501
1501
yesterday = latest_date - datetime .timedelta (days = 1 )
1502
1502
1503
1503
# Get arguments.
1504
- revision = int ( request .args .get ('revision' ,
1505
- ts .Machine .DEFAULT_BASELINE_REVISION ))
1504
+ revision = request .args .get ('revision' ,
1505
+ str ( ts .Machine .DEFAULT_BASELINE_REVISION ))
1506
1506
field = fields .get (request .args .get ('field' , None ), metric_fields [0 ])
1507
1507
1508
1508
# Get the list of all runs we might be interested in.
@@ -1539,8 +1539,8 @@ def get_machine_keys(m):
1539
1539
runs = recent_runs_by_machine [machine ]
1540
1540
1541
1541
# Get the baseline run for this machine.
1542
- baseline = machine .get_closest_previously_reported_run (session ,
1543
- revision )
1542
+ baseline = machine .get_closest_previously_reported_run (
1543
+ session , ts . Order ( llvm_project_revision = revision ) )
1544
1544
1545
1545
# Choose the "best" run to report on. We want the most recent one with
1546
1546
# the most recent order.
@@ -1550,6 +1550,9 @@ def get_machine_keys(m):
1550
1550
reported_run_ids .append (baseline .id )
1551
1551
reported_run_ids .append (run .id )
1552
1552
1553
+ if not machine_run_info :
1554
+ abort (404 , "No closest runs for revision '{}'" .format (revision ))
1555
+
1553
1556
# Get the set all tests reported in the recent runs.
1554
1557
reported_tests = session .query (ts .Test .id , ts .Test .name ).filter (
1555
1558
sqlalchemy .sql .exists ('*' , sqlalchemy .sql .and_ (
@@ -1570,7 +1573,7 @@ def get_machine_keys(m):
1570
1573
# Compute comparison results for each machine.
1571
1574
row .extend ((runinfo .get_run_comparison_result (
1572
1575
run , baseline , test_id , field ,
1573
- ts .Sample .get_hash_of_binary_field ),
1576
+ ts .Sample .get_hash_of_binary_field () ),
1574
1577
run .id )
1575
1578
for baseline , run in machine_run_info )
1576
1579
@@ -1582,7 +1585,7 @@ def get_machine_keys(m):
1582
1585
test_table .append (row )
1583
1586
1584
1587
# Order the table by worst regression.
1585
- test_table .sort (key = lambda row : 0 if row [ 1 ] is None else row [1 ], reverse = True )
1588
+ test_table .sort (key = lambda row : row [1 ], reverse = True )
1586
1589
1587
1590
return render_template ("v4_global_status.html" ,
1588
1591
tests = test_table ,
@@ -1805,13 +1808,6 @@ def health():
1805
1808
1806
1809
@v4_route ("/search" )
1807
1810
def v4_search ():
1808
- def _isint (i ):
1809
- try :
1810
- int (i )
1811
- return True
1812
- except Exception :
1813
- return False
1814
-
1815
1811
session = request .session
1816
1812
ts = request .get_testsuite ()
1817
1813
query = request .args .get ('q' )
0 commit comments