summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/unit/test_auth.py3
-rw-r--r--zuul/driver/sql/alembic/versions/cfc0dc45f341_change_patchset_to_string.py10
2 files changed, 12 insertions, 1 deletions
diff --git a/tests/unit/test_auth.py b/tests/unit/test_auth.py
index 95ccdb4a2..6d35d761e 100644
--- a/tests/unit/test_auth.py
+++ b/tests/unit/test_auth.py
@@ -70,6 +70,9 @@ def mock_get(url, params=None, **kwargs):
def mock_urlopen(url, *args, **kwargs):
+ if hasattr(url, 'full_url'):
+ # Like a urllib.Request object
+ url = url.full_url
if url == ("https://my.oidc.provider/auth/realms/realm-one/"
"protocol/openid-connect/certs"):
io = StringIO()
diff --git a/zuul/driver/sql/alembic/versions/cfc0dc45f341_change_patchset_to_string.py b/zuul/driver/sql/alembic/versions/cfc0dc45f341_change_patchset_to_string.py
index 3fde8e545..e8226837b 100644
--- a/zuul/driver/sql/alembic/versions/cfc0dc45f341_change_patchset_to_string.py
+++ b/zuul/driver/sql/alembic/versions/cfc0dc45f341_change_patchset_to_string.py
@@ -17,11 +17,19 @@ import sqlalchemy as sa
BUILDSET_TABLE = 'zuul_buildset'
+# Note: the following migration does not do what it was intended to do
+# (change the column type to a string). It was introduced with an
+# error which instead caused the nullable flag to be set to true (even
+# though it was already set), effectively making it a no-op. To
+# maintain compatibility with later versions of alembic, this has been
+# updated to explicitly do now what it implicitly did then. A later
+# migration (19d3a3ebfe1d) corrects the error and changes the type.
+
def upgrade(table_prefix=''):
op.alter_column(table_prefix + BUILDSET_TABLE,
'patchset',
- sa.String(255),
+ nullable=True,
existing_nullable=True,
existing_type=sa.Integer)