Page MenuHomePhabricator

Respect programmatic (custom regex) links in Bugzilla comments
Open, LowestPublic

Description

Some strings are converted to links in comments at bugzilla.wikimedia.org. This is a functionality that comes out of the box in Bugzilla to mark links to other Bugzilla reports, ans the we have extended in order to link to i.e. Gerrit changes and wiki pages.

These conversions can be done by a bot. We need to define which strings need to be converted in links.

Also, we need to agree when to run the bot. Since this is a time consuming activity for a bot, and these links are not critical, probably the best idea is to reopen Phabricator after the migration with this task pending, and then let the bot do the changes at their own pace. Users will see the plain text first, then at some point the links.

Event Timeline

Qgil created this task.Oct 24 2014, 1:56 PM
Qgil raised the priority of this task from to Normal.
Qgil updated the task description. (Show Details)
Qgil added a project: Bugzilla-Preview.
Qgil changed Security from none to None.
Qgil added subscribers: Qgil, Anomie.

I think this task requires a working test in Bugzilla-Preview showing how the bot runs the changes, without having to go through the 7000 tasks. Then we would remove this task from this project and keep it open for Bugzilla-Migration

can we link to example issues in bugzilla that demonstrate this (in general this is the best approach) as otherwise I'm half guessing at usage based on regex which is never easy.

In T850#14408, @chasemp wrote:

can we link to example issues in bugzilla that demonstrate this

That code file includes example links

luser added a subscriber: luser.Oct 24 2014, 3:56 PM
This comment was removed by luser.

yes but I still need issues to test against to validate :)

In T850#14483, @chasemp wrote:

yes but I still need issues to test against to validate :)

https://bugzilla.wikimedia.org/show_bug.cgi?id=72485

IMHO links created to Gerrit and CodeReview are more important here to consider.
This refers to imported tickets only. Idea is to convert them into full URLs adter importing from BZ to Phab via a bot.

Note this task does not refer to tasks/comments created in the future (totally separate task) - people have a comment preview in Phab (not existing in BZ) and should really use full URLs instead.

I understand a bit better now that andre explained it to me. This is a valuable thing to do, but is not the same as the 'Bug 1' translation into a link instance that is standard fair for bugzilla and equivalent to the T1 style references.

https://bugzilla.wikimedia.org/show_bug.cgi?id=72485#c1

These are transforms that are overlayed on the source material for purposes of display only. Mangling the source text from bugzilla would be a drastic and not equivalent step to mimic this behavior. This is essentially custom remarkup behavior that does not exist now, and I don't know about implementing it.

I think this will involve more investigation but for strictly migration oriented steps this doesn't make sense.

@mmodell may know more about this idea

Qgil added a comment.Oct 24 2014, 6:11 PM

There is no need to touch Phabricator's Remarkup.

Just like MediaWiki bots improve the content of articles, Phabricator bots could take care of converting these string patterns in the corresponding http links modifying the comments where these links appear.

Qgil added a comment.Oct 24 2014, 6:27 PM

Proposal: the Phabricator team takes care of writing the bot for transforming the relatively simple RT links and demoes it in bugzillapreview. Then hopefully others will write bots for the other cases, that would not be blockers for the Bugzilla migration.

Aklapper renamed this task from Respect programmatic links in Bugzilla comments to Respect programmatic (custom regex) links in Bugzilla comments.Oct 24 2014, 7:23 PM
Qgil added a comment.Oct 24 2014, 10:41 PM

I have created subtasks for Gerrit, RT, and wiki pages, because they are different problems with different priorities.

Looking at https://bugzilla.wikimedia.org/show_bug.cgi?id=72485, do we need to do anything about these?

replacerCR: r12345
replacerCVE: CVE-2013-7106

CVE: No, rather uncommon. Could still be done at some point if someone really wanted.
Code Review: Some people like to look up very old changes, so I don't really know. Some veterans might be able to provide input.

Qgil lowered the priority of this task from Normal to Low.Oct 25 2014, 7:31 AM
He7d3r added a subscriber: He7d3r.Oct 25 2014, 10:15 PM
Qgil added a comment.Oct 28 2014, 11:20 AM

While it is clear that we want to do T687 with the migration script, I wonder whether it wouldn't it be better to leave the rest of cases as a post-migration fix done by a bot.

Let's discuss this in order to decide whether this task including the other blockers should be removed from Bugzilla-Preview.

Qgil raised the priority of this task from Low to Normal.Oct 29 2014, 9:21 PM
Qgil edited projects, added Phabricator; removed Bugzilla-Migration, Bugzilla-Preview.

This task is not essential, it has a risk of overcomplicating the migration process, and it can be done afterward either with direct changes to the database or a bot.

Qgil lowered the priority of this task from Normal to Low.Nov 7 2014, 10:49 AM
fbstj awarded a token.Nov 24 2014, 2:24 PM
jayvdb raised the priority of this task from Low to Normal.Nov 29 2014, 4:52 PM
jayvdb added a subscriber: jayvdb.

I dont see a subtask for linking r12345 to CodeReview; either autolinking or replacing with real links. These are very common in the bugzilla database.

I ran into this on T12334 , and needed to manually construct the URL to see the patch that was applied, in order to answer the query on T74941.

Not providing links reduces the usefulness of old bugs, especially for newcomers who do not know all of the previous SCMs, migrations and how to manually skip between systems which were not properly migrated.

Qgil added a comment.Nov 29 2014, 9:08 PM

@jayvdb, can you please create a task and add it as blocker of this one?

If someone wants to help pushing this forward, looking at the covered cases in the subtasks (and editing the task description) or even coming up with regexes covering these cases is very welcome.

Aklapper lowered the priority of this task from Normal to Lowest.Mar 3 2015, 12:39 PM

(Adjusting priority to the priority values of the blocking tasks.)

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptMay 16 2016, 9:34 PM