Skip to content

Commit

Permalink
More changes based on requests:
Browse files Browse the repository at this point in the history
- Add a link to the documentation: https://firefox-source-docs.mozilla.org/bug-mgmt/policies/attention-dashboard.html
- Add the following to the top of the page, below the auto-refresh toggle:
  - `Code review requests are not visible on this dashboard; please visit Phabricator to view those. In general it’s reasonable and important to prioritize Review Requests to unblock others.`
  - The word `Phabricator` should link to https://phabricator.services.mozilla.com/
- `Highest Priority Tasks` section:
  - Change the subtitle to:
    - `These are the things you should drop everything else for. Generally, work where you block others should be addressed as higher priority than non-blocking work.`
  - Rename `Important NEEDINFOs` to `Critical NEEDINFOs`
  - Rename `sec-critical bugs` to `Security-Critical Bugs`
  - Change the order of the tables to:
    - Critical NEEDINFOs
    - S1 Bugs
    - Security-Critical Bugs
- `High Priority Tasks` section:
  - Change the subtitle to:
    - `High priority tasks are also "drop everything", except that in this case "everything" doesn't include anything in the "Highest priority" list. Generally, work where you block others should be addressed as higher priority than non-blocking work.`
  - Rename `Other NEEDINFOs` to `Important NEEDINFOs`
  - Rename `sec-high Bugs` to `Security-High Bugs`
  - Remove the `Regressions` list
  - Change the order of the tables to:
    - Important NEEDINFOs
    - S2 Bugs
    - Security-High Bugs
    - Other NEEDINFOs
  • Loading branch information
dklawren committed Jan 7, 2024
1 parent c89cfe8 commit b41c9f8
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 40 deletions.
38 changes: 20 additions & 18 deletions extensions/BMO/lib/Reports/Attention.pm
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ sub sec_crit_bugs {
}

# Bugs that are needinfo? you and are marked as being tracked against or blocking the current nightly/beta/release
sub important_needinfo_bugs {
sub critical_needinfo_bugs {
my $user = shift;
my $dbh = Bugzilla->dbh;

Expand Down Expand Up @@ -334,34 +334,36 @@ sub sec_high_bugs {
return $filtered_bugs;
}

# Regressions
sub regression_bugs {
# Important needinfos (needinfos for me but not set by me)
sub important_needinfo_bugs {
my $user = shift;
my $dbh = Bugzilla->dbh;

# Preselected values for inserting into SQL
my $cache = Bugzilla->process_cache->{attention};
my $keyword_id = $cache->{regression_id};
my $class_ids = join ',', @{$cache->{classification_ids}};
my $bug_states = join ',', map { $dbh->quote($_) } BUG_STATE_OPEN;
# Cached values for inserting into SQL
my $cache = Bugzilla->process_cache->{attention};
my $needinfo_id = $cache->{needinfo_flag_id};
my $class_ids = join ',', @{$cache->{classification_ids}};
my $bug_states = join ',', map { $dbh->quote($_) } BUG_STATE_OPEN;

my $query = SELECT . "
FROM bugs JOIN products ON bugs.product_id = products.id
JOIN keywords ON bugs.bug_id = keywords.bug_id
LEFT JOIN flags AS requestees_login_name ON bugs.bug_id = requestees_login_name.bug_id
AND COALESCE(requestees_login_name.requestee_id, 0) = ?
AND COALESCE(requestees_login_name.setter_id, 0) != ?
WHERE products.classification_id IN ($class_ids)
AND keywords.keywordid = $keyword_id
AND bugs.bug_status IN ($bug_states)
AND bugs.assigned_to = ?
ORDER BY bugs.delta_ts, bugs.bug_id";
AND (requestees_login_name.bug_id IS NOT NULL
AND requestees_login_name.type_id = $needinfo_id)
ORDER BY bugs.delta_ts, bugs.bug_id";

my $bugs = get_bug_list($query, $user->id);
my $bugs = get_bug_list($query, $user->id, $user->id);
my $formatted_bugs = format_bug_list($bugs, $user);
my $filtered_bugs = filter_secure_bugs($formatted_bugs);

return $filtered_bugs;
}

# Other needinfos (needinfos for me but not set by me)
# Other needinfos
sub other_needinfo_bugs {
my $user = shift;
my $dbh = Bugzilla->dbh;
Expand Down Expand Up @@ -427,17 +429,17 @@ sub report {
# build bug lists
$vars->{s1_bugs} = s1_bugs($who);
$vars->{sec_crit_bugs} = sec_crit_bugs($who);
$vars->{important_needinfo_bugs} = important_needinfo_bugs($who);
$vars->{critical_needinfo_bugs} = critical_needinfo_bugs($who);
$vars->{s2_bugs} = s2_bugs($who);
$vars->{sec_high_bugs} = sec_high_bugs($who);
$vars->{regression_bugs} = regression_bugs($who);
$vars->{important_needinfo_bugs} = important_needinfo_bugs($who);
$vars->{other_needinfo_bugs} = other_needinfo_bugs($who);

# count number of unique bugs
my %bug_ids;
foreach my $name (qw(
s1_bugs sec_crit_bugs important_needinfo_bugs s2_bugs sec_high_bugs
regression_bugs other_needinfo_bugs
s1_bugs sec_crit_bugs critical_needinfo_bugs s2_bugs
sec_high_bugs important_needinfo_bugs other_needinfo_bugs
)) {
foreach my $bug (@{$vars->{$name}}) {
$bug_ids{$bug->{id}} = 1;
Expand Down
27 changes: 19 additions & 8 deletions extensions/BMO/template/en/default/pages/attention.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<div id="attention">
<h1>What Needs My Attention?</h1>

<p><a href="https://firefox-source-docs.mozilla.org/bug-mgmt/policies/attention-dashboard.html">
Documentation</a></p>

<form id="attention_form" name="attention_form" action="[% basepath FILTER none %]page.cgi" method="get">
<input type="hidden" name="id" value="attention.html">
<input type="hidden" name="action" value="run">
Expand Down Expand Up @@ -51,24 +54,32 @@
Auto-refresh every 10min
</div>

<p>Code review requests are not visible on this dashboard; please visit
<a href="[% Param('phabricator_base_uri') FILTER html %]">Phabricator</a>
to view those. In general it’s reasonable and important to prioritize
Review Requests to unblock others.</p>

<h2>Highest Priority Tasks</h2>
<div class="task-desc">
These are the things you should drop everything else for (they’re in no particular order).
These are the things you should drop everything else for. Generally, work where
you block others should be addressed as higher priority than non-blocking work.
</div>

[% INCLUDE bug_table title="Critical NEEDINFOs" bugs=critical_needinfo_bugs %]
[% INCLUDE bug_table title="S1 bugs" bugs=s1_bugs %]
[% INCLUDE bug_table title="sec-critical bugs" bugs=sec_crit_bugs %]
[% INCLUDE bug_table title="Important NEEDINFOs" bugs=important_needinfo_bugs %]

[% INCLUDE bug_table title="Security-Critical bugs" bugs=sec_crit_bugs %]

<h2>High Priority Tasks</h2>
<div class="task-desc">
High priority tasks are also “drop everything”, except that in this case
“everything” doesn’t include anything in the “Highest priority” list.
High priority tasks are also "drop everything", except that in this case
"everything" doesn't include anything in the "Highest priority" list.
Generally, work where you block others should be addressed as higher priority
than non-blocking work.
</div>

[% INCLUDE bug_table title="Important NEEDINFOs" bugs=important_needinfo_bugs %]
[% INCLUDE bug_table title="S2 bugs" bugs=s2_bugs %]
[% INCLUDE bug_table title="sec-high bugs" bugs=sec_high_bugs %]
[% INCLUDE bug_table title="Regressions" bugs=regression_bugs %]
[% INCLUDE bug_table title="Security-High bugs" bugs=sec_high_bugs %]
[% INCLUDE bug_table title="Other NEEDINFOs" bugs=other_needinfo_bugs %]
</div>

Expand Down
14 changes: 0 additions & 14 deletions qa/t/1_test_attention.t
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,6 @@ $sel->type_ok('assigned_to', $config->{admin_user_login});
$sel->check_ok('//input[@name="groups" and @value="Master"]');
$sel->click_ok('commit');
$sel->is_text_present_ok('has been added to the database', 'Bug created');

# Regressions
file_bug_in_product($sel, 'Firefox');
$sel->type_ok('short_desc', 'test bug for regressions assigned to you');
$sel->select_ok('component', 'General');
$sel->type_ok('keywords', 'regression');
$sel->select_ok('bug_status', 'ASSIGNED');
$sel->type_ok('assigned_to', $config->{admin_user_login});
$sel->click_ok('commit');
$sel->is_text_present_ok('has been added to the database', 'Bug created');
logout($sel);

# Other needinfos (needinfos for me but not set by me)
Expand Down Expand Up @@ -117,10 +107,6 @@ $sel->is_text_present_ok(
'test bug for sec-high bugs assigned to you',
'test bug for sec-high bugs assigned to you'
);
$sel->is_text_present_ok(
'test bug for regressions assigned to you',
'test bug for regressions assigned to you'
);
$sel->is_text_present_ok(
'test bug for other needinfos not set by you',
'test bug for other needinfos not set by you'
Expand Down

0 comments on commit b41c9f8

Please sign in to comment.