Summary: | Bugzilla: use cheap javascript hack to display short bug URLs in the address bar | ||
---|---|---|---|
Product: | Gentoo Infrastructure | Reporter: | Michał Górny <mgorny> |
Component: | Bugzilla | Assignee: | Bugzilla Admins <bugzilla> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | infra-bugs, kentnl, tsmksubc |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugzilla.mozilla.org/show_bug.cgi?id=1399115 https://bugs.gentoo.org/show_bug.cgi?id=608282 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Michał Górny
2017-09-10 15:21:46 UTC
LGTM. The one thing that probably needs changing in the source, is that it's still going to generate the long URLs in A HREF values. This is not as a easy as it seems, as places in the bugzilla source try and parse the URL to see if it contains 'show_bug.cgi': Bugzilla/Bug.pm: push @bug_ids, $text =~ /\b$urlbase_re\Qshow_bug.cgi?id=\E([0-9]+)(?:\#c[0-9]+)?/g; Bugzilla/BugUrl/Bugzilla.pm: return ($uri->path =~ /show_bug\.cgi$/) ? 1 : 0; Bugzilla/Template.pm: $text =~ s~\b(${urlbase_re}\Qshow_bug.cgi?id=\E([0-9]+)(\#c([0-9]+))?)\b extensions/InlineHistory/web/inline-history.js: var reBugId = /show_bug\.cgi\?id=(\d+)/; extensions/SecureMail/Extension.pm: my ($bug_id) = $href =~ /\Qshow_bug.cgi?id=\E(\d+)/; Doing the JS hack for now is good, along with silent rewrite. This is now deployed on bugstest instance for testing. This cheap hack produces URLs that are refused when pasted into a "See Also" when filing a new bug. Should I file a seperate bug for that? Fixing it on our end will be relatively simple. However, other Bugzillas will continue rejecting our short URLs. This is something we need to think about. I'll try reporting a bug upstream. |