Skip to content

Commit 020f395

Browse files
committed
Remove legacy health plugin namespace
1 parent d7183e3 commit 020f395

9 files changed

Lines changed: 27 additions & 288 deletions

File tree

docs/plugins/generated.md

Lines changed: 0 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -4561,144 +4561,6 @@ with:
45614561
name: nginx
45624562
```
45634563

4564-
## health
4565-
4566-
### `health.http`
4567-
4568-
Assert HTTP status and optional body content from the controller.
4569-
4570-
- Remote session: `false`
4571-
- Dry-run support: `true`
4572-
- Check mode support: `false`
4573-
4574-
| Parameter | Required | Type | Default | Description |
4575-
|---|---:|---|---|---|
4576-
| `url` | yes | `string` | | HTTP URL. |
4577-
| `method` | no | `string` | `GET` | HTTP request method. |
4578-
| `headers` | no | `mapping` | | HTTP request headers. |
4579-
| `body` | no | `string` | | Raw HTTP request body. |
4580-
| `json` | no | `mapping` | | JSON HTTP request body. |
4581-
| `timeout` | no | `number` | | Operation timeout in seconds. |
4582-
| `encoding` | no | `string` | `utf-8` | Text encoding used for command output, HTTP bodies or file content. |
4583-
| `validate_tls` | no | `boolean` | `True` | Validate TLS certificates for HTTPS requests. |
4584-
| `expected_status` | no | `integer` | `200` | Expected HTTP status code. |
4585-
| `status` | no | `integer` | | Expected HTTP status code alias. |
4586-
| `contains` | no | `string` | | Required substring in stdout or HTTP response body. |
4587-
4588-
Result fields:
4589-
4590-
- `changed`: Whether the plugin changed the target or controller state.
4591-
- `message`: Human-readable result message.
4592-
- `rc`: Process or command return code when applicable.
4593-
- `stdout`: Captured standard output when applicable.
4594-
- `stderr`: Captured standard error when applicable.
4595-
- `data`: Plugin-specific structured result data.
4596-
4597-
Example:
4598-
4599-
```yaml
4600-
use: health.http
4601-
with:
4602-
url: https://example.invalid/health
4603-
```
4604-
4605-
### `health.listen`
4606-
4607-
Assert that a TCP port is listening on the target.
4608-
4609-
- Remote session: `true`
4610-
- Dry-run support: `true`
4611-
- Check mode support: `false`
4612-
4613-
| Parameter | Required | Type | Default | Description |
4614-
|---|---:|---|---|---|
4615-
| `port` | yes | `integer` | | TCP port number. |
4616-
| `host` | no | `string` | | Hostname or IP address to check from the controller. |
4617-
| `listen` | no | `boolean` | `True` | Check whether a port is listening on the target. |
4618-
| `timeout` | no | `number` | | Operation timeout in seconds. |
4619-
| `sudo` | no | `boolean` | `False` | Run the remote operation through sudo -n when supported. |
4620-
4621-
Result fields:
4622-
4623-
- `changed`: Whether the plugin changed the target or controller state.
4624-
- `message`: Human-readable result message.
4625-
- `rc`: Process or command return code when applicable.
4626-
- `stdout`: Captured standard output when applicable.
4627-
- `stderr`: Captured standard error when applicable.
4628-
- `data`: Plugin-specific structured result data.
4629-
4630-
Example:
4631-
4632-
```yaml
4633-
use: health.listen
4634-
with:
4635-
port: 22
4636-
```
4637-
4638-
### `health.port`
4639-
4640-
Assert that a TCP port is reachable from the controller or listening on the target.
4641-
4642-
- Remote session: `true`
4643-
- Dry-run support: `true`
4644-
- Check mode support: `false`
4645-
4646-
| Parameter | Required | Type | Default | Description |
4647-
|---|---:|---|---|---|
4648-
| `port` | yes | `integer` | | TCP port number. |
4649-
| `host` | no | `string` | | Hostname or IP address to check from the controller. |
4650-
| `listen` | no | `boolean` | `True` | Check whether a port is listening on the target. |
4651-
| `timeout` | no | `number` | | Operation timeout in seconds. |
4652-
| `sudo` | no | `boolean` | `False` | Run the remote operation through sudo -n when supported. |
4653-
4654-
Result fields:
4655-
4656-
- `changed`: Whether the plugin changed the target or controller state.
4657-
- `message`: Human-readable result message.
4658-
- `rc`: Process or command return code when applicable.
4659-
- `stdout`: Captured standard output when applicable.
4660-
- `stderr`: Captured standard error when applicable.
4661-
- `data`: Plugin-specific structured result data.
4662-
4663-
Example:
4664-
4665-
```yaml
4666-
use: health.port
4667-
with:
4668-
port: 22
4669-
```
4670-
4671-
### `health.process`
4672-
4673-
Assert that a remote process matching a pattern exists or is absent.
4674-
4675-
- Remote session: `true`
4676-
- Dry-run support: `true`
4677-
- Check mode support: `false`
4678-
4679-
| Parameter | Required | Type | Default | Description |
4680-
|---|---:|---|---|---|
4681-
| `pattern` | yes | `string` | | Regex, process pattern or search pattern. |
4682-
| `state` | no | `string` | | Desired state such as present, absent, started or stopped. |
4683-
| `sudo` | no | `boolean` | `False` | Run the remote operation through sudo -n when supported. |
4684-
4685-
Result fields:
4686-
4687-
- `changed`: Whether the plugin changed the target or controller state.
4688-
- `message`: Human-readable result message.
4689-
- `rc`: Process or command return code when applicable.
4690-
- `stdout`: Captured standard output when applicable.
4691-
- `stderr`: Captured standard error when applicable.
4692-
- `data`: Plugin-specific structured result data.
4693-
4694-
Example:
4695-
4696-
```yaml
4697-
use: health.process
4698-
with:
4699-
pattern: KEY=.*
4700-
```
4701-
47024564
## hostname
47034565

47044566
### `hostname.set`

docs/plugins/index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ group.exists
150150
group.member_absent
151151
group.members
152152
group.remove
153-
health.http
154-
health.listen
155-
health.port
156-
health.process
157153
hostname.set
158154
hosts.entry
159155
http.assert

docs/plugins/linux-operations.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ backend-aware through the same safety rules as `network.dns`: managed or
113113
symlinked resolver files are not overwritten silently.
114114

115115

116-
## Service health assertions
116+
## Runtime service checks
117117

118-
Use `health.port`, `health.listen`, `health.process` and `health.http` to assert
119-
that ports, processes and HTTP endpoints are available after a change. These
120-
macros are read-only and provide explicit no-diff reasons plus copy/pasteable
121-
manual checks.
118+
Use `network.port_check` for target-side TCP/UDP connectivity checks,
119+
`http.request` for controller-side HTTP probes, and the `process.*` family for
120+
process lifecycle checks. The former service-health wrapper namespace is
121+
intentionally not part of the public plugin surface.
122122

123123

124124
## Certificate and PKI operations

examples/runbooks/RUNBOOK_INDEX.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Per-plugin runbooks only. No combined runbook, no reused runtime smoke flow, and
2626
| `runbooks/20-fs.check.yaml` | `fs` | 27 |
2727
| `runbooks/21-fstab.check.yaml` | `fstab` | 4 |
2828
| `runbooks/22-group.check.yaml` | `group` | 5 |
29-
| `runbooks/23-health.check.yaml` | `health` | 4 |
3029
| `runbooks/24-hostname.check.yaml` | `hostname` | 1 |
3130
| `runbooks/25-hosts.check.yaml` | `hosts` | 1 |
3231
| `runbooks/26-http.check.yaml` | `http` | 3 |

examples/runbooks/runbooks/23-health.check.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/automax/plugins/health.py

Lines changed: 0 additions & 87 deletions
This file was deleted.

src/automax/plugins/registry.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,6 @@ def build_builtin_registry(extra_plugin_paths: Iterable[str] = ()) -> PluginRegi
328328
PamSucceedIfPlugin,
329329
PamValidatePlugin,
330330
)
331-
from automax.plugins.health import (
332-
HealthHttpPlugin,
333-
HealthListenPlugin,
334-
HealthPortPlugin,
335-
HealthProcessPlugin,
336-
)
337331
from automax.plugins.pki import (
338332
PkiCaInstallPlugin,
339333
PkiCertExpiryAssertPlugin,
@@ -764,10 +758,6 @@ def build_builtin_registry(extra_plugin_paths: Iterable[str] = ()) -> PluginRegi
764758
NetworkRouteAssertPlugin(),
765759
NetworkDnsAssertPlugin(),
766760
NetworkPortCheckPlugin(),
767-
HealthPortPlugin(),
768-
HealthListenPlugin(),
769-
HealthProcessPlugin(),
770-
HealthHttpPlugin(),
771761
PkiCaInstallPlugin(),
772762
PkiKeyPermissionsPlugin(),
773763
PkiCertExpiryAssertPlugin(),

tests/test_documentation_and_regressions.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,22 @@ def test_read_only_command_plugin_is_shared_base_class():
838838

839839

840840

841+
842+
def test_health_namespace_is_removed_from_public_documentation_and_runbooks():
843+
from automax.plugins.registry import build_builtin_registry
844+
845+
assert not any(name.startswith("health.") for name in build_builtin_registry().names())
846+
847+
searched = [
848+
Path("docs/plugins/index.md"),
849+
Path("docs/plugins/linux-operations.md"),
850+
Path("docs/plugins/generated.md"),
851+
Path("examples/runbooks/RUNBOOK_INDEX.md"),
852+
*Path("examples/runbooks/runbooks").glob("*.check.yaml"),
853+
]
854+
offenders = [str(path) for path in searched if "health." in path.read_text(encoding="utf-8")]
855+
assert offenders == []
856+
841857
def test_resolver_namespace_is_not_public_plugin_surface():
842858
from automax.plugins.registry import build_builtin_registry
843859

tests/test_next_engine.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3639,19 +3639,14 @@ def test_network_plugins_render_interface_route_bond_vlan_dns():
36393639
assert NetworkDnsPlugin().manual_commands({"nameservers": ["192.0.2.53"]}, context)
36403640

36413641

3642-
def test_health_plugins_render_safe_assertions():
3643-
from automax.plugins.health import HealthHttpPlugin, HealthListenPlugin, HealthPortPlugin, HealthProcessPlugin
3644-
3642+
def test_health_namespace_is_not_public_plugin_surface():
36453643
names = AutomaxEngine().plugin_registry.names()
3646-
for name in ("health.port", "health.listen", "health.process", "health.http"):
3647-
assert name in names
36483644

3649-
context = _sysops_preview_context()
3650-
assert "ss -H -ltn" in HealthPortPlugin().manual_commands({"port": 443}, context)[0]
3651-
assert "ss -H -ltn" in HealthListenPlugin().manual_commands({"port": 8443}, context)[0]
3652-
assert "pgrep -af" in HealthProcessPlugin().manual_commands({"pattern": "sshd"}, context)[0]
3653-
assert "read-only process assertion" in HealthProcessPlugin().diff_preview_reason({"pattern": "sshd"}, context)
3654-
assert HealthHttpPlugin().name == "health.http"
3645+
assert not any(name.startswith("health.") for name in names)
3646+
assert "http.request" in names
3647+
assert "network.port_check" in names
3648+
assert "process.assert_absent" in names
3649+
assert "process.assert_count" in names
36553650

36563651

36573652
def test_pki_plugins_install_permissions_and_expiry_preview():

0 commit comments

Comments
 (0)