Increase the max length of bug aliases

RESOLVED FIXED in Bugzilla 5.0

Status

()

Bugzilla
Database
--
enhancement
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: Adam Williamson, Assigned: Simon Green)

Tracking

unspecified
Bugzilla 5.0

Details

(Whiteboard: [Fixed by blocker])

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
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?
(Reporter)

Comment 1

4 years ago
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

4 years ago
An alias which is 200 characters long would be ridiculous. I also think the alias should remain short, 12 years after myk.
OS: Linux → All
Hardware: x86_64 → All
Summary: Alias length limit of 20 characters is too short, please raise it → Increase the max length of bug aliases
(Reporter)

Comment 3

4 years ago
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

4 years ago
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?
Assignee: general → mtyson
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #710051 - Flags: review?

Updated

4 years ago
Component: Bugzilla-General → Database
Keywords: relnote
Target Milestone: --- → Bugzilla 5.0
Comment on attachment 710051 [details] [diff] [review]
Set alias length to 40 characters.

Adding a reviwer to the patch.
Attachment #710051 - Flags: review? → review?(dkl)
(Assignee)

Comment 6

4 years ago
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
Attachment #710051 - Flags: review?(dkl) → review-

Comment 7

4 years ago
Red Hat has implemented this feature request locally.
Assignee: mtyson → nobody
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX

Updated

4 years ago
Keywords: relnote
Target Milestone: Bugzilla 5.0 → ---

Comment 8

3 years ago
This has been implemented in bug 1012506.
Assignee: nobody → simon
Depends on: 1012506
Resolution: WONTFIX → FIXED
Whiteboard: [Fixed by blocker]
Target Milestone: --- → Bugzilla 5.0
You need to log in before you can comment on or make changes to this bug.