Closed Bug 815112 Opened 12 years ago Closed 12 years ago

Bug history mis-states which field was changed after script mass changed whiteboard=[orange] to keyword

Categories

(Developer Services :: General, task)

task
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: fox2mike)

References

Details

In bug 791758 a script was created to mass change a number of bugs:
1) Adding the keyword intermittent failure
2) Removing [(tb-)?orange] from the whiteboard

#1 was completed fine, however for #2 (performed in bug 814083), the bug history states things like:

{
 Nobody; OK to take it and work on it 2012-11-26 03:31:10 GMT
Keywords: <strikethrough>[orange]</strikethrough>
}

...when it should be s/Keywords/Whiteboard/

This appears to affect all bugs changed by the script.

Example bugs:
Bug 458688, bug 657235, bug 658745

We need to:
1) Fix the in-repo script (in case we re-use it for other migration projects)
2) Fix up the production bugs_activity table
Blocks: 790571
Holy wrong field id Batman!

Sorry bout that. Working on the necessary SQL to update the bugs_activity now
and will fix the migration script as well.

dkl
Assignee: nobody → dkl
Status: NEW → ASSIGNED
Migration script fixed.

IT, please run the following SQL on the BMO production database master:

mysql> UPDATE bugs_activity SET fieldid = 22 WHERE (removed = '[orange]' OR removed = '[tb-orange]') AND fieldid = 21 AND who = 1;

Thanks
dkl
Assignee: dkl → server-ops-devservices
Status: ASSIGNED → NEW
Component: Administration → Server Operations: Developer Services
Product: bugzilla.mozilla.org → mozilla.org
QA Contact: shyam
Version: Production → other
mysql> UPDATE bugs_activity SET fieldid = 22 WHERE (removed = '[orange]' OR removed = '[tb-orange]') AND fieldid = 21 AND who = 1;
Query OK, 3053 rows affected (0.47 sec)
Rows matched: 3053  Changed: 3053  Warnings: 0

Done.
Assignee: server-ops-devservices → shyam
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
the sql missed instances where the whiteboard contained other tags/text (3995 rows should have been updated).
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Sorry bout the incorrect SQL. No harm done, this new SQL sequence should pick up the extras.

mysql> SELECT COUNT(*) FROM bugs_activity WHERE (removed LIKE '%[orange]%' OR removed LIKE '%[tb-orange]%') AND fieldid = 21 AND who = 1;

Should be around 942, then...

mysql> UPDATE bugs_activity SET fieldid = 22 WHERE (removed LIKE '%[orange]%' OR removed LIKE '%[tb-orange]%') AND fieldid = 21 AND who = 1;

Make sure the rows affected is correct.

Thanks
dkl
(In reply to David Lawrence [:dkl] from comment #2)
> Migration script fixed.

I think it was only fixed in 4.0; presume needs landing on 4.2 too?
(In reply to Ed Morley [:edmorley, UTC, email: emorley@moco] from comment #6)
> (In reply to David Lawrence [:dkl] from comment #2)
> > Migration script fixed.
> 
> I think it was only fixed in 4.0; presume needs landing on 4.2 too?

Thanks

Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bmo/4.2                  
modified contrib/reorg-tools/migrate_orange_bugs.pl
Committed revision 8433
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
The SQL in comment 5 still needs to be run, cases like bug 770451 are not fixed.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Done.

mysql> SELECT COUNT(*) FROM bugs_activity WHERE (removed LIKE '%[orange]%' OR removed LIKE '%[tb-orange]%') AND fieldid = 21 AND who = 1;
+----------+
| COUNT(*) |
+----------+
|      946 |
+----------+
1 row in set (0.34 sec)

mysql> UPDATE bugs_activity SET fieldid = 22 WHERE (removed LIKE '%[orange]%' OR removed LIKE '%[tb-orange]%') AND fieldid = 21 AND who = 1;
Query OK, 946 rows affected (0.29 sec)
Rows matched: 946  Changed: 946  Warnings: 0
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Looks good thank you :-)
(In reply to Ed Morley [:edmorley, UTC, email: emorley@moco] from comment #8)
> The SQL in comment 5 still needs to be run, cases like bug 770451 are not
> fixed.

My bad. I closed it unintentionally.
Component: Server Operations: Developer Services → General
Product: mozilla.org → Developer Services
You need to log in before you can comment on or make changes to this bug.