From 8e08039982b00dbfa7fb97f91a12c4c894a51c54 Mon Sep 17 00:00:00 2001
From: Karel van Klink <karel.vanklink@geant.org>
Date: Thu, 12 Dec 2024 13:59:47 +0100
Subject: [PATCH] Update docstrings to be added in mkdocs

---
 docs/includes/glossary.md                     |  1 +
 docs/scripts/gen_wf_redirects.py              |  2 +-
 docs/source/architecture/components/index.md  |  2 +-
 docs/source/architecture/index.md             |  8 +--
 docs/vale/.vale.ini                           |  4 +-
 .../vocabularies/geant-jargon/accept.txt      |  2 +
 gso/products/__init__.py                      |  6 +-
 .../product_blocks/lan_switch_interconnect.py | 18 +++--
 gso/products/product_blocks/opengear.py       | 21 +++---
 gso/products/product_blocks/pop_vlan.py       | 19 ++---
 gso/products/product_blocks/site.py           | 36 +++++-----
 .../product_blocks/super_pop_switch.py        | 28 ++++----
 gso/services/infoblox.py                      | 10 +--
 gso/services/kentik_client.py                 | 72 +++++++++----------
 gso/services/lso_client.py                    | 62 ++++++++--------
 gso/services/netbox_client.py                 |  2 +-
 gso/settings.py                               | 16 +++--
 gso/workflows/router/validate_router.py       |  4 +-
 gso/workflows/site/terminate_site.py          |  4 +-
 .../tasks/validate_geant_products.py          |  4 +-
 test/fixtures/site_fixtures.py                |  2 +-
 21 files changed, 173 insertions(+), 150 deletions(-)

diff --git a/docs/includes/glossary.md b/docs/includes/glossary.md
index 4df9f994..a29d2452 100644
--- a/docs/includes/glossary.md
+++ b/docs/includes/glossary.md
@@ -5,6 +5,7 @@
 *[CFS]: Customer Facing Service
 *[CIDR]: Classless Inter-Domain Routing
 *[DCIM]: Datacenter Infrastructure Manager
+*[DCN]: Datacenter Network
 *[DHCP]: Dynamic Host Configuration Protocol
 *[DNS]: Domain Name System
 *[DTAP]: Development, Testing, Acceptance, and Production
diff --git a/docs/scripts/gen_wf_redirects.py b/docs/scripts/gen_wf_redirects.py
index 3b738d8a..90b84444 100644
--- a/docs/scripts/gen_wf_redirects.py
+++ b/docs/scripts/gen_wf_redirects.py
@@ -33,7 +33,7 @@ with Path.open(root / "docs" / "wf_redirects.yaml", "w") as redirect_file:
             {"gen-files": {"scripts": ["scripts/gen_ref_pages.py"]}},
             {"redirects": {"redirect_maps": redirect_map}},
             {"literate-nav": {"nav_file": "SUMMARY.md"}},
-            "mkdocstrings",
+            {"mkdocstrings": {"handlers": {"python": {"options": {"filters": [], "members_order": "source"}}}}},
         ]
     }
     yaml.dump(file_content, redirect_file)
diff --git a/docs/source/architecture/components/index.md b/docs/source/architecture/components/index.md
index bf0790f3..76e837d6 100644
--- a/docs/source/architecture/components/index.md
+++ b/docs/source/architecture/components/index.md
@@ -1,7 +1,7 @@
 # Components of GAP
 
 As stated before, GAP is a platform and not a monolithic piece of software. GAP interacts with different OSS/BSS
-systems already present in GÉANT and these are tightly integrated with the automation platform.
+systems already present in GÉANT and these are integrated with the automation platform.
 
 From a high level point of view, GAP can be seen as the sum of the following parts:
 
diff --git a/docs/source/architecture/index.md b/docs/source/architecture/index.md
index 7f53acba..da9f309c 100644
--- a/docs/source/architecture/index.md
+++ b/docs/source/architecture/index.md
@@ -57,16 +57,12 @@ configuration backups of routers, switches, and any other network devices that a
 More detailed information about this integration is available in the
 [LibreNMS integration module](../admin_guide/oss_bss/librenms.md).
 
-### Kentik (planned)
+### Kentik
 
 Kentik is a Network Observability tool which collects various data points from deployed PE routers.
 For this reason it is not in scope for PHASE1.
 
-### Inventory provider (planned)
+### Inventory provider
 
 At the time of writing, the Inventory Provider gets the list of routers from the network engineering SOT servers.
 This will change and Inventory Provider is then able to directly query CoreDB.
-
-## Interaction with a technical domain: IP/MPLS
-
-TBA
diff --git a/docs/vale/.vale.ini b/docs/vale/.vale.ini
index 06742e1a..a5a4c9cc 100644
--- a/docs/vale/.vale.ini
+++ b/docs/vale/.vale.ini
@@ -33,10 +33,10 @@ Microsoft.SentenceLength = NO
 
 ; This statement ignores the names of parameters in docstrings, the four spaces that prepend it and the one following it
 ; are necessary.
-TokenIgnores =     \S+:
+TokenIgnores = (?: *\S+: ), (?:`\S+`)
 
 [*.md]
 BasedOnStyles = Vale, proselint, Microsoft
 
 [formats]
-py = rst
+py = md
diff --git a/docs/vale/styles/config/vocabularies/geant-jargon/accept.txt b/docs/vale/styles/config/vocabularies/geant-jargon/accept.txt
index 6373503d..aeb0c40d 100644
--- a/docs/vale/styles/config/vocabularies/geant-jargon/accept.txt
+++ b/docs/vale/styles/config/vocabularies/geant-jargon/accept.txt
@@ -11,6 +11,7 @@ CIDR
 CFS
 CNAME
 DCIM
+DCN
 DDI
 DHCP
 DNS
@@ -90,3 +91,4 @@ WFO
 dry_run
 eBGP
 iBGP
+disable?[sd]
diff --git a/gso/products/__init__.py b/gso/products/__init__.py
index 88552bc7..f6144477 100644
--- a/gso/products/__init__.py
+++ b/gso/products/__init__.py
@@ -1,8 +1,8 @@
 """Module that updates the domain model of GSO. Should contain all types of subscriptions.
 
-.. warning::
-   Whenever a new product is added, this should be reflected in the `ProductType` enumerator.
-   This does not hold for adding a new type of already existing product.
+!!! warning
+    Whenever a new product is added, this should be reflected in the `ProductType` enumerator.
+    This does not hold for adding a new type of already existing product.
 """
 
 from orchestrator.domain import SUBSCRIPTION_MODEL_REGISTRY
diff --git a/gso/products/product_blocks/lan_switch_interconnect.py b/gso/products/product_blocks/lan_switch_interconnect.py
index b62156af..624f4015 100644
--- a/gso/products/product_blocks/lan_switch_interconnect.py
+++ b/gso/products/product_blocks/lan_switch_interconnect.py
@@ -131,17 +131,21 @@ class LanSwitchInterconnectBlockProvisioning(
 
 
 class LanSwitchInterconnectBlock(LanSwitchInterconnectBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
-    """A LAN Switch Interconnect that's currently deployed in the network."""
+    """A LAN Switch Interconnect that's currently deployed in the network.
+
+    Attributes:
+        lan_switch_interconnect_description: A human-readable description of this LAN Switch Interconnect.
+        minimum_links: The minimum amount of links the LAN Switch Interconnect should consist of.
+        switch_management_vlan_id: VLAN ID for the switch management network.
+        dcn_management_vlan_id: VLAN ID for the DCN management network, if the site of this product contains optical
+            equipment.
+        router_side: The router side of the LAN Switch Interconnect.
+        switch_side: The switch side of the LAN Switch Interconnect.
+    """
 
-    #: A human-readable description of this LAN Switch Interconnect.
     lan_switch_interconnect_description: str
-    #: The minimum amount of links the LAN Switch Interconnect should consist of.
     minimum_links: int
-    #: VLAN ID for the switch management network.
     switch_management_vlan_id: VLAN_ID
-    #: VLAN ID for the DCN management network, if the site of this product contains optical equipment.
     dcn_management_vlan_id: VLAN_ID | None
-    #: The router side of the LAN Switch Interconnect.
     router_side: LanSwitchInterconnectRouterSideBlock
-    #: The switch side of the LAN Switch Interconnect.
     switch_side: LanSwitchInterconnectSwitchSideBlock
diff --git a/gso/products/product_blocks/opengear.py b/gso/products/product_blocks/opengear.py
index 9d1571f6..0daca489 100644
--- a/gso/products/product_blocks/opengear.py
+++ b/gso/products/product_blocks/opengear.py
@@ -31,21 +31,24 @@ class OpengearBlockProvisioning(OpengearBlockInactive, lifecycle=[SubscriptionLi
 
     opengear_hostname: str
     opengear_site: SiteBlockProvisioning
-    opengear_wan_address: ipaddress.IPv4Address | None = None
-    opengear_wan_netmask: ipaddress.IPv4Address | None = None
-    opengear_wan_gateway: ipaddress.IPv4Address | None = None
+    opengear_wan_address: ipaddress.IPv4Address | None
+    opengear_wan_netmask: ipaddress.IPv4Address | None
+    opengear_wan_gateway: ipaddress.IPv4Address | None
 
 
 class OpengearBlock(OpengearBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
-    """An Opengear that's currently deployed in the network."""
+    """An Opengear that's currently deployed in the network.
+
+    Attributes:
+        opengear_hostname: The hostname of the Opengear device.
+        opengear_site: The site where the Opengear device is located.
+        opengear_wan_address: The WAN address of the Opengear device.
+        opengear_wan_netmask: The WAN netmask of the Opengear device.
+        opengear_wan_gateway: The WAN gateway of the Opengear device.
+    """
 
-    #: The hostname of the Opengear device.
     opengear_hostname: str
-    #: The site where the Opengear device is located.
     opengear_site: SiteBlock
-    #: The WAN address of the Opengear device.
     opengear_wan_address: ipaddress.IPv4Address
-    #: The WAN netmask of the Opengear device.
     opengear_wan_netmask: ipaddress.IPv4Address
-    #: The WAN gateway of the Opengear device.
     opengear_wan_gateway: ipaddress.IPv4Address
diff --git a/gso/products/product_blocks/pop_vlan.py b/gso/products/product_blocks/pop_vlan.py
index a883477d..a26e072d 100644
--- a/gso/products/product_blocks/pop_vlan.py
+++ b/gso/products/product_blocks/pop_vlan.py
@@ -84,19 +84,22 @@ class PopVlanBlockProvisioning(PopVlanBlockInactive, lifecycle=[SubscriptionLife
 
 
 class PopVlanBlock(PopVlanBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
-    """A Pop VLAN that's currently deployed in the network."""
+    """A Pop VLAN that's currently deployed in the network.
+
+    Attributes:
+        vlan_id: The VLAN ID of the Pop VLAN.
+        pop_vlan_description: The description of the Pop VLAN.
+        lan_switch_interconnect: The LAN Switch Interconnect that this Pop VLAN is connected to.
+        ports: The ports of the Pop VLAN.
+        layer_preference: The level of the layer preference for the Pop VLAN (L2 or L3).
+        ipv4_network: IPv4 network for the Pop VLAN if layer preference is L3.
+        ipv6_network: IPv6 network for the Pop VLAN if layer preference is L3.
+    """
 
-    #: The VLAN ID of the Pop VLAN.
     vlan_id: int
-    #: The description of the Pop VLAN.
     pop_vlan_description: str
-    #: The LAN Switch Interconnect that this Pop VLAN is connected to.
     lan_switch_interconnect: LanSwitchInterconnectBlock
-    #: The ports of the Pop VLAN.
     ports: PortList[PopVlanPortBlock]  # type: ignore[assignment]
-    #: The level of the layer preference for the Pop VLAN (L2 or L3).
     layer_preference: LayerPreference
-    #: IPv4 network for the Pop VLAN if layer preference is L3.
     ipv4_network: IPv4Network | None
-    #: IPv6 network for the Pop VLAN if layer preference is L3.
     ipv6_network: IPv6Network | None
diff --git a/gso/products/product_blocks/site.py b/gso/products/product_blocks/site.py
index 4d5e479c..22cc4940 100644
--- a/gso/products/product_blocks/site.py
+++ b/gso/products/product_blocks/site.py
@@ -58,31 +58,35 @@ class SiteBlockProvisioning(SiteBlockInactive, lifecycle=[SubscriptionLifecycle.
 
 
 class SiteBlock(SiteBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
-    """A site that's currently available for routers and services to be hosted at."""
+    """A site that's currently available for routers and services to be hosted at.
+
+    Attributes:
+        site_name: The name of the site, that will dictate part of the FQDN of routers that are hosted at this site. For
+            example: `router.X.Y.geant.net`, where X denotes the name of the site.
+        site_city: The city at which the site is located.
+        site_country: The country in which the site is located.
+        site_country_code: The code of the corresponding country. This is also used for the FQDN, following the example
+            given for the site name, the country code would end up in the Y position.
+        site_latitude: The latitude of the site, used for SNMP purposes.
+        site_longitude: Similar to the latitude, the longitude of a site.
+        site_internal_id: The internal ID used within GÉANT to denote a site.
+        site_bgp_community_id: The BGP community ID of a site, used to advertise routes learned at this site.
+        site_tier: The tier of a site, as described in `SiteTier`.
+        site_ts_address: The address of the terminal server that this router is connected to. The terminal server
+            provides out of band access. This is required in case a link goes down, or when a router is initially added
+            to the network, and it does not have any IP trunks connected to it.
+        site_contains_optical_equipment: Whether this site contains optical equipment, which dictates the need for a DCN
+            management VLAN.
+    """
 
-    #:  The name of the site, that will dictate part of the FQDN of routers that are hosted at this site. For
-    #:  example: `router.X.Y.geant.net`, where X denotes the name of the site.
     site_name: SiteName
-    #:  The city at which the site is located.
     site_city: str
-    #:  The country in which the site is located.
     site_country: str
-    #:  The code of the corresponding country. This is also used for the FQDN, following the example given for
-    #:  the site name, the country code would end up in the Y position.
     site_country_code: str
-    #:  The latitude of the site, used for SNMP purposes.
     site_latitude: LatitudeCoordinate
-    #:  Similar to the latitude, the longitude of a site.
     site_longitude: LongitudeCoordinate
-    #:  The internal ID used within GÉANT to denote a site.
     site_internal_id: int
-    #:  The BGP community ID of a site, used to advertise routes learned at this site.
     site_bgp_community_id: int
-    #:  The tier of a site, as described in `SiteTier`.
     site_tier: SiteTier
-    #:  The address of the terminal server that this router is connected to. The terminal server provides out of band
-    #:  access. This is required in case a link goes down, or when a router is initially added to the network and it
-    #:  does not have any IP trunks connected to it.
     site_ts_address: IPAddress
-    #:  Whether this site contains optical equipment, which dictates the need for a DCN management VLAN
     site_contains_optical_equipment: bool
diff --git a/gso/products/product_blocks/super_pop_switch.py b/gso/products/product_blocks/super_pop_switch.py
index 7c0b1c4a..3c436e07 100644
--- a/gso/products/product_blocks/super_pop_switch.py
+++ b/gso/products/product_blocks/super_pop_switch.py
@@ -23,29 +23,33 @@ class SuperPopSwitchBlockInactive(
     super_pop_switch_ts_port: PortNumber | None = None
     super_pop_switch_mgmt_ipv4_address: IPv4AddressType | None = None
     super_pop_switch_site: SiteBlockInactive | None
-    vendor: Vendor | None = None
+    vendor: Vendor | None = Vendor.JUNIPER
 
 
 class SuperPopSwitchBlockProvisioning(SuperPopSwitchBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING]):
     """A Super PoP switch that's being provisioned. See `SuperPoPSwitchBlock`."""
 
-    super_pop_switch_fqdn: str | None = None
-    super_pop_switch_ts_port: PortNumber | None = None
-    super_pop_switch_mgmt_ipv4_address: IPv4AddressType | None = None
+    super_pop_switch_fqdn: str | None
+    super_pop_switch_ts_port: PortNumber | None
+    super_pop_switch_mgmt_ipv4_address: IPv4AddressType | None
     super_pop_switch_site: SiteBlockProvisioning | None
-    vendor: Vendor | None = None
+    vendor: Vendor | None
 
 
 class SuperPopSwitchBlock(SuperPopSwitchBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
-    """A Super PoP switch that's currently deployed in the network."""
+    """A Super PoP switch that's currently deployed in the network.
+
+    Attributes:
+        super_pop_switch_fqdn: Super PoP switch FQDN.
+        super_pop_switch_ts_port: The port of the terminal server that this Super PoP switch is connected to. Used to
+            offer out of band access.
+        super_pop_switch_mgmt_ipv4_address: The IPv4 management address of the Super PoP switch.
+        super_pop_switch_site: The `Site` that this Super PoP switch resides in. Both physically and computationally.
+        vendor: The vendor of a Super PoP switch. Defaults to Juniper.
+    """
 
-    #:  Super PoP switch FQDN.
     super_pop_switch_fqdn: str
-    #:  The port of the terminal server that this Super PoP switch is connected to. Used to offer out of band access.
     super_pop_switch_ts_port: PortNumber
-    #:  The IPv4 management address of the Super PoP switch.
     super_pop_switch_mgmt_ipv4_address: IPv4AddressType
-    #:  The `Site` that this Super PoP switch resides in. Both physically and computationally.
     super_pop_switch_site: SiteBlock
-    #:  The vendor of a Super PoP switch. Defaults to Juniper.
-    vendor: Vendor = Vendor.JUNIPER
+    vendor: Vendor
diff --git a/gso/services/infoblox.py b/gso/services/infoblox.py
index a0f5df25..49ca5d3e 100644
--- a/gso/services/infoblox.py
+++ b/gso/services/infoblox.py
@@ -86,7 +86,7 @@ def create_v4_network_by_ip(
     """Register an IPv4 network at the given location.
 
     Raises:
-        AllocationError on failure.
+        AllocationError: on failure.
     """
     conn, _ = _setup_connection()
     created_net = objects.NetworkV4.create(
@@ -105,7 +105,7 @@ def create_v6_network_by_ip(
     """Register an IPv6 network at the given location.
 
     Raises:
-        AllocationError on failure.
+        AllocationError: on failure.
     """
     conn, _ = _setup_connection()
     created_net = objects.NetworkV6.create(
@@ -123,9 +123,9 @@ def hostname_available(hostname: str) -> bool:
 
     Check whether Infoblox already has a ``infoblox_client.objects.HostRecord`` that matches the given hostname.
 
-    .. warning::
-       This method only checks within the Infoblox instance, and not the rest of the internet. The hostname could
-       therefore still be taken elsewhere.
+    !!! danger
+        This method only checks within the Infoblox instance, and not the rest of the internet. The hostname could
+        therefore still be taken elsewhere.
 
     Args:
         hostname: The hostname to be checked.
diff --git a/gso/services/kentik_client.py b/gso/services/kentik_client.py
index 3e524ccb..86e81a0c 100644
--- a/gso/services/kentik_client.py
+++ b/gso/services/kentik_client.py
@@ -101,10 +101,8 @@ class KentikClient:
 
         If the site is not found, return an empty dict.
 
-        .. vale off
-
         Args:
-            site_slug: The name of the site, should be a three-letter slug like COR or POZ.
+            site_slug: The name of the site, should be a three-letter slug like `COR` or `POZ`.
         """
         sites = self.get_sites()
         for site in sites:
@@ -116,40 +114,42 @@ class KentikClient:
     def get_plans(self) -> list[dict[str, Any]]:
         """Get all Kentik plans available.
 
+        Returns a list of `plan` objects that each have the following shape:
+
+        <!-- vale off -->
+        ```py
+        "plan": {
+            "active": true,
+            "bgp_enabled": true,
+            "cdate" "1970-01-01T01:01:01.000Z",
+            "company_id": 111111,
+            "description": "A description of this plan",
+            "deviceTypes": [
+                {"device_type": "router"},
+                {"device_type": "host-nprobe-dns-www"}
+            ],
+            "devices": [
+                {
+                    "id": "111111",
+                    "device_name": "rt0.city.tld.internal",
+                    "device_type": "router"
+                },
+            ],
+            "edate": "2999-01-01T09:09:09.000Z",
+            "fast_retention": 10,
+            "full_retention": 5,
+            "id": 11111,
+            "max_bigdata_fps": 100,
+            "max_devices": 9001,
+            "max_fps": 200,
+            "name": "KENTIK-PLAN-01",
+            "metadata": {},
+        }
+        ```
+        <!-- vale on -->
+
         Returns:
-            a list of `plans` that each have the following shape:
-
-            .. vale off
-            .. code-block:: json
-
-                "plan": {
-                    "active": true,
-                    "bgp_enabled": true,
-                    "cdate" "1970-01-01T01:01:01.000Z",
-                    "company_id": 111111,
-                    "description": "A description of this plan",
-                    "deviceTypes": [
-                        {"device_type": "router"},
-                        {"device_type": "host-nprobe-dns-www"}
-                    ],
-                    "devices": [
-                        {
-                            "id": "111111",
-                            "device_name": "rt0.city.tld.internal",
-                            "device_type": "router"
-                        },
-                    ],
-                    "edate": "2999-01-01T09:09:09.000Z",
-                    "fast_retention": 10,
-                    "full_retention": 5,
-                    "id": 11111,
-                    "max_bigdata_fps": 100,
-                    "max_devices": 9001,
-                    "max_fps": 200,
-                    "name": "KENTIK-PLAN-01",
-                    "metadata": {},
-                }
-            .. vale on
+            A list of plans configured in Kentik.
         """
         return self._send_request("GET", "v5/plans")["plans"]
 
diff --git a/gso/services/lso_client.py b/gso/services/lso_client.py
index 25579860..7c6e49a2 100644
--- a/gso/services/lso_client.py
+++ b/gso/services/lso_client.py
@@ -73,37 +73,37 @@ def _execute_playbook(
     For example, an inventory consisting of two hosts, which each a unique host variable assigned to them looks as
     follows:
 
-    .. vale off
-    .. code-block:: json
-
-        "inventory": {
-            "all": {
-                "hosts": {
-                    "host1.local": {
-                        "foo": "bar"
-                    },
-                    "host2.local": {
-                        "key": "value"
-                    },
-                    "host3.local": None
-                }
+    ```py
+    "inventory": {
+        "all": {
+            "hosts": {
+                "host1.local": {
+                    "foo": "bar"
+                },
+                "host2.local": {
+                    "key": "value"
+                },
+                "host3.local": None
             }
         }
-    .. vale on
+    }
+    ```
 
-    .. warning::
-       Note the fact that the collection of all hosts is a dictionary, and not a list of strings. Ansible expects each
-       host to be a key-value pair. The key is the FQDN of a host, and the value always `null`.
+    !!! danger
+        Note the fact that the collection of all hosts is a dictionary, and not a list of strings. Ansible expects each
+        host to be a key-value pair. The key is the FQDN of a host, and the value always `null`.
 
     The extra vars can be a simple dict consisting of key-value pairs, for example:
 
-    .. code-block:: json
-
-        "extra_vars": {
-            "dry_run": true,
-            "commit_comment": "I am a robot!",
-            "verb": "deploy"
-        }
+    <!-- vale off -->
+    ```py
+    "extra_vars": {
+        "dry_run": true,
+        "commit_comment": "I am a robot!",
+        "verb": "deploy"
+    }
+    ```
+    <!-- vale on -->
 
     Args:
         playbook_name: Filename of the playbook that is to be executed. It must be present on the remote system running
@@ -111,7 +111,7 @@ def _execute_playbook(
         callback_route: The endpoint at which GSO expects a callback to continue the workflow executing this step.
         inventory: An inventory of machines at which the playbook is targeted. Must be in YAML-compatible format.
         extra_vars: Any extra variables that the playbook relies on. This can include a subscription object, a boolean
-            value indicating a dry run, a commit comment, etc.  All unicode character values are decoded to prevent
+            value indicating a dry run, a commit comment, etc. All unicode character values are decoded to prevent
             sending special characters to remote machines that don't support this.
     """
     parameters = {
@@ -169,7 +169,7 @@ def _clean_state() -> State:
     }
 
 
-def _inventory_is_set(state: State) -> bool:
+def validate_inventory_is_set(state: State) -> bool:
     """Validate whether the passed Ansible inventory is empty.
 
     If the inventory is empty, which can happen in select cases, there should be no playbook run. This conditional will
@@ -186,7 +186,7 @@ def _inventory_is_set(state: State) -> bool:
     return state["inventory"]["all"]["hosts"]
 
 
-_inventory_is_not_empty = conditional(_inventory_is_set)
+_inventory_is_not_empty = conditional(validate_inventory_is_set)
 
 
 def lso_interaction(provisioning_step: Step) -> StepList:
@@ -228,9 +228,9 @@ def indifferent_lso_interaction(provisioning_step: Step) -> StepList:
     Whereas the `lso_interaction()` will make the workflow step fail on unsuccessful interaction, this step will not.
     It is therefore indifferent about the outcome of the Ansible playbook that is executed.
 
-    .. warning::
-       Using this interaction requires the operator to carefully evaluate the outcome of a playbook themselves. If a
-       playbook fails, this will not cause the workflow to fail.
+    !!! danger
+        Using this interaction requires the operator to manually evaluate the outcome of a playbook. If a playbook
+        fails, this will not cause the workflow to fail.
 
     Args:
         provisioning_step: A workflow step that performs an operation remotely using the provisioning proxy.
diff --git a/gso/services/netbox_client.py b/gso/services/netbox_client.py
index 4b6560b9..2928263c 100644
--- a/gso/services/netbox_client.py
+++ b/gso/services/netbox_client.py
@@ -319,7 +319,7 @@ class NetboxClient:
 
     @staticmethod
     def calculate_speed_bits_per_sec(speed: str) -> int:
-        """Extract the numeric part from the speed."""
+        """Calculate the numeric part from the speed."""
         numeric_part = int("".join(filter(str.isdigit, speed)))
         # Convert to bits per second
         return numeric_part * 1000000
diff --git a/gso/settings.py b/gso/settings.py
index 5b3beefd..d65ead42 100644
--- a/gso/settings.py
+++ b/gso/settings.py
@@ -129,9 +129,12 @@ class SNMPParams(BaseSettings):
     """Parameters for SNMP in LibreNMS."""
 
     v2c: MonitoringSNMPV2Params
-    #: .. versionadded :: 2.0
-    #:    Support for SNMP v3 will get added in a later version of GSO. Parameters are optional for now.
     v3: MonitoringSNMPV3Params | None = None
+    """
+    !!! example "Optional parameter"
+
+        Support for SNMP v3 will get added in a later version of GSO. Parameters are optional for now.
+    """
 
 
 class MonitoringParams(BaseSettings):
@@ -157,7 +160,12 @@ class NetBoxParams(BaseSettings):
 
 
 class EmailParams(BaseSettings):
-    """Parameters for the email service."""
+    """Parameters for the email service.
+
+    Attributes:
+        notification_email_destinations: List of email addresses that should receive notifications when validation of a
+            subscription fails. Can be a comma-separated list of multiple addresses.
+    """
 
     from_address: EmailStr
     smtp_host: str
@@ -165,8 +173,6 @@ class EmailParams(BaseSettings):
     starttls_enabled: bool
     smtp_username: str | None = None
     smtp_password: str | None = None
-    #: List of email addresses that should receive notifications when validation of a subscription fails.
-    #: Can be a comma-separated list of multiple addresses.
     notification_email_destinations: str
 
 
diff --git a/gso/workflows/router/validate_router.py b/gso/workflows/router/validate_router.py
index b029db47..89a05004 100644
--- a/gso/workflows/router/validate_router.py
+++ b/gso/workflows/router/validate_router.py
@@ -55,7 +55,7 @@ def check_netbox_entry_exists(subscription: Router) -> None:
 
 @step("Verify P BGP P-ONLY neighbors")
 def verify_p_ibgp(subscription: dict[str, Any]) -> LSOState:
-    """Verify PE neighbors in P-ONLY group on a P router."""
+    """Verify PE neighbors in `P-ONLY` group on a P router."""
     extra_vars = {
         "dry_run": True,
         "subscription": subscription,
@@ -100,7 +100,7 @@ def verify_pe_mesh_in_pe(subscription: dict[str, Any]) -> LSOState:
 
 @step("Verify PE BGP P-ONLY neighbors")
 def verify_all_p_in_pe(subscription: dict[str, Any]) -> LSOState:
-    """Verify P neighbors in P-ONLY group on a PE router."""
+    """Verify P neighbors in `P-ONLY` group on a PE router."""
     extra_vars = {
         "dry_run": True,
         "subscription": subscription,
diff --git a/gso/workflows/site/terminate_site.py b/gso/workflows/site/terminate_site.py
index 8f13e358..92da5cca 100644
--- a/gso/workflows/site/terminate_site.py
+++ b/gso/workflows/site/terminate_site.py
@@ -1,8 +1,8 @@
 """A workflow for terminating a site subscription.
 
 The `terminate_site` workflow will take an existing and active site subscription from an `ACTIVE` to a `TERMINATED`
-state. This requires all dependant subscription instances to already be terminated. If this is not the case, the
-workflow will be unavailable for an operator to run, accompanied by an error message explaining this fact.
+state. This requires all dependant subscription instances to already be terminated. If not, the workflow will be
+unavailable for an operator to run, accompanied by an error message explaining this fact.
 """
 
 from orchestrator.forms import FormPage
diff --git a/gso/workflows/tasks/validate_geant_products.py b/gso/workflows/tasks/validate_geant_products.py
index a7bfcdaa..8fe39f61 100644
--- a/gso/workflows/tasks/validate_geant_products.py
+++ b/gso/workflows/tasks/validate_geant_products.py
@@ -1,6 +1,6 @@
 """A task that checks for all products in the database to be well-kept."""
 
-# .. vale off
+# <!-- vale off -->
 # Copyright 2019-2020 SURF.
 # Copyright 2024 GÉANT Vereniging.
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,7 +14,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-# .. vale on
+# <!-- vale on -->
 
 from orchestrator.targets import Target
 from orchestrator.workflow import StepList, done, init, workflow
diff --git a/test/fixtures/site_fixtures.py b/test/fixtures/site_fixtures.py
index c6a884b1..2467bd89 100644
--- a/test/fixtures/site_fixtures.py
+++ b/test/fixtures/site_fixtures.py
@@ -52,7 +52,7 @@ def site_subscription_factory(faker, geant_partner):
         site_subscription.site.site_latitude = site_latitude or str(faker.latitude())
         site_subscription.site.site_longitude = site_longitude or str(faker.longitude())
         site_subscription.site.site_bgp_community_id = site_bgp_community_id or faker.pyint()
-        site_subscription.site.site_internal_id = site_internal_id or faker.pyint(max_value=254)
+        site_subscription.site.site_internal_id = site_internal_id or faker.pyint(min_value=1, max_value=254)
         site_subscription.site.site_tier = site_tier or SiteTier.TIER1
         site_subscription.site.site_ts_address = site_ts_address or faker.ipv4()
         site_subscription.site.site_contains_optical_equipment = site_contains_optical_equipment
-- 
GitLab