[PATCH] D114333: Update graph API to return the original string revision as X values

Pavel Kosov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 21 04:57:11 PST 2021


kpdev42 created this revision.
kpdev42 added reviewers: cmatthews, thopre.
kpdev42 added a project: LLVM.
Herald added a subscriber: dkolesnichenko.
kpdev42 requested review of this revision.

api/db_default/v4/nts/graph is used to request regression points on fly using JS.
We still use convert_revision() for sorting, but return the original (unchanged) values.
It must be done before refactoring to use the library plotly.


Repository:
  rLNT LNT

https://reviews.llvm.org/D114333

Files:
  lnt/server/ui/api.py
  lnt/server/ui/templates/v4_new_regressions.html
  lnt/server/ui/templates/v4_regression_detail.html
  tests/server/ui/test_api.py


Index: tests/server/ui/test_api.py
===================================================================
--- tests/server/ui/test_api.py
+++ tests/server/ui/test_api.py
@@ -41,20 +41,20 @@
                             u'test_id': 1,
                             u'compile_time': 0.007}
 
-graph_data = [[[152292], 1.0,
-               {u'date': u'2012-05-01 16:28:23',
-                u'label': u'152292',
-                u'runID': u'5'}],
-              [[152293], 10.0,
+graph_data = [[u'152292', 1.0,
+              {u'date': u'2012-05-01 16:28:23',
+               u'label': u'152292',
+               u'runID': u'5'}],
+              [u'152293', 10.0,
+              {u'date': u'2012-05-03 16:28:24',
+               u'label': u'152293',
+               u'runID': u'6'}]]
+
+graph_data2 = [[u'152293', 10.0,
                {u'date': u'2012-05-03 16:28:24',
                 u'label': u'152293',
                 u'runID': u'6'}]]
 
-graph_data2 = [[[152293], 10.0,
-                {u'date': u'2012-05-03 16:28:24',
-                 u'label': u'152293',
-                 u'runID': u'6'}]]
-
 possible_run_keys = {
     u'ARCH',
     u'CC_UNDER_TEST_IS_CLANG',
Index: lnt/server/ui/templates/v4_regression_detail.html
===================================================================
--- lnt/server/ui/templates/v4_regression_detail.html
+++ lnt/server/ui/templates/v4_regression_detail.html
@@ -43,8 +43,8 @@
     {% set fc = changes[loop.index -1] %}
     {% set fc_ri_field_index = ts.get_field_index(fc.ri.field) %}
     {"url": "{{fc.ri.machine.id}}/{{fc.ri.test.id}}/{{fc_ri_field_index}}",
-     "start": {{fc.ri.start_order.llvm_project_revision}},
-     "end": {{fc.ri.end_order.llvm_project_revision}}
+     "start": "{{fc.ri.start_order.as_ordered_string()}}",
+     "end": "{{fc.ri.end_order.as_ordered_string()}}"
  },
 {% endfor %}
 ];
Index: lnt/server/ui/templates/v4_new_regressions.html
===================================================================
--- lnt/server/ui/templates/v4_new_regressions.html
+++ lnt/server/ui/templates/v4_new_regressions.html
@@ -36,8 +36,8 @@
     {% set fc = changes[loop.index -1] %}
     {% set fc_ri_field_index = ts.get_field_index(fc.ri.field) %}
     {"url": "/{{api_graph}}/{{ fc.ri.machine.id}}/{{fc.ri.test.id}}/{{fc_ri_field_index}}",
-     "start": {{fc.ri.start_order.llvm_project_revision}},
-     "end": {{fc.ri.end_order.llvm_project_revision}}
+     "start": "{{fc.ri.start_order.as_ordered_string()}}",
+     "end": "{{fc.ri.end_order.as_ordered_string()}}"
  },
 {% endfor %}
 ];
Index: lnt/server/ui/api.py
===================================================================
--- lnt/server/ui/api.py
+++ lnt/server/ui/api.py
@@ -456,11 +456,11 @@
                 q = q.limit(limit)
 
         samples = [
-            [convert_revision(rev), val,
+            [rev, val,
              {'label': rev, 'date': str(time), 'runID': str(rid)}]
             for val, rev, time, rid in q.all()[::-1]
         ]
-        samples.sort(key=lambda x: x[0])
+        samples.sort(key=lambda x: convert_revision(x[0]))
         return samples
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114333.388750.patch
Type: text/x-patch
Size: 3116 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211121/8cb61566/attachment.bin>


More information about the llvm-commits mailing list