Repository: conbench/conbench (language: python)

Issue:
Transform (likely?) URLs into links
When we send extra benchmark information, those sometimes include http-based URLs. It would be nice if our display rendered those as actual clickable links and not just text.


Discussion / hints:

Fix patch:
diff --git a/conbench/templates/benchmark-entity.html b/conbench/templates/benchmark-entity.html
index 05d16d0b7..75d249f67 100644
--- a/conbench/templates/benchmark-entity.html
+++ b/conbench/templates/benchmark-entity.html
@@ -74,7 +74,8 @@
       <li class="list-group-item" style="overflow-y: auto;">
         <b>{{ k }}</b>
         <br> <br />
-        <div align="left" style="display:inline-block; white-space: pre; float: center;">{{ v }}</div>
+        <div align="left" style="display:inline-block; white-space: pre; float: center;">{{ v | urlize(target="_blank")
+          }}</div>
       </li>
       {% endfor %}
       {% endif %}
@@ -111,7 +112,7 @@
       <li class="list-group-item" style="overflow-y: auto;">
         <b>{{ k }}</b>
         {% if v is not none %}
-        <div align="right" style="display:inline-block; float: right;">{{ v }}</div>
+        <div align="right" style="display:inline-block; float: right;">{{ v | urlize(target="_blank") }}</div>
         {% endif %}
       </li>
       {% endfor %}
@@ -202,7 +203,7 @@
       {% for k,v in benchmark.info.items() %}
       <li class="list-group-item" style="overflow-y: auto;">
         <b>{{ k }}</b>
-        <div align="right" style="display:inline-block; float: right;">{{ v }}</div>
+        <div align="right" style="display:inline-block; float: right;">{{ v | urlize(target="_blank") }}</div>
       </li>
       {% endfor %}
       {% endif %}


Test patch:
diff --git a/conbench/tests/populate_local_conbench.py b/conbench/tests/populate_local_conbench.py
index 9f1d84e00..3f6f53073 100644
--- a/conbench/tests/populate_local_conbench.py
+++ b/conbench/tests/populate_local_conbench.py
@@ -71,6 +71,7 @@ def generate_benchmarks_data(
 
     data["optional_benchmark_info"] = {
         "log uri": "s3://some/log",
+        "log url": "https://some/log",
         "trace uri": "s3://some/trace",
     }