bug links in hugin sourceforge bug import are linkified to launchpad bugs with the old sourceforge bug number

Bug #681268 reported by rew
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

The hugin sourceforge bugtracker was recently imported into Launchpad.

The comments sometimes mention this is related to bug 12345 which launchpad
automatically recognizes and makes into a link. Those bugnumbers however refer to a bug number at sourceforge. So the link becomes invalid (nonexistent bug number).

In all likelyhood the bug number referenced is also in the set-to-be-imported.

So while importing a table of old->new bug numbers should be built. Then a second pass can modify the comments that reference bug numbers (use the same regexp that the system uses to recognize/linkify bugnumers!).

Do not confuse with bug 505760, about bug links in comments from bug watches rather than imported projects.

Tags: lp-bugs
Revision history for this message
Gavin Panella (allenap) wrote :

This is an interesting idea. I think it would require quite a lot of work in the bug import code (to allocate bugs first, and thus their bug IDs, then rewrite descriptions, then rewrite comments), but it is quite doable.

Changed in malone:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
rew (r-e-wolff) wrote :

Could be as simple as: write out one file with the translations, during the import. (newnumber oldnumber)

Afterwards you change each line into a "s/bug <oldnumber>/bug <newnumber>/", and use that
as a sedscript.
Then you iterate on the first column of that file, and pull each comment in turn through the sed script. If changed, you put the comment back into the database as changed by the script....

Complication is you might have an "immutable" flag on the comments in the database. If that's so, create a table where the comments go temporarily and pull them through the script into the real database....

Revision history for this message
Gavin Panella (allenap) wrote :

Yes, that's about what I had in mind.

I had two alternative ideas also:

1. The provider of the export XML could add markup to comments and
   descriptions, so that they have control over which bug references
   are translated. A comment like:

     This is related to bug 123456

   might look like the following in the export XML:

     <comment>
       <sender>...</sender>
       <date>...</date>
       <title>...</title>
       <text>
         This is related to
         <ref bug="123456">bug 123456</ref>
       </text>
     </comment>

   (Maybe use XLink.)

2. Extend the linkifying code in Launchpad to match bug nicknames as
   well as numbers. Imported bugs get nicknames, and these are set in
   the import XML, so a reference to bug 123456 could be changed - by
   the provider of the export or the importer - to, say, bug sf-56626,
   and this would be linkified in Launchpad the same as any other bug
   reference.

Revision history for this message
rew (r-e-wolff) wrote :

That last one sounds like a separate useful feature.... You can add aliases to a bug like: hugin-crashes-when-opening-preview, which is easier to remember than bug 123456 ...

On import you add alias sf-112233 to each bug, and the recognizable bugs immediately become sf-112233... Single pass! (but extra code, possibly a performance hit for the whole site!).

Revision history for this message
rew (r-e-wolff) wrote :

(damn, I should've used the invented alias bug podcast-crashes-amarok as the example name for bug 123456.... :-) )

Revision history for this message
Yuv (yuv) wrote :

I bumped recently into an instance of this problem: https://bugs.launchpad.net/hugin/+bug/679170/comments/5

Gavin's second solution in comment #3 above seems the most sensible to me:
- Extend the linkifying code in Launchpad to match bug nicknames as well as numbers
- Use the same filter as in the linkifying code to identify the instances in the import file that would trigger linkification.
- break the linkification of the suspected SF bug and add a new reference, e.g. transform "bug 123456" into "_bug_ 123456 likely to have been imported as sf-123456" (assuming the linkification code is not triggered by _bug_ 123456)

summary: - sourceforge import of hugin didn't translate bug numbers.
+ bug links in hugin sourceforge bug import are linkified to launchpad
+ bugs with the old sourceforge bug number
Changed in launchpad:
importance: Medium → Low
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.