Open Bug 473426 Opened 16 years ago Updated 2 years ago

Bugzilla should be able to produce its own tinyurl like shortcuts

Categories

(Bugzilla :: Query/Bug List, enhancement, P4)

enhancement

Tracking

()

People

(Reporter: Dolske, Unassigned)

References

Details

(Whiteboard: [wanted-bmo])

Attachments

(1 file)

URLs for bugzilla queries are ginormous, and difficult to share (because intermediate apps/cut'n'paste has a tendency to chop parts off). Firefox triage seems to have gone the route of using tinyurl.com to share Bugzilla search links as a result. That's a bit of a hassle to do, and (as Gavin points out) it means if tinyurl dies everyone's links will croak.

It would be nice if Bugzilla could do this itself. Eg, search results could have a <a href="/tiny/2d893n9c">Link to this search</a> link somewhere in the page.
Bugzilla 3.4 will considerably shorten search URLs, so this will become less important.
Severity: normal → enhancement
Priority: -- → P4
Having nice named links for shared queries would be a useful implementation of this, as well, like if you could do:
http://bugzilla.mozilla.org/queries/1.9.1-blockers
I guess there are 2 slightly different flavors (use cases) of this... One is just "here's a small link to my random bugzilla search". The other is the ability to have short URLs for shared searches. The former can just be a random ID for a specific query. The latter would need to be a stable URL yet allow the actual query to change.
Would having built-in functionality to do something like what https://www.squarefree.com/bookmarklets/mozilla.html#shorten_bug_query does fall under this bug?  Or should I file a separate bug on this?
Separate bug. A complex query would still be a long URL, even with the query minimized ("shortened" by that bookmarklet). This bug is for having short, basically fixed-length search URLs ala tinyurl, which would require a lookup to get the real search string from the provided URL.
OK.  Filed bug 486545.
As far as I can tell, all you need is the ability to share a saved search (which is already short) with everybody, not just with users having a Bugzilla account. So this is the same request as bug 400063.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
No, this isn't 400063. This is about having a simple way to generate very short URLs for passing around. People shouldn't have to "share" a search first, especially for cases where the search is only of ephemeral interest.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
I see no interest in implementing this upstream, besides the case described in comment 7. If the interest is ephemeral, you are free to delete your saved search after some time.
Is this bug moot with Omnijar?
alanjstr: pretty sure you're in the wrong bug!
Status: REOPENED → NEW
Whiteboard: [wanted-bmo]
Old bug, but I think it'd still be nice if we could do this.

Shared/saved searches are a partial solution, but that isn't as nice of a UX because it removes the immediacy of being able to easily/instantly share a search result. You have to jump through some hoops.

Having a short-url service built-in (that can translate a saved query url into the "normal" search query syntax) would make Bugzilla easier for group collaboration. Technically everything this accomplishes can be done already in other (more complicated) ways... this would just make it easier to do so.
My take on implementing this feature.
Assignee: query-and-buglist → dkl
Status: NEW → ASSIGNED
Attachment #669788 - Flags: review?(glob)
Attachment #669788 - Flags: review?(LpSolit)
Comment on attachment 669788 [details] [diff] [review]
Patch to add support for generating shortened search urls in buglist.cgi (v1)

Review of attachment 669788 [details] [diff] [review]:
-----------------------------------------------------------------

excellent, i like this very much :)

i don't think deleting all queries older than X days is the right thing to do, as we could be removing shortened urls which are still being used.  i think it would be better to remove urls which haven't been visited after X days.

nit: this code has trailing whitespaces

::: buglist.cgi
@@ +309,5 @@
> +    trick_taint($token);
> +    $buffer = $dbh->selectrow_array("SELECT long_url FROM short_search_url
> +                                      WHERE token = ?", undef, $token);
> +    $buffer || ThrowUserError('short_search_token_invalid');
> +    $cgi->delete('s', 'list_id');

you don't need to delete these params, $cgi->redirect doesn't use them.

@@ +472,5 @@
>          exit;
>      }
> +    elsif ($cgi->param('remtype') eq "shorturl") {
> +        $buffer = $params->canonicalise_query('cmdtype', 'remtype',
> +                                              'token', 'list_id');

you should also remove private_bugs from the query

@@ +488,5 @@
> +                                            WHERE long_url = ?",
> +                                          undef, $buffer);
> +        if (!$token) {
> +            $token = Bugzilla::Token::GenerateUniqueToken('short_search_url',
> +                                                         'token');

i think it would be easier to read if the token were all lowercase (tokens are case-insensitive).

@@ +900,2 @@
>      }
>  }

how hard would it be to trigger this warning if private products/components are involved, rather than for all private bugs?

::: template/en/default/global/messages.html.tmpl
@@ +143,5 @@
> +    [% END %]
> +    This <a href="buglist.cgi?s=[% token FILTER uri %]">link</a> is a shortened version of
> +    your original search URL. Copy and use it to pass to others so they may see similar
> +    [%+ terms.bug %] results based on their permissions. The link will be good for
> +    '[% constants.MAX_SHORT_URL_AGE FILTER html %] days'.

please display the full shortened url, rather than just linking to it:

This link is a shortened version of your original search URL:

  <a ...>http://example.com/buglist.cgi?s=abcdefghij</a>

::: template/en/default/global/user-error.html.tmpl
@@ +1565,5 @@
>        already exists.
> +
> +  [% ELSIF error == "short_search_token_invalid" %]
> +    [% title = "Short Search Token Invalid" %]
> +    The short search url token provided is not valid.

nit: s/token //
Attachment #669788 - Flags: review?(glob) → review-
(In reply to Byron Jones ‹:glob› from comment #15)
> i think it would be easier to read if the token were all lowercase (tokens
> are case-insensitive).

Tokens are case-sensitive on PostgreSQL.

About the lifetime of a tinyurl, I think one full year is too much. If you plan to share a query for so long, it's fine to ask you to create a saved search and share it. IMO, 30 days is long enough.
Attachment #669788 - Flags: review?(LpSolit)
(In reply to Frédéric Buclin from comment #16)
> About the lifetime of a tinyurl, I think one full year is too much. If you
> plan to share a query for so long, it's fine to ask you to create a saved
> search and share it. IMO, 30 days is long enough.

i disagree.  if the url is going to be used in documentation, for example, then it needs to last a lot longer than 30 days.

most url shortening sites never expire their urls -- tinyurl, goo.gl, bit.ly, is.gd all keep their urls "forever" (in fact i can't find one which doesn't expire urls, let alone after a very very short period like 30 days).
Assignee: dkl → query-and-buglist
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: