If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Display the "Blocks" and "Depends On" columns in buglists

RESOLVED FIXED in Bugzilla 5.0

Status

()

Bugzilla
Query/Bug List
P3
enhancement
RESOLVED FIXED
16 years ago
3 years ago

People

(Reporter: Paul Baker, Assigned: Simon Green)

Tracking

unspecified
Bugzilla 5.0
Bug Flags:
approval +

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

16 years ago
It would be nice if there was a blocks and/or depends on column in the buglist.

The reason for requesting this:
At my company we use we have twice weekly meetings were we go over all the open
bugs in our bugzilla database. We don't have a projector or computers for
everyone to use during the meeting so everyone has a printout of the buglist. We
generally try to skip past bugs that have dependancies during the meeting.
Unfortuneately we can't see that from the printout. It still slows us down
because someone has to manually check each bug for dependencies as we go down
the list, during the meeting.
This is a multi-valued field.  Discussion of multi-valued fields on buglist.cgi
is over at bug #101164.
Priority: -- → P3
Target Milestone: --- → Future

Comment 2

15 years ago
It would be nice even if the list shows only the count of blocker/dependent bugs
in one column.
*** Bug 202292 has been marked as a duplicate of this bug. ***
Assignee: endico → nobody

Comment 4

14 years ago
See also bug #185041, which would at least colorize bugs with blockers.
*** Bug 280168 has been marked as a duplicate of this bug. ***

Comment 6

12 years ago
I'd like to second the need for this - like the original requester, we have regular meetings to review bugs and we need to skip over bugs that are blocked and, perhaps, special attention to bugs that are blockers.  This is difficult with the current queries.

Updated

11 years ago
QA Contact: mattyt-bugzilla → default-qa
Target Milestone: Future → ---

Comment 7

11 years ago
I would like to add my vote to this feature as well. We use the tree view to manage the bugs and periodically track down bugs that are not blocking any other so that they show up in tree views.

Comment 8

11 years ago
I would like to see this feature also.
I have users requesting this to avoid the 'gotcha' moment when they realize that the bug they were working on had a dependancy and they missed it till late in the work process.

Comment 9

10 years ago
Created attachment 272177 [details]
MySQL 5.x stored functions to implement dependencies and flags in query list

This is how we (Red Hat) currently accomplish this using MySQL 5.x. We are using 2.18 currently but with some work this should work in 3.0 as well. We hacked
Bugzilla/Search.pm and the colchange.cgi templates to add these columns to the
selectable list of columns. Doesn't seem to slow things down significantly. Unfortunately this will not work with 4.x. We also accomplished this PostgreSQL before the migration by using subselects inside of the ARRAY() function in the column definitions in Bugzilla/Search.pm.
Better documentation for FlagList():

-- Stored function that returns a comma delimited list of flags for a bug_id
-- Usage: SELECT bugs.bug_id, FlagList(bugs.bug_id, group_id_list) FROM bugs WHERE ...
-- Params: bugs.bug_id INTEGER (current bug id)
--         group_id_list TEXT (comma delimited string of group ids user belongs to)

The group_id_list is just a comma joined string containing the group ids that the user belongs to which we get by:

my $group_id_list;
if (defined Bugzilla->user && Bugzilla->user->groups) {
    $group_id_list = join(",", values %{Bugzilla->user->groups});
}

Dave
See also bug 103866.

Updated

10 years ago
Blocks: 418953

Updated

9 years ago
Duplicate of this bug: 424144

Updated

9 years ago
Duplicate of this bug: 447968

Comment 14

9 years ago
See also bug 371030
Assignee: nobody → query-and-buglist
(Assignee)

Comment 15

5 years ago
Created attachment 690171 [details] [diff] [review]
patch

This does the change without needing to use stored functions, but uses the $dbh->sql_group_contact function instead. I've only tested it on MySQL, but this function is defined in B/DB/Pg.pm Oracle.pm and Sqlite.pm too.

Tested both web and csv output.
Attachment #690171 - Flags: review?

Updated

5 years ago
Attachment #690171 - Flags: review? → review?(LpSolit)

Comment 16

5 years ago
Comment on attachment 690171 [details] [diff] [review]
patch

>=== modified file 'Bugzilla/Search.pm'

>+        blocked => {
>+            table => 'dependencies',
>+            to => 'dependson',
>+            as => 'map_blocks',
>+        },
>+        dependson => {
>+            table => 'dependencies',
>+            to => 'blocked',
>+            as => 'map_dependencies',
>+        },

For both tables, remove the 'as' key. Search.pm already has code to map table names itself. blocked will automagically become map_blocked, and dependson will become map_dependson. We set aliases ourselves in very special cases only.


>+        blocked              => { name  => $dbh->sql_group_concat('DISTINCT map_blocks.blocked') },
>+        dependson            => { name  => $dbh->sql_group_concat('DISTINCT map_dependencies.dependson') },

This is not the right place to define them. As the comment above %columns says, this hash is only for columns which do not exist in the fielddefs table. But both dependson and blocked exist in this table. So you must do two things here: first, move these two lines into %special_sql (and using the "official" map_foo names I mentioned above), and then make these fields available for buglists by adding buglist => 1 into Bugzilla:Field::DEFAULT_FIELDS.


Also, as the dependency lists can be quite large, you have to wrap the output by adding wrap => 1 in list/table.html.tmpl for these two fields.
Attachment #690171 - Flags: review?(LpSolit) → review-

Updated

5 years ago
Assignee: query-and-buglist → hugo.seabrook
Status: NEW → ASSIGNED
Keywords: relnote
Target Milestone: --- → Bugzilla 5.0
(Assignee)

Comment 17

5 years ago
Created attachment 697589 [details] [diff] [review]
v2 patch

Thank you for the constructive feedback.

Regards,
Hugo
Attachment #690171 - Attachment is obsolete: true
Attachment #697589 - Flags: review?(LpSolit)

Comment 18

5 years ago
Comment on attachment 697589 [details] [diff] [review]
v2 patch

>=== modified file 'Bugzilla/Search.pm'

>+        blocked => $dbh->sql_group_concat('DISTINCT map_blocked.blocked'),
>+        dependson => $dbh->sql_group_concat('DISTINCT map_dependson.dependson'),

Your patch makes PostgreSQL crash:

  DBD::Pg::db selectall_arrayref failed: ERROR:  aggregates not allowed in GROUP BY clause


The reason is because these new columns must be added to GROUP_BY_SKIP to prevent to list them in the GROUP BY clause (as they are aggregate functions).


r=LpSolit with this fix on checkin.
Attachment #697589 - Flags: review?(LpSolit) → review+

Updated

5 years ago
Flags: approval+

Comment 19

5 years ago
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Field.pm
modified Bugzilla/Search.pm
modified template/en/default/list/table.html.tmpl
Committed revision 8568.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Summary: blocks/depend column in query results → Display the "Blocks" and "Depends On" columns in buglists

Comment 20

3 years ago
Added to relnotes for 5.0rc1.
Keywords: relnote
You need to log in before you can comment on or make changes to this bug.