Bug 431957 - Bugzilla data cleanup - bugs.resolution data cleanup
Bugzilla data cleanup - bugs.resolution data cleanup
Status: CLOSED CURRENTRELEASE
Product: Bugzilla
Classification: Community
Component: Bugzilla General (Show other bugs)
devel
All Linux
medium Severity medium (vote)
: ---
: ---
Assigned To: Tony Fu
:
Depends On:
Blocks: 431402
  Show dependency treegraph
 
Reported: 2008-02-07 20:06 EST by Tony Fu
Modified: 2013-06-24 00:15 EDT (History)
0 users

See Also:
Fixed In Version: 2.18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-10 14:14:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
clean up bugs.resolution data (376 bytes, text/plain)
2008-02-07 21:53 EST, Tony Fu
no flags Details
change resolution "FIXED" to "CURRENTRELEASE" (2.44 KB, text/plain)
2008-03-05 01:52 EST, Tony Fu
dkl: review+
Details
clean up bugs.resolution data (change "FIXED" to "CURRENTRELEASE") (2.33 KB, text/plain)
2008-03-05 20:11 EST, Tony Fu
no flags Details
clean up bugs.resolution data (change "FIXED" to "CURRENTRELEASE") (2.33 KB, text/plain)
2008-03-06 06:25 EST, Tony Fu
no flags Details

  None (edit)
Comment 1 Tony Fu 2008-02-07 21:51:46 EST
the definition of bugs.resolution in rh_bugzilla-2,18 is
resolution varchar(255) default NULL

In order to cleanup bugs.resolution data, we can change NULL value to ''(empty
string) and put '' as a valid value of resolution.value, like upstream bz3 does.

Please see attached sql queries.


Tony
Comment 2 Tony Fu 2008-02-07 21:53:47 EST
Created attachment 294298 [details]
clean up bugs.resolution data

If bugs.resolution is NULL, change it to ''.
Comment 3 Tony Fu 2008-03-03 01:45:05 EST
Problem:
Some bugs.resolution have the value of "FIXED", which is obsolete value of
resolution.value.

Possible solution:
1. Add "FIXED" as a valid value of resolution.value
or

2. map these bugs which has "FIXED" resolution value to a currently valid
resolution.vale.

Comment 4 David Lawrence 2008-03-04 10:31:36 EST
Comment on attachment 294298 [details]
clean up bugs.resolution data


>--- change the definition of bugs.resolution to the definition used
>--- in upstream code
>ALTER TABLE bugs MODIFY resolution varchar(64) default '';
>

To stay inline with upstream also set to NOT NULL.

ALTER TABLE bugs MODIFY resolution varchar(64) NOT NULL default '';
Comment 5 David Lawrence 2008-03-04 10:56:35 EST
(In reply to comment #3)
> Problem:
> Some bugs.resolution have the value of "FIXED", which is obsolete value of
> resolution.value.
> 
> Possible solution:
> 1. Add "FIXED" as a valid value of resolution.value

Rather not add new resolutions. The list is all really old bugs.

> 2. map these bugs which has "FIXED" resolution value to a currently valid
> resolution.vale. 

Lets map them to CURRENTRELEASE. You will need now to do this in a short perl
script that will add the proper bugs_activity entries for the FIXED ->
CURRENTRELEASE transistion. Also we will not send email for the changes.
Please create a script to make these changes and post here for review.

Thanks
Dave

Comment 6 Tony Fu 2008-03-05 01:51:24 EST
Dave,

Please review attached script.


Thanks,
Tony
Comment 7 Tony Fu 2008-03-05 01:52:44 EST
Created attachment 296857 [details]
change resolution "FIXED" to "CURRENTRELEASE"
Comment 8 David Lawrence 2008-03-05 15:18:49 EST
Comment on attachment 296857 [details]
change resolution "FIXED" to "CURRENTRELEASE"

>while ( my $bug_id = $sth->fetchrow_array() ) {
>
>    #change resolution "FIXED" to "CURRENTLEASE"
>    my $sth = $dbh->do(
>        "UPDATE bugs SET resolution='$NEW_RESOLUTION' WHERE bug_id=$bug_id" );

Just use $dbh->do() by itself instead of my $sth = $dbh->do();

>
>    #update bugs_activity table
>    $sth = $dbh->do(

Same here.

>        "INSERT INTO bugs_activity (who, 
>                                    bug_when, 
>                                    fieldid, 
>                                    added, 
>                                    removed,
>                                    bug_id) 
>              VALUES ( $admin_user_id, 
>                       NOW(), 
>                       $field_id, 
>                       '$NEW_RESOLUTION',
>                       '$OLD_RESOLUTION',
>                       $bug_id )"
>    );
>
>}

Looks good Tony. Please run this when you come in against the bugs database on
bz-db1-test.devel.redhat.com
and look at a couple bugs afterwards on bz-web2-test.devel.redhat.com to make
sure that the resolution looks correct
and that the history reflects the change properly.

If it looks good then I will have sysadmin run this on thursdays update.

Dave
Comment 9 Tony Fu 2008-03-05 20:09:39 EST
I have updated the script according to your review and run it against bugs
database on bz-db1-test.devel.redhat.com.  The result looks good on
bz-web2-test.devel.redhat.com.

Please see the new attachment for the updated script.


Tony
Comment 10 Tony Fu 2008-03-05 20:11:33 EST
Created attachment 296972 [details]
clean up bugs.resolution data (change "FIXED" to "CURRENTRELEASE")
Comment 11 David Lawrence 2008-03-05 21:37:07 EST
(In reply to comment #10)
> Created an attachment (id=296972) [edit]
> clean up bugs.resolution data (change "FIXED" to "CURRENTRELEASE")
> 

Thanks Tony. Script looks good. Will have sysadmin run it with next update.

Dave
Comment 12 Tony Fu 2008-03-06 06:23:50 EST
(In reply to comment #11)
> (In reply to comment #10)
> > Created an attachment (id=296972) [edit] [edit]
> > clean up bugs.resolution data (change "FIXED" to "CURRENTRELEASE")
> > 
> 
> Thanks Tony. Script looks good. Will have sysadmin run it with next update.
> 
> Dave

Dave,

I just noticed that the fielddefs.fieldid in bz_2.18 has been changed to
fielddefs.id in bz_3.  The script I posted before applied for bz_3 (using
fielddefs.id rather than fielddefs.fieldid), but our production db is still
using bz_2.18.

I attached the new script which should work for bz_2.18.


Tony
Comment 13 Tony Fu 2008-03-06 06:25:13 EST
Created attachment 297027 [details]
clean up bugs.resolution data (change "FIXED" to "CURRENTRELEASE")
Comment 14 Tony Fu 2008-03-06 06:26:31 EST
Comment on attachment 296972 [details]
clean up bugs.resolution data (change "FIXED" to "CURRENTRELEASE")

The script applies for bz3.0 only.
Comment 15 David Lawrence 2008-03-06 09:53:21 EST
(In reply to comment #12)
> (In reply to comment #11)
> > (In reply to comment #10)
> > > Created an attachment (id=296972) [edit] [edit] [edit]
> > > clean up bugs.resolution data (change "FIXED" to "CURRENTRELEASE")
> > > 
> > 
> > Thanks Tony. Script looks good. Will have sysadmin run it with next update.
> > 
> > Dave
> 

Good catch Tony. I completely missed that. We have a test database of live on
bz-db1-test.devel.redhat.com in the 'bugs2' database if you need to test it
there as well.

Thanks
Dave
> Dave,
> 
> I just noticed that the fielddefs.fieldid in bz_2.18 has been changed to
> fielddefs.id in bz_3.  The script I posted before applied for bz_3 (using
> fielddefs.id rather than fielddefs.fieldid), but our production db is still
> using bz_2.18.
> 
> I attached the new script which should work for bz_2.18.
> 
> 
> Tony
> 

Comment 16 David Lawrence 2008-03-10 14:14:20 EDT
This has been applied to the live database. Closing.

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