Repository: fedora-infra/bodhi

Issue:
bodhi update id is too long
While testing epel modules in stg bodhi, we hit a issue with the size of the update id is being larger than 32 char length

```
Builds : Unable to create update.  (raised as a result of Query-invoked autoflush; consider using a _autoflush block if this flush is occurring prematurely)
(psycopg2.DataError) value too long for type character varying(32)

[SQL: INSERT INTO updates (autokarma, autotime, stable_karma, stable_days, unstable_karma, requirements, require_bugs, require_testcases, display_name, notes, type, status, request, severity, suggest, locked, pushed, critpath, close_bugs, date_submitted, date_modified, date_approved, date_pushed, date_testing, date_stable, alias, release_id, user_id, test_gating_status, from_tag) VALUES (%(autokarma)s, %(autotime)s, %(stable_karma)s, %(stable_days)s, %(unstable_karma)s, %(requirements)s, %(require_bugs)s, %(require_testcases)s, %(display_name)s, %(notes)s, %(type)s, %(status)s, %(request)s, %(severity)s, %(suggest)s, %(locked)s, %(pushed)s, %(critpath)s, %(close_bugs)s, %(date_submitted)s, %(date_modified)s, %(date_approved)s, %(date_pushed)s, %(date_testing)s, %(date_stable)s, %(alias)s, %(release_id)s, %(user_id)s, %(test_gating_status)s, %(from_tag)s) RETURNING ]
[parameters: {'autokarma': True, 'autotime': True, 'stable_karma': 3, 'stable_days': 0, 'unstable_karma': -3, 'requirements': '', 'require_bugs': True, 'require_testcases': True, 'display_name': '', 'notes': 'Test', 'type': 'unspecified', 'status': 'pending', 'request': None, 'severity': 'unspecified', 'suggest': 'unspecified', 'locked': False, 'pushed': False, 'critpath': False, 'close_bugs': True, 'date_submitted': datetime.datetime(2019, 11, 18, 18, 48, 47, 928343), 'date_modified': None, 'date_approved': None, 'date_pushed': None, 'date_testing': None, 'date_stable': None, 'alias': 'FEDORA-EPEL-MODULAR-2019-a63119524e', 'release_id': 36, 'user_id': 2990, 'test_gating_status': None, 'from_tag': None}]
(Background on this error at: )
```

We can reduce the update id length by changing the release name but thats something I wont prefer since it will not look good. If its really hard to increase the length, then I guess we dont have an option to rename the release.

From irc chat with @cverna 

```
[13:50:43] <+mboddu> cverna: https://paste.centos.org/view/bf304431 - any idea about this?
[13:51:07] <+mboddu> Oh, background info, I am trying to create an update in stg to test epel8 modules
[13:51:13] <+mboddu> And I got that error
[13:51:52] <+mboddu> I remember there was a limit on the build name or the update name in bodhi, but I thought it got fixed when we introduced modularity
[14:05:44] <cverna> mboddu: looks like FEDORA-EPEL-MODULAR-2019-a63119524e is 35 char while the db accept only a 32 char size
[14:05:56] <cverna> (psycopg2.DataError) value too long for type character varying(32)
[14:06:34] <cverna> but I am not 100% sure could you create a bodhi ticket, so that we can look at it properly
[14:06:38] <+mboddu> cverna: Can we increase the size? I dont think we can reduce the size, unless we rename the release which might not look good
[14:06:46] <+mboddu> Sure
[14:06:54] »» +mboddu creates a ticket
```

Koji build that I am testing is - https://koji.stg.fedoraproject.org/koji/buildinfo?buildID=1230372


Discussion:

Resolving patch:
diff --git a/bodhi/server/migrations/versions/ff834fa4f23e_increase_the_update_alias_size.py b/bodhi/server/migrations/versions/ff834fa4f23e_increase_the_update_alias_size.py
new file mode 100644
--- /dev/null
+++ b/bodhi/server/migrations/versions/ff834fa4f23e_increase_the_update_alias_size.py
@@ -0,0 +1,41 @@
+# Copyright (c) 2019 Clément Verna
+#
+# This file is part of Bodhi.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+"""
+Increase the update alias size.
+
+Revision ID: ff834fa4f23e
+Revises: d3f8bd499ecd
+Create Date: 2019-11-19 18:24:14.246099
+"""
+from alembic import op
+from sqlalchemy import Unicode
+
+
+# revision identifiers, used by Alembic.
+revision = 'ff834fa4f23e'
+down_revision = 'd3f8bd499ecd'
+
+
+def upgrade():
+    """Increase the size of the updates alias column."""
+    op.alter_column("updates", "alias", type_=Unicode(64))
+
+
+def downgrade():
+    """Brings back the size of the updates alias column to the old value."""
+    op.alter_column("updates", "alias", type_=Unicode(32))
diff --git a/bodhi/server/models.py b/bodhi/server/models.py
--- a/bodhi/server/models.py
+++ b/bodhi/server/models.py
@@ -1808,7 +1808,7 @@ class Update(Base):
     date_stable = Column(DateTime)
 
     # eg: FEDORA-EPEL-2009-12345
-    alias = Column(Unicode(32), unique=True, nullable=False)
+    alias = Column(Unicode(64), unique=True, nullable=False)
 
     # One-to-one relationships
     release_id = Column(Integer, ForeignKey('releases.id'), nullable=False)


Test patch: