Skip to content

Commit 718c788

Browse files
committed
feat(nimbus): Add basic feature tracking table to feature health page.
1 parent bde92fd commit 718c788

File tree

3 files changed

+125
-2
lines changed

3 files changed

+125
-2
lines changed

experimenter/experimenter/nimbus_ui/templates/nimbus_experiments/features.html

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,66 @@ <h5 class="fw-semibold">
331331
</div>
332332
</div>
333333
</div>
334+
<hr>
335+
<h5 class="fw-semibold">
336+
<img src="{% static 'assets/qa-runs.svg' %}"
337+
<img src="{% static 'assets/feature-changes.svg' %}"
338+
alt="Hugging Foxes"
339+
style="width: 60px;
340+
height: auto" />
341+
Feature Changes
342+
<i class="fa-regular fa-circle-question"
343+
data-bs-toggle="tooltip"
344+
data-bs-placement="top"
345+
data-bs-title="This shows any changes made to the Nimbus feature manifest such as code changes for the feature you have chosen"></i>
346+
|
347+
<span class="badge bg-secondary">Number of changes: {{ feature_changes.count|default:"0" }}</span>
348+
</h5>
349+
<div>
350+
<div id="feature-changes-table">
351+
<table class="table table-hover table-borderless align-middle mb-3">
352+
<thead>
353+
<tr>
354+
<th scope="col" class="fw-semibold text-body">
355+
<span>Feature Change</span>
356+
</th>
357+
<th scope="col" class="fw-semibold text-body">
358+
<span>Date / Time</span>
359+
</th>
360+
<th scope="col" class="fw-semibold text-body">
361+
<span>Change Size</span>
362+
</th>
363+
<th scope="col" class="fw-semibold text-body">
364+
<span>Change Diff</span>
365+
</th>
366+
</tr>
367+
</thead>
368+
<tbody>
369+
{% for change in feature_changes %}
370+
<tr scope="row">
371+
<td id="feature-change-link">
372+
{% if change.change_link %}
373+
<a href="{{ change.change_link }}"
374+
target="_blank"
375+
class="text-decoration-none">{{ change.change_link|truncatechars:50 }}</a>
376+
{% else %}
377+
<span class="text-danger">Not set</span>
378+
{% endif %}
379+
</td>
380+
<td id="feature-change-date">{{ change.change_date|date:"m/d/Y @ H:i"|format_not_set }}</td>
381+
<td id="feature-change-size">{{ change.change_size|format_not_set }}</td>
382+
<td id="feature-change-complexity">{{ change.softvision_complexity|format_not_set }}</td>
383+
</tr>
384+
{% empty %}
385+
<tr>
386+
<td colspan="11" class="text-center text-muted py-5">No Tracked Feature Changes</td>
387+
</tr>
388+
</tr>
389+
{% endfor %}
390+
</tbody>
391+
</table>
392+
</div>
393+
</div>
334394
</div>
335395
</div>
336396
</div>

experimenter/experimenter/nimbus_ui/tests/test_views.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3576,14 +3576,18 @@ def test_features_view_renders_table_with_correct_elements(
35763576
)
35773577

35783578
feature_id = self.feature_configs[feature_config].id
3579-
url = reverse("nimbus-ui-features")
35803579
response = self.client.get(
3581-
f"{url}?application={application.value}&feature_configs={feature_id}"
3580+
reverse("nimbus-ui-features"),
3581+
{
3582+
"application": application.value,
3583+
"feature_configs": feature_id,
3584+
},
35823585
)
35833586

35843587
self.assertEqual(response.status_code, 200)
35853588
self.assertContains(response, "deliveries-table")
35863589
self.assertContains(response, "qa-info-table")
3590+
self.assertContains(response, "feature-changes-table")
35873591
self.assertContains(response, experiment)
35883592

35893593
def test_features_view_deliveries_table_can_sort_by_recipe_name(self):

0 commit comments

Comments
 (0)