Edgewall Software

Ticket #6753 (assigned defect)

Opened 10 months ago

Last modified 5 months ago

bugzilla2trac.py: attachment.isobsolete has to be ignored

Reported by: mbertheau@… Owned by: jruigrok
Priority: normal Milestone: 0.11-retriage
Component: general Version: devel
Severity: normal Keywords:
Cc:

Description

This property is per-attachment in bugzilla, but the script imports it per-ticket. A change of the isobsolete field of two attachments at the same time in bugzilla will lead to a unique constraint violation on the trac side, causing the import to fail.

Adding the field to IGNORED_ACTIVITY_FIELDS solves the problem and allows the import to continue.

Attachments

Change History

Changed 10 months ago by anonymous

-IGNORED_ACTIVITY_FIELDS = ["everconfirmed"]
+IGNORED_ACTIVITY_FIELDS = ["everconfirmed", "attachments.isobsolete"]

Changed 10 months ago by anonymous

Other than that, the script runs correctly on bugzilla 2.32.2. I also had to set sys.setdefaultencoding('utf8').

Changed 10 months ago by eblot

  • milestone changed from 0.11 to 0.11.1

should not block 0.11

Changed 10 months ago by anonymous

Actually the attachments were not imported correctly, see #6792.

Changed 7 months ago by jruigrok

  • owner changed from jonas to jruigrok
  • status changed from new to assigned

Changed 5 months ago by thomas.klenner@…

I had a similar problem when importing from Bugzilla 2.18.4 but solved it differently:

My bugzilla DB contained three changes of type "attachments.isobsolete" for the same bug at the same time:

mysql> SELECT * FROM bugs_activity WHERE bug_id = 1567 order by bug_when;
+--------+-----------+-----+---------------------+---------+----------+----------+
| bug_id | attach_id | who | bug_when            | fieldid | added    | removed  |
+--------+-----------+-----+---------------------+---------+----------+----------+
|   1567 |       182 |  15 | 2007-05-15 16:48:28 |      27 | 1        | 0        | 
|   1567 |       183 |  15 | 2007-05-15 16:48:28 |      27 | 1        | 0        | 
|   1567 |       184 |  15 | 2007-05-15 16:48:28 |      27 | 1        | 0        | 
+--------+-----------+-----+---------------------+---------+----------+----------+

In the bugzilla2trac.py script, I noticed some code for the case that

# cc  sometime appear in different activities with same time

I changed the script and added the same handling for field_name = "attachments.isobsolete":

   # cc and attachments.isobsolete sometime appear 
   # in different activities with same time
   if ( (field_name == "cc" or field_name == "attachments.isobsolete") \
      ...

After this change, the script successfully imported my bugzilla tickets and attachments.

Add/Change #6753 (bugzilla2trac.py: attachment.isobsolete has to be ignored)

Author



Change Properties
<Author field>
Action
as assigned
as The resolution will be set. Next status will be 'closed'
to The owner will change from jruigrok. Next status will be 'new'
 
Note: See TracTickets for help on using tickets.