Repository: octodns/octodns-bind

Issue:
Rfc2136Provider configuration fails when adding modification thresholds
When defining an Rfc2136Provider configuration with update_pcent_threshold or delete_pcent_threshold defined, the octo runs fails with the following error:
`TypeError: __init__() got an unexpected keyword argument 'update_pcent_threshold'`

 It looks like only the id is passed to the parent class as part of the configuration construction and no other arguments so the constructor fails.
https://github.com/octodns/octodns-bind/blob/main/octodns_bind/__init__.py#L376

Hints from issue comments:
@ross: Definitely an oversight. 

Looks like https://github.com/octodns/octodns-bind/blob/b974df8f06ce5dfd205ec5042ccd97aa75a74929/octodns_bind/__init__.py#L95 needs to add support as well. 

Should likely be done with `*args`, `**kwargs` that's passed along as happens in other providers e.g. https://github.com/octodns/octodns-ns1/blob/77f73d472ac68d4dbd9f40ffd2998c85bf5933cf/octodns_ns1/__init__.py#L501-L502@grantwheeler-nyt: Do you know when the next tag might be generated with this fix?@ross: I should be able to cut a new release tomorrow assuming the SHA based git url isn't viable https://github.com/octodns/octodns-bind?tab=readme-ov-file#shas@ross: Relased https://github.com/octodns/octodns-bind/pull/73@grantwheeler-nyt: Thank you!

Solution patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53a7185..653b1a3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## v0.0.7 - 2025-??-?? - ???
+
+- Add support for Provider base class parameters
+
 ## v0.0.6 - 2024-01-30 - Known your zones
 
 - `ZoneFileProvider` assumes zone files don't exist when used as a
diff --git a/octodns_bind/__init__.py b/octodns_bind/__init__.py
index 1ab8837..f3a155b 100644
--- a/octodns_bind/__init__.py
+++ b/octodns_bind/__init__.py
@@ -148,6 +148,8 @@ def __init__(
         retry=600,
         expire=604800,
         nxdomain=3600,
+        *args,
+        **kwargs,
     ):
         self.log = getLogger(f'ZoneFileProvider[{id}]')
         self.log.debug(
@@ -163,7 +165,7 @@ def __init__(
             expire,
             nxdomain,
         )
-        super().__init__(id)
+        super().__init__(id, *args, **kwargs)
         self.directory = directory
         self.file_extension = file_extension
         self.check_origin = check_origin
@@ -360,6 +362,8 @@ def __init__(
         key_name=None,
         key_secret=None,
         key_algorithm=None,
+        *args,
+        **kwargs,
     ):
         self.log = getLogger(f'{self.__class__.__name__}[{id}]')
         self.log.debug(
@@ -373,7 +377,7 @@ def __init__(
             key_secret is not None,
             key_algorithm is not None,
         )
-        super().__init__(id)
+        super().__init__(id, *args, **kwargs)
         self.host = self._host(host, ipv6)
         self.port = int(port)
         self.ipv6 = ipv6


Test patch:
diff --git a/tests/test_provider_octodns_bind.py b/tests/test_provider_octodns_bind.py
index 593bae2..5153777 100644
--- a/tests/test_provider_octodns_bind.py
+++ b/tests/test_provider_octodns_bind.py
@@ -378,6 +378,13 @@ def test_hostmaster_email(self):
             'root.some.com', source._hostmaster_email('ignored.tests.')
         )
 
+        # ensure inheritance from base provider
+        source = ZoneFileProvider(
+            'test', '.', update_pcent_threshold=0.9, delete_pcent_threshold=0.8
+        )
+        self.assertEqual(0.9, source.update_pcent_threshold)
+        self.assertEqual(0.8, source.delete_pcent_threshold)
+
     def test_longest_name(self):
         # make sure empty doesn't blow up and we get 0
         self.assertEqual(0, self.source._longest_name([]))
@@ -435,6 +442,17 @@ def test_host_ip(self):
         provider = Rfc2136Provider('test', '192.0.2.1')
         self.assertEqual('192.0.2.1', provider.host)
 
+    def test_provider_configuration(self):
+        # test configuration inherits functionality from the base provider
+        provider = Rfc2136Provider(
+            'test',
+            '192.0.2.1',
+            update_pcent_threshold=0.9,
+            delete_pcent_threshold=0.8,
+        )
+        self.assertEqual(0.9, provider.update_pcent_threshold)
+        self.assertEqual(0.8, provider.delete_pcent_threshold)
+
     @patch('socket.getaddrinfo')
     def test_host_dns(self, resolve_mock):
         host, ipv4, ipv6 = 'axfr.unit.tests.', '192.0.2.2', '2001:db8::1'