Repository: fedora-infra/bodhi

Issue:
Build.ci_url seems to be unused
Build.ci_url seems to be unused.


Discussion:

Resolving patch:
diff --git a/bodhi/server/migrations/versions/a3580bdf5129_remove_the_ci_url_field_from_builds.py b/bodhi/server/migrations/versions/a3580bdf5129_remove_the_ci_url_field_from_builds.py
new file mode 100644
--- /dev/null
+++ b/bodhi/server/migrations/versions/a3580bdf5129_remove_the_ci_url_field_from_builds.py
@@ -0,0 +1,44 @@
+# Copyright (c) 2019 Sebastian Wojciechowski.
+#
+# 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.
+"""
+Remove the ci_url field from builds.
+
+Revision ID: a3580bdf5129
+Revises: 8e9dc57e082d
+Create Date: 2019-01-11 17:41:30.353652
+"""
+from alembic import op
+import sqlalchemy as sa
+
+
+# revision identifiers, used by Alembic.
+revision = 'a3580bdf5129'
+down_revision = 'f8a44498c806'
+
+
+def upgrade():
+    """Remove the ci_url from builds."""
+    op.drop_column('builds', 'ci_url')
+
+
+def downgrade():
+    """Add the ci_url to builds."""
+    op.add_column(
+        'builds',
+        sa.Column('ci_url', sa.UnicodeText, nullable=True)
+    )
diff --git a/bodhi/server/models.py b/bodhi/server/models.py
--- a/bodhi/server/models.py
+++ b/bodhi/server/models.py
@@ -1315,7 +1315,6 @@ class Build(Base):
     release_id = Column(Integer, ForeignKey('releases.id'))
     signed = Column(Boolean, default=False, nullable=False)
     update_id = Column(Integer, ForeignKey('updates.id'))
-    ci_url = Column(UnicodeText, default=None, nullable=True)
 
     release = relationship('Release', backref='builds', lazy=False)
 


Test patch:
diff --git a/bodhi/tests/server/test_models.py b/bodhi/tests/server/test_models.py
--- a/bodhi/tests/server/test_models.py
+++ b/bodhi/tests/server/test_models.py
@@ -203,13 +203,13 @@ def test__to_json_no_seen(self):
 
         self.assertEqual(
             j,
-            {'release_id': 1, 'ci_url': b.ci_url, 'epoch': b.epoch, 'nvr': b.nvr,
+            {'release_id': 1, 'epoch': b.epoch, 'nvr': b.nvr,
              'signed': b.signed, 'type': str(b.type.value)})
 
     def test_grid_columns(self):
         """Assert correct return value from the grid_columns() method."""
         self.assertEqual(model.Build.grid_columns(), ['nvr', 'release_id', 'signed',
-                                                      'ci_url', 'type', 'epoch'])
+                                                      'type', 'epoch'])
 
     def test_find_child_for_rpm(self):
         subclass = model.Package.find_polymorphic_child(model.ContentType.rpm)