Skip to content

Commit d9f7a9f

Browse files
committed
feature: add new proofs view to the comparison page
This view summarizes new proofs, i.e., transitions from Unsafe or Unknown results to Safe.
1 parent b952fc8 commit d9f7a9f

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

web/reports/comparison.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
TAG_CET = "cet"
6060
TAG_COLOR = "color"
6161
TAG_HIDE = "hide"
62+
TAG_NEW_PROOFS = "new_proofs"
6263

6364
CLUSTERING_COLORS = ["#ebadad", "#adebad"]
6465

@@ -188,6 +189,8 @@ def __init__(self, root_reports: list, args: dict = {}, other_jobs: list = [], a
188189
if not self.show_same_transitions[verdicts_type]:
189190
if not (self.show_problems and verdicts_type == VERDICTS_UNKNOWN):
190191
cmp['{0}_{0}'.format(verdicts_type)] = []
192+
if TAG_NEW_PROOFS in cmp:
193+
cmp[TAG_NEW_PROOFS] = sorted(cmp[TAG_NEW_PROOFS], key=lambda x: x[1])
191194

192195
if self.enable_clustering:
193196
clusters.append(self.perform_clustering(unsafes, unsafe_incompletes, cmp))
@@ -620,6 +623,10 @@ def __process_verdicts_transitions(self, verdicts_type: str, safes: dict, unsafe
620623
print("Warning: lost transition from reports {} for attrs {} (core attrs are {})".
621624
format(old_reports, cur_attrs, core_cur_attrs))
622625

626+
if not verdicts_type == VERDICTS_SAFE:
627+
if TAG_NEW_PROOFS not in cmp:
628+
cmp[TAG_NEW_PROOFS] = []
629+
cmp[TAG_NEW_PROOFS].extend(to_safes)
623630
cmp['{}_safes'.format(verdicts_type)] = sorted(to_safes, key=lambda x: x[1])
624631
cmp['{}_unsafes'.format(verdicts_type)] = sorted(to_unsafes, key=lambda x: x[1])
625632
cmp['{}_unsafe_incompletes'.format(verdicts_type)] = sorted(to_unsafe_incompletes, key=lambda x: x[1])

web/reports/templates/reports/comparison/two_reports.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,46 @@ <h4 class="seven wide column center floated center aligned">{% trans 'New result
388388
</tr>
389389
{% endif %}
390390

391+
<tr style="vertical-align: top">
392+
<td colspan="2">
393+
{% for cmp_new in data.comparison|slice:"1:" %}
394+
<div class="ui accordion">
395+
<div class="title center aligned">
396+
<div class="black-link"><b>
397+
{% trans 'New proofs' %}: {{ cmp_new.new_proofs|length }}
398+
</b></div>
399+
</div>
400+
<div class="content">
401+
<table class="ui selectable compact table celled striped">
402+
<thead>
403+
<tr>
404+
<td style="background: #d3d3d3; text-align: center" width="50%">{% trans 'Attributes' %}</td>
405+
<td style="background: #d3d3d3; text-align: center" width="25%">{% trans 'Report' %}</td>
406+
</tr>
407+
</thead>
408+
<tbody>
409+
{% for cluster in cmp_new.new_proofs %}
410+
<tr>
411+
<td style="text-align: center; background: lightgreen">
412+
{{cluster.1}}
413+
</td>
414+
<td style="text-align: center; background: lightgreen">
415+
{% if cluster.2 %}
416+
<a href="{% url 'reports:safe' cluster.2.0 %}">{% trans 'Show proof' %}</a>
417+
{% else %}
418+
-
419+
{% endif %}
420+
</td>
421+
</tr>
422+
{% endfor %}
423+
</tbody>
424+
</table>
425+
</div>
426+
</div>
427+
{% endfor %}
428+
</td>
429+
</tr>
430+
391431
<tr style="vertical-align: top">
392432
<td colspan="2">
393433
{% for cmp in data.comparison|slice:"1:" %}

0 commit comments

Comments
 (0)