Repository: octodns/octodns-gcore (language: python)

Issue:
Add root NS support
GCore supports root NS records out-of-the-box.
Add the `SUPPORTS_ROOT_NS = True` to the provider.

PR will follow.


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 441f817..4cb81d6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## v0.0.5 - 2023-12-xx - Root NS support
+
+* Add support for root NS updates
+
 ## v0.0.4 - 2023-04-27 - ALIAS support
 
 * add support for ALIAS as a CNAME at root
diff --git a/README.md b/README.md
index d565964..eb593f3 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,11 @@ providers:
 
 #### Records
 
-Supports A, AAAA, NS, MX, TXT, SRV, CNAME, and PTR
+Supports A, AAAA, ALIAS (CNAME flattening), NS, MX, TXT, SRV, CNAME, and PTR.
+CNAME flattening resolves both A and AAAA records and inherits the upstream TTL.
+
+#### Root NS Records
+The GCore provider supports full root NS record management.
 
 #### Dynamic
 
diff --git a/octodns_gcore/__init__.py b/octodns_gcore/__init__.py
index 7ab339f..7124dec 100644
--- a/octodns_gcore/__init__.py
+++ b/octodns_gcore/__init__.py
@@ -151,6 +151,7 @@ def _build_url(base, *items):
 class _BaseProvider(BaseProvider):
     SUPPORTS_GEO = False
     SUPPORTS_DYNAMIC = True
+    SUPPORTS_ROOT_NS = True
     SUPPORTS = set(
         ("A", "AAAA", "ALIAS", "CAA", "NS", "MX", "TXT", "SRV", "CNAME", "PTR")
     )


Test patch:
diff --git a/tests/test_octodns_provider_gcore.py b/tests/test_octodns_provider_gcore.py
index 98cd276..8c3eef0 100644
--- a/tests/test_octodns_provider_gcore.py
+++ b/tests/test_octodns_provider_gcore.py
@@ -257,8 +257,8 @@ def test_apply(self):
         plan = provider.plan(self.expected)
 
         # TC: create all
-        self.assertEqual(14, len(plan.changes))
-        self.assertEqual(14, provider.apply(plan))
+        self.assertEqual(15, len(plan.changes))
+        self.assertEqual(15, provider.apply(plan))
         self.assertFalse(plan.exists)
 
         provider._client._request.assert_has_calls(
@@ -291,6 +291,17 @@ def test_apply(self):
                         ],
                     },
                 ),
+                call(
+                    "POST",
+                    "http://api/zones/unit.tests/unit.tests./NS",
+                    data={
+                        "ttl": 300,
+                        "resource_records": [
+                            {"content": ["ns1.gcorelabs.net."]},
+                            {"content": ["ns2.gcdn.services."]},
+                        ],
+                    },
+                ),
                 call(
                     "POST",
                     "http://api/zones/unit.tests/_imap._tcp.unit.tests./SRV",
@@ -416,7 +427,7 @@ def test_apply(self):
             ]
         )
         # expected number of total calls
-        self.assertEqual(17, provider._client._request.call_count)
+        self.assertEqual(18, provider._client._request.call_count)
 
         # TC: delete 1 and update 1
         provider._client._request.reset_mock()