Show a warning when manifesting from a harvest as reminder it should be trusted first

This commit is contained in:
Miguel Jacq 2026-06-29 12:25:35 +10:00
parent ddb18403c8
commit b3d4adf7d4
Signed by: mig5
GPG key ID: 03906B4110AAD3B8
2 changed files with 31 additions and 0 deletions

View file

@ -87,6 +87,24 @@ def _write_state(bundle: Path, state: dict) -> None:
write_schema_state(bundle, state)
def test_manifest_warns_that_validation_is_not_semantic_safety(tmp_path: Path, capsys):
bundle = tmp_path / "bundle"
out = tmp_path / "ansible"
_write_state(bundle, _minimal_package_state([]))
manifest.manifest(str(bundle), str(out))
captured = capsys.readouterr()
assert (
"This harvest is structurally valid, but Enroll cannot prove it is semantically safe."
in captured.err
)
assert (
"Only apply manifests generated from harvests whose provenance you trust."
in captured.err
)
def test_manifest_writes_roles_and_playbook_with_clean_when(tmp_path: Path):
bundle = tmp_path / "bundle"
out = tmp_path / "ansible"