Last Comment Bug 833611 - Increase the max length of bug aliases
: Increase the max length of bug aliases
Status: RESOLVED FIXED
[Fixed by blocker]
:
Product: Bugzilla
Classification: Server Software
Component: Database (show other bugs)
: unspecified
: All All
: -- enhancement (vote)
: Bugzilla 5.0
Assigned To: mail
: default-qa
Mentors:
Depends on: 1012506
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-22 16:07 PST by Adam Williamson
Modified: 2014-11-19 15:45 PST (History)
3 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Set alias length to 40 characters. (2.84 KB, patch)
2013-02-04 21:44 PST, Matt Tyson
mail: review-
Details | Diff | Review

Description Adam Williamson 2013-01-22 16:07:07 PST
I work in Fedora QA. We use alias names to keep track of our blocker and freeze exception tracker bugs. We recently came up with a scheme for improving the alias names we use. Unfortunately, it results in aliases as long as 23 characters. The scheme is:

FXXAlphaBlocker
FXXAlphaFreezeException
FXXBetaBlocker
FXXBetaFreezeException
FXXFinalBlocker
FXXFinalFreezeException

where XX is the Fedora release number. The Alpha and Final freeze exception aliases are 23 characters (and will go to 24 when we reach Fedora 100 ;>).

So far as I can tell there is no technical reason for the 20 character limit, it is an entirely arbitrary call that was made in 2001:

https://bugzilla.mozilla.org/show_bug.cgi?id=99203#c2

Asa asked if aliases should be limited in length, Myk said they should and recommended 'something small' on the grounds that "Aliases are supposed to be easy to remember, so I can't imagine the right limit being much more than that." He suggested 20 characters, and without there really being any further explicit discussion, this number was incorporated into the proposed patches and eventually the final accepted one, and hence into BZ, where it has remained for the last 12 years.

I submit that our proposed aliases represent a perfectly reasonable use case and hence the 'right' limit is higher than 20 characters - at least 25 or 30. I really can't see any reason for this kind of arbitrary restriction, though - why not limit it to something really big, but below a level which could cause problems for the server? 200 characters or something?
Comment 1 Adam Williamson 2013-01-22 16:07:45 PST
This limit is present in all versions of Bugzilla since that patch was applied, I'm pretty sure. I've checked it's still present in current bzr trunk.
Comment 2 Frédéric Buclin 2013-01-22 16:39:21 PST
An alias which is 200 characters long would be ridiculous. I also think the alias should remain short, 12 years after myk.
Comment 3 Adam Williamson 2013-01-22 17:05:55 PST
I just remembered our ARM team have their own tracker bugs which follow the same name scheme but add ARM, so they might go up to 26:

FXXARMAlphaFreezeException

so we could do with a limit of at least 26.
Comment 4 Matt Tyson 2013-02-04 21:44:57 PST
Created attachment 710051 [details] [diff] [review]
Set alias length to 40 characters.

This patch sets the alias length to 40 characters.
Would this length be acceptable?
Comment 5 Sunil Joshi [:sjoshi] 2013-07-26 12:15:40 PDT
Comment on attachment 710051 [details] [diff] [review]
Set alias length to 40 characters.

Adding a reviwer to the patch.
Comment 6 mail 2013-07-28 18:55:34 PDT
Comment on attachment 710051 [details] [diff] [review]
Set alias length to 40 characters.

I know I'm not allowed to r+ this patch, but nothing prevents from r-'ing it.

>+    if (length($alias) > 40) {
>         ThrowUserError("alias_too_long");

You need to alter the error message in template/en/default/global/user-error.html.tmpl

>=== modified file 'Bugzilla/Install/DB.pm'
>--- Bugzilla/Install/DB.pm	2013-01-07 20:13:30 +0000
>+++ Bugzilla/Install/DB.pm	2013-02-05 05:39:24 +0000
>@@ -703,6 +703,9 @@
>     # 2012-12-23 LpSolit@gmail.com - Bug 824361
>     _fix_longdescs_indexes();
> 
>+    # 2013-02-05 mtyson@redhat.com - Bug 833611
>+    _update_aliases_table();
>+
>     ################################################################
>     # New --TABLE-- changes should go *** A B O V E *** this point #
>     ################################################################
>@@ -3787,6 +3790,19 @@
>     $dbh->bz_alter_column('quips', 'quip', { TYPE => 'varchar(512)', NOTNULL => 1});
> }
> 
>+# Bug 833611 - Increase the alias length to 40 characters.
>+sub _update_aliases_table {
>+    my $dbh = Bugzilla->dbh;
>+
>+    my $column_info = $dbh->bz_column_info('bugs','alias');
>+
>+    if ($column_info->{TYPE} =~ m/varchar\(([0-9]*)\)/) {
>+        if($1 < 40) {
>+            $dbh->bz_alter_column('bugs_aliases', 'alias', {TYPE => 'varchar(40)'});

Is that some Red Hat specific code in your patch? :o

>+        }
>+    }
>+}
>+

All the above can be replaced with:
+    # 2013-02-05 mtyson@redhat.com - Bug 833611
+    $dbh->bz_alter_column('bugs', 'alias', {TYPE => 'varchar(40)'});

Bugzilla will happily do nothing if the column is already 40 characters long.

  -- simon
Comment 7 Matt Tyson 2013-07-28 19:13:03 PDT
Red Hat has implemented this feature request locally.
Comment 8 Frédéric Buclin 2014-11-19 15:45:54 PST
This has been implemented in bug 1012506.

Note You need to log in before you can comment on or make changes to this bug.