The patch: https://gerrit.wikimedia.org/r/#/c/166283/
The requirements:
* Single ticket URLs to map:
** /bugzilla.wikimedia.org/23223
** /bugzilla.wikimedia.org/show_bug.cgi?id=23223
** /bugs.wikimedia.org/23223
** /bugs.wikimedia.org/show_bug.cgi?id=23223
** Links that should go to the Phabricator homepage https://bugzillaphabricator.wikimedia.org/enter_bug.cgi (which can have additional URL parameters to ignore) should go to https://secure.phabricator.com/maniphest/task/create/ :
* https://** //(bugs|bugzilla).wikimedia.org/indexenter_bug.cgi should go to https://phabricator.wikimedia.org/(which can have additional URL parameters to ignore)
* https://** //(bugs|bugzilla).wikimedia.org/query.cgi (which can have additional URL parameters to ignore) should go to https://phabricator.wikimedia.org/maniphest/query/index.cgi
* https://bugzilla.wikimedia.org/reports.cgi (which can have additional URL parameters to ignore) and https://bugzilla.wikimedia.org/report.cgi (which can have additional URL parameters to ignore) and https://bugzilla* //(bugs|bugzilla).wikimedia.org/chartquery.cgi (which can have additional URL parameters to ignore) should all go to https://phabricator.wikimedia.org/maniphest/report/
* https://** //(bugs|bugzilla).wikimedia.org/describecomponenreports.cgi (which can have additional URL parameters to ignore) should go to https://phabricator.wikimedia.org/project/query/all/
* Attachment URLs like https://bugzilla.wikimedia.org/attachment.cgi?id=12345 will be ignored and fall back to generic https://phabricator* //(bugs|bugzilla).wikimedia.org/. Rather uncommon plus we won't keep the numbering scheme. Still possible to query for the attachment ID manually in Phabricator though.report.cgi (which can have additional URL parameters to ignore)
* https://bugzilla.wikimedia.org/buglist.cgi can have dozens of URL parameters, and can have hundreds of parameters. It will be ignored and fall back to generic https://phabricator* //(bugs|bugzilla).wikimedia.org/. Using buglist.cgi with a bug_id parameter plus a number of bug IDs with commata inbetween (to get a static list of tickets listed) probably isn't too common. Queries for a specific status (open tickets) in some specific products/components are probably more likely, but I don't consider it doable to have a mapping between Bugzilla products and components and Phab projects somewhere publicly stored, which could be accessed to "on-the-fly" turn that unlimited number of potential URL parameters into some query that more (or rather less) would even show similar results in Phabricator. The way search results (and their URLs) are created are just too different. Proposing WONTFIX for this part (though I'd be really happy to be proven wrong). This also applies to Bugzilla's "saved searches" functionality as it also ends up on buglist.cgiorg/chart.cgi (which can have additional URL parameters to ignore)
* https:* //(bugs|bugzilla).wikimedia.org/describecomponents.cgi (which can have additional URL parameters to ignore)
** //(bugs|bugzilla).wikimedia.org/attachment.cgi?id=12345 (rather uncommon plus we won't keep the numbering scheme. Still possible to query for the attachment ID manually in Phabricator though.)
** //bug-attachment.wikimedia.org/attachment.cgi (which can have additional URL parameters to ignore) should
* //(bugs|bugzilla).wikimedia.org/buglist.cgi (always with additional URL parameters) will redirect to https://phabricatorbugzilla.wikimedia.org/buglist.cgi while keeping its URL parameters intact. The banner (T1234) will tell people that what they see is outdated. More info, just for the records: Such URLs can have dozens of URL parameters, e.g. using buglist.cgi with a bug_id parameter plus a number of bug IDs with commata inbetween (to get a static list of tickets listed). Queries for a specific status (open tickets) in some specific products/components are common but we won't have a mapping between Bugzilla products and components and Phab projects somewhere publicly stored, as URL parameters are fundamentally different in Phabricator. This also applies to Bugzilla's "saved searches" functionality - people will still be able to see and edit their search parameters in old-bugzilla and try to convert them manually into Phabricator.