Skip to content

Commit

Permalink
Separate outstanding bugs landed in nightly view
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalchevrel committed Dec 7, 2023
1 parent d372779 commit c5e99d9
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/controllers/nightly.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$crash_bugs,
$bug_list,
$bug_list_karma,
$outstanding_bugs,
$previous_date,
$requested_date,
$next_date,
Expand All @@ -28,6 +29,7 @@
'build_crashes' => $build_crashes,
'top_sigs' => $top_sigs,
'crash_bugs' => $crash_bugs,
'outstanding_bugs' => $outstanding_bugs,
'bug_list' => $bug_list,
'bug_list_karma' => $bug_list_karma,
'previous_date' => $previous_date,
Expand Down
24 changes: 23 additions & 1 deletion app/models/nightly.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,28 @@
}
}
}
// dd($crash_bugs);

// In this section, we extract outstanding bugs
$outstanding_bugs = [];
foreach ($bug_list as $key => $values) {
foreach ($values['bugs'] as $bug_details) {
// Old bugs fixed are often interesting
if ($bug_details['id'] < 1_500_000) {
$outstanding_bugs[$key]['bugs'][] = $bug_details;
continue;
}
// Enhancements are potentiol release notes additions
if ($bug_details['type'] == 'enhancement') {
$outstanding_bugs[$key]['bugs'][] = $bug_details;
continue;
}
// High karma
if ($bug_list_karma[$bug_details['id']]['score'] > 15) {
$outstanding_bugs[$key]['bugs'][] = $bug_details;
}
}
}

return [
$display_date,
$nightly_pairs,
Expand All @@ -210,6 +231,7 @@
$crash_bugs,
$bug_list,
$bug_list_karma,
$outstanding_bugs,
$previous_date,
$requested_date,
$next_date,
Expand Down
65 changes: 64 additions & 1 deletion app/views/templates/nightly.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@

</p>
<div class="collapse" id="collapse{{ dataset.buildid }}">
<table class="table table-light table-striped table-bordered table-sm mb-3">

<!-- Outstanding bugs -->
<table class="table table-light table-striped table-bordered table-sm mb-3 caption-top">
<caption class="table-dark text-center fw-bold">Outstanding bugs</caption>
<thead>
<tr class="table-dark">
<th>Bug</th>
Expand All @@ -54,6 +57,62 @@
</tr>
</thead>
<tbody>
{%- for details in outstanding_bugs[dataset.buildid].bugs -%}
{%- set alert_link = '' -%}
{%- set alert_title = '' -%}
{%- set alert_row = '' -%}
{%- set pill_level = 'text-bg-light border' -%}
{%- if details.type == 'enhancement' -%}
{%- set alert_link =' text-success fw-bold' -%}
{%- set alert_title =' title="Bug marked as Enhancement"' -%}
{%- endif -%}
{%- if bug_list_karma[details.id].score > 8 -%}
{%- set pill_level ='text-bg-warning' -%}
{%- endif -%}
{%- if bug_list_karma[details.id].score > 15 -%}
{%- set alert_row ='fw-bold' -%}
{%- set pill_level ='text-bg-danger' -%}
{%- endif -%}
<tr class="small {{ alert_row }}">
<td><a href="https://bugzilla.mozilla.org/{{ details.id }}" class="text-end text-nowrap bug-link link-primary {{ alert_link }}" {{ alert_title|raw }}>{{ details.id }}</a></td>
<td><a href="https://bugzilla.mozilla.org/{{ details.id }}" class="bug-link link-dark {{ alert_link }}">{{ details.component }}</td>
<td class="text-center {{ alert_row }}">
<span class="badge rounded-pill {{ pill_level }} score-pill">{{ bug_list_karma[details.id].score }}</span>
<div class="card text-bg-primary mb-3 score-card">
<div class="card-body p-2">
<table class="table table-borderless table-sm">
{%- for key, score_detail in bug_list_karma[details.id].details -%}
{%- if score_detail != 0 -%}
<tr class="small text-light bg-primary">
<th class="text-start p-0 text-light bg-primary">{{ key }}</th>
<td class="text-end p-0 fw-normal text-light bg-primary">{{ score_detail }}</td>
</tr>
{%- endif -%}

{%- endfor -%}
</table>
</div>
</div>
</div>
</td>
<td><a href="https://bugzilla.mozilla.org/{{ details.id }}" class="bug-link link-dark {{ alert_link }}">{{ details.summary }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>

<!-- Less notable bugs -->
<table class="table table-light table-striped table-bordered table-sm mb-3">
<caption class="table-dark text-center fw-bold">Other bugs</caption>
<thead>
<tr class="table-dark">
<th>Bug</th>
<th>Component</th>
<th>Impact</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
{%- for details in bug_list[dataset.buildid].bugs -%}
{%- set alert_link = '' -%}
{%- set alert_title = '' -%}
Expand All @@ -70,6 +129,9 @@
{%- set alert_row ='fw-bold' -%}
{%- set pill_level ='text-bg-danger' -%}
{%- endif -%}
{% if details in outstanding_bugs[dataset.buildid].bugs %}
{# do nothing #}
{% else %}
<tr class="small {{ alert_row }}">
<td><a href="https://bugzilla.mozilla.org/{{ details.id }}" class="text-end text-nowrap bug-link link-primary {{ alert_link }}" {{ alert_title|raw }}>{{ details.id }}</a></td>
<td><a href="https://bugzilla.mozilla.org/{{ details.id }}" class="bug-link link-dark {{ alert_link }}">{{ details.component }}</td>
Expand All @@ -94,6 +156,7 @@
</td>
<td><a href="https://bugzilla.mozilla.org/{{ details.id }}" class="bug-link link-dark {{ alert_link }}">{{ details.summary }}</a></td>
</tr>
{%- endif -%}
{% endfor %}
</tbody>
</table>
Expand Down

0 comments on commit c5e99d9

Please sign in to comment.