Closed Bug 102048 Opened 23 years ago Closed 11 years ago

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

Categories

(Bugzilla :: Query/Bug List, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: pbaker, Assigned: mail)

References

Details

Attachments

(2 files, 1 obsolete file)

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
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
See also bug #185041, which would at least colorize bugs with blockers.
*** Bug 280168 has been marked as a duplicate of this bug. ***
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.
QA Contact: mattyt-bugzilla → default-qa
Target Milestone: Future → ---
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.
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.
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
Blocks: 418953
See also bug 371030
Assignee: nobody → query-and-buglist
Attached patch patch (obsolete) — Splinter Review
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?
Attachment #690171 - Flags: review? → review?(LpSolit)
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-
Assignee: query-and-buglist → hugo.seabrook
Status: NEW → ASSIGNED
Keywords: relnote
Target Milestone: --- → Bugzilla 5.0
Attached patch v2 patchSplinter Review
Thank you for the constructive feedback.

Regards,
Hugo
Attachment #690171 - Attachment is obsolete: true
Attachment #697589 - Flags: review?(LpSolit)
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+
Flags: approval+
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
Closed: 11 years ago
Resolution: --- → FIXED
Summary: blocks/depend column in query results → Display the "Blocks" and "Depends On" columns in buglists
Added to relnotes for 5.0rc1.
Keywords: relnote
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: