Ticket #6753 (new defect)
Opened 4 years ago
Last modified 2 years ago
bugzilla2trac.py: attachment.isobsolete has to be ignored
| Reported by: | mbertheau@… | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | not applicable |
| Component: | contrib | Version: | devel |
| Severity: | normal | Keywords: | bugzilla2trac |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
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
comment:1 Changed 4 years ago by anonymous
comment:2 Changed 4 years ago by anonymous
Other than that, the script runs correctly on bugzilla 2.32.2. I also had to set sys.setdefaultencoding('utf8').
comment:4 Changed 4 years ago by anonymous
Actually the attachments were not imported correctly, see #6792.
comment:5 Changed 4 years ago by jruigrok
- Owner changed from jonas to jruigrok
- Status changed from new to assigned
comment:6 Changed 4 years 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.
comment:7 Changed 2 years ago by jruigrok
- Owner jruigrok deleted
- Status changed from assigned to new
comment:8 Changed 2 years ago by cboos
- Keywords bugzilla2trac added
- Milestone changed from next-minor-0.12.x to not applicable
comment:9 Changed 2 years ago by cboos
- Component changed from general to contrib


