Bug 587789 - 3.2: Add a Roadmap tab to product browser that shows list of bugs per milestone/target release for a product
Summary: 3.2: Add a Roadmap tab to product browser that shows list of bugs per milesto...
Alias: None
Product: Bugzilla
Classification: Community
Component: Product Browser
Version: 3.6
Hardware: All
OS: Linux
medium vote
Target Milestone: ---
Assignee: Simon Green
QA Contact: trev
Depends On: 587798
Blocks: JIRABZ 694053
TreeView+ depends on / blocked
Reported: 2010-04-30 21:11 UTC by David Lawrence
Modified: 2014-10-12 22:46 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-07-28 23:52:24 UTC

Attachments (Terms of Use)
v1 for patch to add roadmap for product targetreleases (5.55 KB, patch)
2010-11-18 12:56 UTC, Noura El hawary
no flags Details | Diff
v2 of patch to add roadmap tab under browse tab (8.06 KB, patch)
2010-11-19 12:50 UTC, Noura El hawary
dkl: review-
Details | Diff
v2 of patch to add roadmap patch for target releases (6.57 KB, patch)
2010-11-30 12:44 UTC, Noura El hawary
dkl: review-
Details | Diff
v3 of patch to add roadmap tab for target releases (7.11 KB, patch)
2010-12-01 10:13 UTC, Noura El hawary
dkl: review+
Details | Diff
v4 of code to add roadmap tab for targetrelease (7.06 KB, patch)
2010-12-07 11:46 UTC, Noura El hawary
no flags Details | Diff

Description David Lawrence 2010-04-30 21:11:47 UTC
JIRA currently has a report tab called 'Roadmap' available from it's product browser screen. The tab shows a list of issues that are assigned per target release and sorts the releases in order. It also shows a progress bar that has a percent of completion. 

The tab in Bugzilla's product browser should provide similar functionality. First getting a full bug count for particular target release, then listing the open bugs in a YUI paginated table. A progress bar to the right of each release would show the percent completion based on the open bugs / closed bugs.

Comment 1 Noura El hawary 2010-10-20 10:24:53 UTC
Hi Dave,

Under the Product browser we have the Components tab, under it there are the stats  by component/version/milestone for the product, for example:

So the purpose of this bug is to add another section for the new field "Release"? so we would add it under the Components Tab under the Product Browser? or do we want an entirely separate Tab for it like the Duplicates, popularity? 


Comment 2 David Lawrence 2010-10-20 12:44:36 UTC
Not really. The original idea was to have a new tab called Roadmap that list the current target releases for a given product and show a percentage bar showing the counts of how many bugs are completed for each target release. So for each target release it would look like 

Realease 5.6:

[===================                ]  50% Complete (500/250)

So the basic formula would be (total bugs attached to release 5.5/number of bugs closed for 5.5)/100 = percentage complete or something like that.

To get a good example of how this needs to work check out:


Hopefully you can see that logged out.


Comment 3 Noura El hawary 2010-11-18 12:56:53 UTC
Created attachment 461287 [details]
v1 for patch to add roadmap for product targetreleases

This is a patch to add the roadmap tab to the Browse tab.. I haven't tested it yet.. .


Comment 4 Noura El hawary 2010-11-19 12:50:27 UTC
Created attachment 461540 [details]
v2 of patch to add roadmap tab under browse tab

Hi Dave,

Attached is a patch to add the roadmap tab to the browse tab. it is working as describe,, listing all target_release for a selected product with 3 classifications: total bugs, open bugs, closed bugs..

I have tested the patch and it seems to be working successfully for me.


Comment 5 David Lawrence 2010-11-23 22:10:04 UTC
Comment on attachment 461540 [details]
v2 of patch to add roadmap tab under browse tab

>Index: extensions/Browse/template/en/default/pages/browse.html.tmpl
>--- extensions/Browse/template/en/default/pages/browse.html.tmpl	(revision 2285)
>+    <div class="yui-skin-sam">
>+    [% FOREACH target_release = by_roadmap %]
>+      <b>Target Release: [% target_release.release_name %]</b>
>+      <div id="bug_releases">
>+        <table id="bug_releases_table" border="0" cellspacing="3" cellpadding="0">
>+        <thead>
>+          <tr>
>+            <th>Name</th>
>+            <th>Count</th>
>+            <th>Percentage</th>
>+          </tr>
>+        </thead>
>+        <tbody>
>+        <tr>
>+          <td><a href="[% target_release.bug_release_link_total FILTER html %]">Total [% terms.Bugs %]</a></td>
>+          <td>[% target_release.total_bug_release FILTER html %]</td>
>+          <td>&nbsp;</td>
>+        </tr>
>+        <tr>
>+          <td><a href="[% target_release.bug_release_link_open FILTER html %]">Open [% terms.Bugs %]</a></td>
>+          <td>[% target_release.open_bug_release FILTER html %]</td>
>+          <td width="70%">
>+            [% INCLUDE bar_graph count = target_release.open_bug_release full_bug_count = target_release.total_bug_release %]
>+          </td>
>+        </tr>
>+        <tr>
>+          <td><a href="[% target_release.bug_release_link_closed FILTER html %]">Closed [% terms.Bugs %]</a></td>
>+          <td>[% target_release.close_bug_release FILTER html %]</td>
>+          <td width="70%">
>+            [% INCLUDE bar_graph count = target_release.close_bug_release full_bug_count = target_release.total_bug_release %]
>+          </td>
>+        </tr>
>+        </tbody>
>+        </table>
>+      </div>
>+    [% END %]

For this we just need the one percentage bar showing the percentage completed. You can have text off to the side that has some simple counts.


Release | Percentage Complete           | Links                           |
5.4.0   | [================== 66%     ] | 66 of 100 bugs have been closed |

The numbers '66' and '100' can be linked to the proper bug searches.

>Index: extensions/Browse/lib/Queries.pm

>+sub bug_release_link_total {
>+    my ($product, $release) = @_;
>+    return correct_urlbase() . 'buglist.cgi?product=' . url_quote($product->name) . "&target_release=$release";
>+sub bug_release_link_open {
>+    my ($product, $release) = @_;
>+    return correct_urlbase() . 'buglist.cgi?product=' . url_quote($product->name) . "&target_release=$release" 
>+    . "&bug_status=__open__";
>+sub bug_release_link_closed {
>+    my ($product, $release) = @_;
>+    return correct_urlbase() . 'buglist.cgi?product=' . url_quote($product->name) . "&target_release=$release" 
>+    . "&bug_status=__closed__";

These above are already in extensions/Browse/lib/Util.pm and do not need to be redefined here.

>+sub product_targetrelease {
>+    my $product = shift;
>+    my $dbh = Bugzilla->dbh;
>+    return $dbh->selectcol_arrayref("SELECT DISTINCT target_release
>+                                       FROM bugs
>+                                      WHERE bugs.product_id = ?", undef, $product->id);

We should show all target releases in the table, not just the ones that have been assigned to bugs.  Then 
in the table just show "No Bugs Found" or similar in the Links column.

Also if we do all target releases you should be able to get the full list of target releases from Bugzilla::Product->releases
instead of accessing the database directly.

Looking good.

Comment 6 Noura El hawary 2010-11-30 12:44:15 UTC
Created attachment 463710 [details]
v2 of patch to add roadmap patch for target releases

Thanks for the review Dave. Attached is a new patch that has all your suggestions applied.. please let me know what you think.


Comment 7 David Lawrence 2010-11-30 20:22:25 UTC
Comment on attachment 463710 [details]
v2 of patch to add roadmap patch for target releases

Thanks Noura.

>Index: extensions/Browse/template/en/default/pages/browse.html.tmpl

+    var column_defs = [
+        { key:"release", label:"Release" },
+        { key:"percentage complete", label:"Percentage Complete", sortable:false },
+        { key:"links", label:"Links" },
+    ];

Please add sortable:true to the release column and set the others to sortable:false.

>+          <tr>
>+            <td>[% target_release.release_name %]</td>
              <td>[% target_release.release_name FILTER html %]</td>

>+            <td width="70%">
>+            [% INCLUDE bar_graph count = target_release.open_bug_release full_bug_count = target_release.total_bug_release %]

count = target_release.closed_bug_release

>+            </td>
>+            [% IF target_release.total_bug_release > 0 %]
>+              <td><a href="[% target_release.bug_release_link_open FILTER html %]">[% target_release.open_bug_release FILTER html %]</a>&nbsp;of&nbsp;<a href="[% target_release.bug_release_link_total FILTER html %]">[% target_release.total_bug_release FILTER html %]</a>&nbsp;bugs have been closed</td>

Change target_release.bug_release_link_open to target_release.bug_release_link_closed and also change target_release.open_bug_release to target_release.closed_bug_release. 

The text should read as:

"<total_closed_bugs> of <total_bugs> bugs have been closed"
nit: divide this over a couple lines instead of one line

>+            [% ELSE %]
>+              <td>No bugs Found</td>

Replace 'bugs' with [% terms.bugs %] in appropriate places.

Nit: s/Found/found/

>Index: extensions/Browse/Extension.pm
> use Bugzilla::Field;
>+use Bugzilla::Milestone;

Bugzilla::Milestone is needed?

> use Bugzilla::Extension::Browse::Queries;
> use Bugzilla::Extension::Browse::Util;
>@@ -167,6 +168,20 @@
>     if ($current_tab_name eq 'by_popularity') {
>         $vars->{'by_popularity'} = by_popularity($product, $bug_status);
>     }
>+    if ($current_tab_name eq 'by_roadmap') {
>+        my $releases = $product->releases();
>+        foreach my $release_obj (@{$releases}){
>+            my %release_stats;
>+            my $release = $release_obj->{value};
>+            $release_stats{'release_name'} = $release;
>+            $release_stats{'total_bug_release'} = total_bug_release($product, $release);
>+            $release_stats{'open_bug_release'}  = bug_release_by_status($product, $release);
>+            $release_stats{'bug_release_link_total'} = bug_release_link_total($product, $release);
>+            $release_stats{'bug_release_link_open'} = bug_release_link_open($product, $release);
>+            push (@{$vars->{by_roadmap}}, \%release_stats);             
>+        }
>+    }

Need to add the following to support the comments for the browse.html.tmpl template changes: 

$release_stats{'closed_bug_release'}  = bug_release_by_status($product, $release, 'closed');
$release_stats{'bug_release_link_closed'} = bug_release_link_closed($product, $release);

>Index: extensions/Browse/lib/Queries.pm
>+sub bug_release_by_status {
>+    my ($product, $release) = @_;

Allow the bug status to be passed in as well

      my ($product, $release, $bug_status) = @_;

>+    my $dbh = Bugzilla->dbh;
>+    my $extra = "AND bugs.bug_status IN (" . open_states() . ")";

And then change the query based on $bug_status

    my $extra;
    $extra = "AND bugs.bug_status IN (" . open_states() . ")" if $bug_status eq 'open';
    $extra = "AND bugs.bug_status IN (" . closed_states() . ")" if $bug_status eq 'closed';

>Index: extensions/Browse/lib/Util.pm
>+    bug_release_link_total
>+    bug_release_link_open
> );

Add another subroutine for bug_release_link_closed()
Looks good Noura.


Comment 8 David Lawrence 2010-11-30 21:27:41 UTC
I have pushed a test release containing this change to bz-web2-test.devel.redhat.com for testing purposes. It is ready for the JIRA folks to take a look and see what they think so far.


Comment 10 Noura El hawary 2010-12-01 10:13:48 UTC
Created attachment 463933 [details]
v3 of patch to add roadmap tab for target releases

Hi Dave,

Attached is a patch with all changes you mentioned before.


Comment 11 David Lawrence 2010-12-02 22:06:26 UTC
Comment on attachment 463933 [details]
v3 of patch to add roadmap tab for target releases

Looks good Noura. I wonder if we should wrap all of this though in a Param('usetargetrelease') check so that if that is set to off, then none of this stuff appears. The RoadMap tab is not really useful of usetargetrelease is turned off. 

The other side of the question is whether we should even have the usetargetrelease param at all and just have it on all the time. 

I guess we can leave the param since we have one also for Target Milestone for now. Please update this patch in a way that this stuff is hidden when usetargetrelease is off.


Comment 12 Noura El hawary 2010-12-07 11:46:29 UTC
Created attachment 465222 [details]
v4 of code to add roadmap tab for targetrelease

Thanks for the review Dave.. Attached is a new patch that wraps up the roadmap code into usetargetrelease param, so if it is not on the tab will not appear.. I have committed the extra wrapping code to the target_release branch..


Comment 13 David Lawrence 2010-12-14 20:55:40 UTC
Thanks for all of the work on this Noura. It should all be under the target_release branch in SVN. The next steps after this will be:

1. Finish testing to make sure there are no problems.
2. Schedule a time to commit this code to trunk and then push an updated package live. 
3. Work with eng-systems to execute checksetup.pl to create the new fields and tables that are needed.
4. Work with Andrius, cward, etc. to migrate the old values to the new Bugzilla field.
5. Make sure the ACLs on the old custom field work with the new field. 
6. Close this and the other relate bugs when everything is live.
7. Have Simon or yourself re-enable the code I commented out in the jira branch to work with the new target release field.


Comment 15 trev 2010-12-16 15:54:52 UTC
I'm not seeing this as a tab after clicking  browse, can you describe where I should be seeing this please

Comment 16 Noura El hawary 2010-12-17 12:16:19 UTC
Hi trev,

The reason why you can not see it is that a parameter needs to be set on to show the tab. I asked out sys admins to turn it on and you should see the tab once that is done hopefully sometime later on today.


Comment 17 Simon Green 2011-02-23 14:37:41 UTC
Is this a duplicate of bug 584949?

I have to check however that this code works with the new target release code (bug 587798). Marking as ASSIGNED until I have done this.

Comment 21 Simon Green 2011-07-21 08:36:05 UTC

This change is now on partner-bugzilla.redhat.com, and is due to be released as part of today's upgrade on the live bugzilla server.

  -- simon

Comment 23 Simon Green 2011-07-28 23:52:24 UTC

This change was released into production approximately 4 hours ago, as part
of Red Hat Bugzilla 3.6.5011.

  -- simon

Note You need to log in before you can comment on or make changes to this bug.