← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~ack/maas:require-postgres-14 into maas:master

 

Alberto Donato has proposed merging ~ack/maas:require-postgres-14 into maas:master.

Commit message:
bump minimum required PostgreSQL version to 14

This also drops the deprecation about versions < 14



Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~ack/maas/+git/maas/+merge/437499
-- 
Your team MAAS Maintainers is requested to review the proposed merge of ~ack/maas:require-postgres-14 into maas:master.
diff --git a/src/maasserver/deprecations.py b/src/maasserver/deprecations.py
index f31d5f2..739df44 100644
--- a/src/maasserver/deprecations.py
+++ b/src/maasserver/deprecations.py
@@ -1,7 +1,6 @@
 # Copyright 2020 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
-from maasserver.utils.orm import postgresql_major_version
 from provisioningserver.logger import LegacyLogger
 
 DEPRECATION_URL = "https://maas.io/deprecations/{id}";
@@ -27,24 +26,13 @@ class Deprecation:
         )
 
 
-# all known deprecation notices
-DEPRECATIONS = {
-    "POSTGRES_OLDER_THAN_14": Deprecation(
-        id="MD3",
-        since="3.3",
-        description="The PostgreSQL version in use is older than 14.",
-        link_text="How to upgrade the PostgreSQL server",
-    )
-}
+# all known deprecation notices, mapping symbolic name to the deprecation info
+DEPRECATIONS: dict[str, Deprecation] = {}
 
 
-def get_deprecations():
+def get_deprecations() -> list[Deprecation]:
     """Return a list of currently active deprecation notices."""
-
-    deprecations = []
-    if postgresql_major_version() < 14:
-        deprecations.append(DEPRECATIONS["POSTGRES_OLDER_THAN_14"])
-    return deprecations
+    return []
 
 
 def log_deprecations(logger=None):
diff --git a/src/maasserver/plugin.py b/src/maasserver/plugin.py
index e38437c..b1349be 100644
--- a/src/maasserver/plugin.py
+++ b/src/maasserver/plugin.py
@@ -29,7 +29,7 @@ from provisioningserver.utils.debug import (
 
 log = LegacyLogger()
 
-PGSQL_MIN_VERSION = 12
+PGSQL_MIN_VERSION = 14
 
 
 class UnsupportedDBException(Exception):
diff --git a/src/maasserver/tests/test_deprecations.py b/src/maasserver/tests/test_deprecations.py
index 7794f88..45adf38 100644
--- a/src/maasserver/tests/test_deprecations.py
+++ b/src/maasserver/tests/test_deprecations.py
@@ -1,7 +1,6 @@
 from maasserver import deprecations
 from maasserver.deprecations import (
     Deprecation,
-    DEPRECATIONS,
     get_deprecations,
     log_deprecations,
     sync_deprecation_notifications,
@@ -16,12 +15,6 @@ class TestGetDeprecations(MAASServerTestCase):
     def test_empty(self):
         self.assertEqual(get_deprecations(), [])
 
-    def test_old_postgres_version(self):
-        self.patch(deprecations, "postgresql_major_version").return_value = 12
-        self.assertEqual(
-            get_deprecations(), [DEPRECATIONS["POSTGRES_OLDER_THAN_14"]]
-        )
-
 
 class TestLogDeprecations(MAASTestCase):
     def test_log_deprecations(self):

Follow ups