Bug 584956

Summary: 1.1.8: Fixed for field for bug reports
Product: [Community] Bugzilla Reporter: David Lawrence <dkl>
Component: Creating/Changing BugsAssignee: Len DiMaggio <ldimaggi>
Status: CLOSED NOTABUG QA Contact: Mike Harvey <mharvey>
Severity: medium Docs Contact:
Priority: low    
Version: 3.6CC: atangrin, kbaker, ldimaggi, max.andersen, mharvey, mkanat, nelhawar, rrajasek, sgreen, tkirby
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-10 14:20:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 599237    
Bug Blocks: 583097, 587798, 640966    
Attachments:
Description Flags
patch to add target release field similar to the target milstone file - Not complete
none
v2 of patch to add the target release field to bugzilla
none
v3 patch to add target release to bugzilla
none
v4_dkl: patch to add target release to bugzilla
none
v5 of patch to add tagret release field to bugzilla nelhawar: review? (dkl)

Description David Lawrence 2010-04-22 19:17:01 UTC
JIRA Requirement: 1.1.8

JIRA has a fixed for field that allows issues to be set to be fixed for specific product releases. Bugzilla does not have a native field for tracking these values and up until now 
different departments have been using special custom fields such as "Target Release" to do this. Problem with the custom field is it is global currently and so would be confusing 
to add more values to it for the migrated JIRA products. More custom fields could be created and kept separate for each product's versions needed but this may cause the boolean charts field list to become larger and more confusing.

Proposed Solution(s): 

Update Bugzilla core core to add a new drop down similar to Target Milestone called Target Release. This would have specific list of values based on product and would behave on the back end similar to Target Milestone. Then you would only have one select field on the advanced query page for Target Release which would be filtered based on product selected.

Comment 1 Max Kanat-Alexander 2010-05-26 21:50:33 UTC
The normal Target Milestone field is normally a per-product field, though. Why isn't it enough to satisfy this requirement?

Comment 2 David Lawrence 2010-05-27 21:37:00 UTC
We normally use Target Milestone to signify milestones during the actual development process and therefore call it alpha, beta1, beta2, rc1, rc2, etc. The Fixed For (or Target Release as I want to call it) would have actual released versions such as 5.5, 5.6, 6.0, 6.1, etc. But there is no reason the Target Release code cannot mimic the Target Milestone code.

Comment 3 Max Kanat-Alexander 2010-05-27 23:59:31 UTC
Okay. :-) Maybe you could just make it a <select> right before the Target Milestone, sort of like how Severity and Priority combine into Importance in the normal Bugzilla UI. So it would look like:

  Target Release: 5.6 alpha

Comment 4 David Lawrence 2010-06-01 21:28:29 UTC
That may be confusing to users unless we have some sort of mouseover help text that explained it properly. We could just slim it down to:

Target Release: 5.6 Milestone: alpha

Also we have several security restrictions surround our current cf_targetrelease field that would need to still work with the new Target Release field. For examples see extensions/RedHatFields/Extension.pm look for bug_filter_changes() and bug_filter_fields(). We actually do not display some fields based on security restrictions which is not built into Bugzilla yet.

Comment 5 David Lawrence 2010-07-24 21:02:43 UTC
Thinking about this requirement some more. Once Max has the other requirements completed allowing custom fields values to be filtered based on multiple values of another field then we will be able to implement this using that. I don't think we need to create a core Bugzilla field for this. 

For example: 

Value | Product(s)
1.0   | RHEL5, JBOSS1    
2.0   | RHEL5, JBOSS2
3.0   | RHEL5
4.0   | RHEL4, RHEL5
5.0   | RHEL4
6.0   | RHEL5, RHEL6

Dave

Comment 6 David Lawrence 2010-07-24 21:03:36 UTC
*** Bug 590153 has been marked as a duplicate of this bug. ***

Comment 7 Mike Harvey 2010-08-18 13:39:45 UTC
We need to address the default value to be populated in the "fix For Version"
field upon creation of a new bugzilla.  In discussion I have had today, the
default value should be set to a "TBD" version.  Later, as part of the triage
/review process, this field will be set to an actual valid version where the
bug is slated to be fixed.  The thought process is that we don't want bug
creators to make decisions as to which version the bug will actually be fixed
in.

Comment 8 Max Kanat-Alexander 2010-08-18 13:52:14 UTC
That's fine, you can just leave it off of the enter_bug page.

Comment 9 Mike Harvey 2010-08-18 15:00:09 UTC
That works!

Comment 10 Max Rydahl Andersen 2010-09-03 06:41:37 UTC
That field would only be removed from non-committers, right ?

i.e. as a committer/project member I shouldn't have to first open an issue and then edit it again to fill in the field. Correct ?

Comment 13 Noura El hawary 2010-09-20 11:23:55 UTC
Thanks Dave, I am currently working on this bug.

Cheers,
Noura

Comment 14 Noura El hawary 2010-09-23 13:36:00 UTC
Created attachment 449213 [details]
patch to add target release field similar to the target milstone file - Not complete

Just to keep a record of it (incomplete patch), this is a patch to add the target release field to bugzilla similar to the target milestone, patch is still missing the webservice code, search code.

If you would like to take a look and comment on the patch, please feel free.

Noura

Comment 15 David Lawrence 2010-09-28 21:27:42 UTC
Hey Noura. runtests.pl reports the following:

t/004template.t ...... 1/514 
#   Failed test 'admin/releases/select-product.html.tmpl cannot be located --ERROR'
#   at t/004template.t line 76.

#   Failed test 'admin/releases/list.html.tmpl cannot be located --ERROR'
#   at t/004template.t line 76.

#   Failed test 'admin/releases/create.html.tmpl cannot be located --ERROR'
#   at t/004template.t line 76.

#   Failed test 'admin/releases/confirm-delete.html.tmpl cannot be located --ERROR'
#   at t/004template.t line 76.

#   Failed test 'admin/releases/edit.html.tmpl cannot be located --ERROR'
#   at t/004template.t line 76.

Dave

Comment 16 David Lawrence 2010-09-29 15:25:21 UTC
Another error:

t/012throwables.t .... 1/198 
#   Failed test 'Bugzilla/Product.pm has 1 error(s):
# user error tag 'product_must_define_defaultrelease' is used at line(s) (563) but not defined for language(s): any'
#   at t/012throwables.t line 209.
# Looks like you failed 1 test of 198.
t/012throwables.t .... Dubious, test returned 1 (wstat 256, 0x100)

(In reply to comment #15)
> Hey Noura. runtests.pl reports the following:
> 
> t/004template.t ...... 1/514 
> #   Failed test 'admin/releases/select-product.html.tmpl cannot be located
> --ERROR'
> #   at t/004template.t line 76.
> ....

For this problem, your patch put the template/en/default/admin/releases directory in the Bugzilla root so just 'mv releases template/en/default/admin' and then create a new patch.

Dave

Comment 17 Noura El hawary 2010-09-30 14:19:15 UTC
Created attachment 450770 [details]
v2 of patch to add the target release field to bugzilla

Hi Dave,

Thanks for testing the previous patch, I have fixed the issues you found and completed the patch,, for the patch to run correctly we need to run checksetup to create the new release table and the target release column to the bugs table. also  we need to run an sql statement to add the target_milestone field to the fielddefs table.

Cheers,
Noura

Comment 18 David Lawrence 2010-10-04 16:09:52 UTC
Hey Noura. Looking better. Couple comments:

1) In Bugzilla/Install/DB.pm you need to add code to create the defaultrelease
column to the products table. As well as the default value of '---' for each of the products. I believe if you have the default set to '---' in the column definition when you add the new column, it automatically updates each product row with the new '---' value so no need for a separate SQL statement.

2) From the admin.cgi screen where you can click on "Products" link to edit product attributes, add the 'releases' link near the current 'milestones' link. So it should look like this:

Products
    Edit all aspects of products, including group restrictions which let you define who can access bugs being in these products. You can also edit some specific attributes of products such as components, versions, milestones, and releases directly.

3) Please have the target release show up before Milestone and on the same line. For description, see comment 4.

4) I do not see where this is displayed on the advanced query screen as a multi select list. Please add the list before Target on the same row as product/component/version/milestone. Also change the word Target to Milestone instead as to make it less confusing.

List of todo items once the core functionality is working. These items are more specific to Red Hat's installation.

1) We will need to write a separate script to migrate the current values from the cf_target_release field to the new Release field. You could some as simple as a regex that for example looks for 5\..* values and adds them to the RHEL5 product, 6\..* values are added to the RHEL6 product and so on. Some of the others may need manual work to move.

Please file a new bug for the todo above and make this one block it.

Dave

Comment 19 Noura El hawary 2010-10-07 11:37:03 UTC
Created attachment 452087 [details]
v3 patch to add target release to bugzilla

Thanks for the review Dave. I have added all the changes you suggested to the new patch.

Noura

Comment 20 David Lawrence 2010-10-07 21:23:25 UTC
Created attachment 452205 [details]
v4_dkl:  patch to add target release to bugzilla

Looks good Noura. I have uploaded a patch with a few changes in it for you to review. One thing that is still not right is the display of target release and target milestone on show_bug.cgi. Since both blocks are using a <th></th> label
it pushes the milestone one over far to the right and they need to be next to each other. Somehow it needs to be like severity/priority close together yet still work if one or the other is disabled in the params. One thing we could think about is not using a param at all for it and just have it on always. Then the milestone is just optional. I do not care either way. I also added section to messages.html.tmpl and also added a selenium test case. Please take a look.

Dave

Comment 21 David Lawrence 2010-10-08 14:35:07 UTC
I am also having to increase the value field size to 255 to accommodate some of the JIRA release values. 20 characters was too small.

-            value      => {TYPE => 'varchar(20)', NOTNULL => 1},
+            value      => {TYPE => 'varchar(255)', NOTNULL => 1},

Dave

Comment 22 David Lawrence 2010-10-08 17:17:52 UTC
(In reply to comment #21)
> I am also having to increase the value field size to 255 to accommodate some of
> the JIRA release values. 20 characters was too small.
> 
> -            value      => {TYPE => 'varchar(20)', NOTNULL => 1},
> +            value      => {TYPE => 'varchar(255)', NOTNULL => 1},
> 
> Dave

Actually I had to change it to 64 instead as it caused issues with other tables that had foreign keys constraints to it.

Dave

Comment 23 Mike Harvey 2010-10-11 18:54:21 UTC
Assigned to Trevor to verify/QA.  https://bz-web2-test.devel.redhat.com/

There is a new Bugzilla field called Target Release which is to duplicate the Fixed For field in JIRA. Similar to extra components  and extra versions, there is a Extra Target Releases field which allows more than one to be assigned to a bug report.

Comment 24 Noura El hawary 2010-10-12 11:06:53 UTC
Created attachment 452940 [details]
v5 of patch to add tagret release field to bugzilla

Hi Dave,

Thanks for the changes you made to the patch, I have fixed the patch for the fields target release and target milestone to be presented tidy in show_bug.cgi, also I made modifications to the selenium test you added and run it and it was successfully run with no errors.

Attached is the modified patch.

Cheers,
Noura

Comment 25 Mike Harvey 2010-10-18 20:54:45 UTC
Testing failed.  I received an Internal Server Error at 4:43 pm EST (look in bz log) while testing https://bz-web2-test.devel.redhat.com/show_bug.cgi?id=635129 and doing a multiple selects on the "Extra Target Releases" and then submitting changes.       

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, sysadmin-engops and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Comment 26 David Lawrence 2010-10-20 03:45:50 UTC
(In reply to comment #25)
> Testing failed.  I received an Internal Server Error at 4:43 pm EST (look in bz
> log) while testing https://bz-web2-test.devel.redhat.com/show_bug.cgi?id=635129
> and doing a multiple selects on the "Extra Target Releases" and then submitting
> changes.       

Error in foreign key relationship with the bug_cf_extra_targetrelease table and the releases table. I have removed the foreign key and this works now. I will need to test a fix for this the next time I refresh the database on bz-db2-test.devel.redhat.com and do a new import.

Dave

Comment 27 David Lawrence 2010-11-24 14:05:40 UTC
Please test this now as the foreign key problem is fixed for now. Will have a proper fix when we do the next db refresh coming this week/early next.

Dave

Comment 29 Mike Harvey 2010-12-20 16:31:51 UTC
Now I have a question on what has been implemented?

I am not seeing Extra Target Releases field.  The comment 10/11 say "there is a Extra Target Releases field which allows more than one to be assigned to a bug report."  When I last tested on 10/18, I did see Extra Target Releases field and I was able to multiple select and save, however, at that time I received Internal Server Error do to Error in foreign key relationship with the bug_cf_extra_target release table and the releases table.

Now I'm testing and I don't see a filed called Extra Target Releases field.  I do see a filed called "Target Release" which seems to work without error, however, you cannot multiple select.  You can only select one release on the Target Release field.

Please clarify the solution.  Thanks.

Comment 30 Noura El hawary 2010-12-21 10:56:47 UTC
Hi Mike,

bz-web2 is not functioning properly at the moment.. Simon is taking is over and hopefully he will put a clean build for JIRA migration that contains all of the Jira requested functionality.

Cheers,
Noura

Comment 31 Noura El hawary 2011-01-14 15:03:41 UTC
Hi All,

Please note that this patch has been pushed to our staging bugzilla server:

https://partner-bugzilla.redhat.com/

In preparation for it to go live in production bugzilla servers next week. it will be great if you can take the time to test the functinality in partner-bugzilla and report any issues if found.

Thanks,
Noura

Comment 32 Simon Green 2011-02-02 14:09:04 UTC
This field is currently not in the jira branch. I plan to update this branch with the changes from the production branch, which will see the creation of this new field.

It will also see a fix to the cf_type field (which currently isn't being imported due to an error)

  -- simon

Comment 33 Simon Green 2011-02-08 08:30:30 UTC
Moving this back to onqa. Bug 587798 will deal with the migration. This code is now live (even on the production system). Not sure what the correct procedure is to mark it as closed.

Comment 34 Len DiMaggio 2011-03-09 18:10:00 UTC
Clean-up task from the March 9 2011 Bugzilla / BRMS Pilot Meeting

This bugzilla has been marked as ON_QA - we need to verify that the changes made to https://bz-web2-test.devel.redhat.com/ are acceptable and that this bugzilla can be closed. Please verify the change and close (or re-open) this bugzilla by March 15 2011. Thx!

Comment 35 Len DiMaggio 2011-03-10 14:20:18 UTC
"Target Release" field is now implemented.