In comments, [Bb]ug #?<N> should be parsed as T<N+2000>: that is, "bug 323" would be rendered as T2323; or converted to "bug 323 (T2323)". Ideally, the full bugzilla syntax would be parsed/converted, see https://bzr.mozilla.org/bugzilla/4.4/view/head:/Bugzilla/Template.pm#L234
Potentially incomplete proposal:
| string in comment | to become |
| [Bb]ug 9123000 | bug 9123000 (T9125000) |
| [Bb]ug #9123000 | bug 9123000 (T9125000) |
| [Bb]ug #?9123000,? [Cc]omment #?123 | bug 9123000 `[[ https://old-bugzilla.wikimedia.org/show_bug.cgi?id=9123000#c123 | comment 123 ]]` (T9125000) |
| [Bb]ug 9123000#c123 | bug 9123000 `[[ https://old-bugzilla.wikimedia.org/show_bug.cgi?id=9123000#c123 | comment 123 ]]` (T9125000) |
| http://bugzilla.wikimedia.org/show_bug.cgi?id=9123000 | http://bugzilla.wikimedia.org/show_bug.cgi?id=9123000 (T9125000) |
| https://bugzilla.wikimedia.org/show_bug.cgi?id=9123000 | https://bugzilla.wikimedia.org/show_bug.cgi?id=9123000 (T9125000) |
| http://bugzilla.wikimedia.org/9123000 | http://bugzilla.wikimedia.org/9123000 (T9125000) |
| https://bugzilla.wikimedia.org/9123000 | https://bugzilla.wikimedia.org/9123000 (T9125000) |
| http://bugs.wikimedia.org/show_bug.cgi?id=9123000 | http://bugs.wikimedia.org/show_bug.cgi?id=9123000 (T9125000) |
| https://bugs.wikimedia.org/show_bug.cgi?id=9123000 | https://bugs.wikimedia.org/show_bug.cgi?id=9123000 (T9125000) |
| http://bugs.wikimedia.org/9123000 | http://bugs.wikimedia.org/9123000 (T9125000) |
| https://bugs.wikimedia.org/9123000 | https://bugs.wikimedia.org/9123000 (T9125000) |
----
Use case:
@Chasemp: For sentences imported from Bugzilla tickets in comments like
*** Bug 12345 has been marked as a duplicate of this bug. ***
(yes, those are three stars at the start of the line turned into a bullet point, meh, another cosmetic thingy)
I know that some folks like to look at duplicates because they might provide more information about a bug and clicking instead of manual copy and paste fiddling sounds easier...
>>! In T687#1140536, @chasemp wrote:
>>>! In T687#1140427, @Aklapper wrote:
>> @chasemp: If a volunteer (or me) wanted to work on this, what would be needed? Write code with regexes and set up a bot for it?
>> Could a volunteer work on this task (or if not fully, how much of this task)?
>
> I'm not sure how the bot fits in, but I am also thinking of this as a historical one-time fixup. I never had any plans for an ongoing translator. This is a straight mysql job in the first case which means simpler and more dangerous :)
>
> This really doesn't require me / privs to //write// the job, only to validate / run it. It could easily be worked on on phab-01 or whatever.
>
> The off-the-cuff break down to achieve this for
>
> **comments:**
>
> 1. Find all issues that were historically BZ using the custom reference field
> 2. use the task PHID to find all comment type transactions
> 3. use the comment transaction to find the actual comment itself
> 4. retrieve the comment content from the db (assuming we only want to mangle comments from before migration)
> 5. Run some kind of transform on the content (regex based changing Bug: Foo to Bug: Bar or whatever), and write the output back as the content.
> 6. Repeat for every comment on every BZ imported task
> 7. Wipe remarkup cache
>
> **descriptions**
>
> 1. Find all issues that were historically BZ using custom reference field
> 2. retrieve the task desription (is this stored as a transaction now or not, I'm not sure anymore?)
> 3. Perform same regexy type logic as above and update description
> 4. Repeat for every task from BZ
> 5. Wipe remarkup cache
>
>
> The good news is a basic framework for this would handle all cases, and it's not too hard to write this, just very time consuming to make sure it's not doing something awkward and untoward.