fix(awooop): allow ansible learning receipt rows
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 16s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 16s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
This commit is contained in:
@@ -1590,19 +1590,19 @@ def test_ansible_apply_operation_row_can_backfill_auto_repair_receipt() -> None:
|
||||
assert result.duration_ms == 456
|
||||
|
||||
|
||||
def test_ansible_apply_operation_row_reconstructs_from_columns_when_input_is_sparse() -> None:
|
||||
def test_ansible_apply_operation_row_reconstructs_from_input_without_physical_columns() -> None:
|
||||
reconstructed = _claim_from_apply_operation_row({
|
||||
"op_id": "apply-op-2",
|
||||
"parent_op_id": "check-op-2",
|
||||
"incident_id": "INC-20260629-231F8E",
|
||||
"status": "success",
|
||||
"catalog_id": "ansible:188-momo-backup-user",
|
||||
"playbook_path": "infra/ansible/playbooks/188-momo-backup-user.yml",
|
||||
"risk_level": "low",
|
||||
"input": {
|
||||
"incident_id": "INC-20260629-231F8E",
|
||||
"catalog_id": "ansible:188-momo-backup-user",
|
||||
"source_candidate_op_id": "candidate-op-2",
|
||||
"check_mode_op_id": "check-op-2",
|
||||
"playbook_path": "infra/ansible/playbooks/188-momo-backup-user.yml",
|
||||
"risk_level": "low",
|
||||
},
|
||||
"output": {"returncode": 0, "stdout_tail": "ok"},
|
||||
"dry_run_result": {"apply_executed": True},
|
||||
@@ -1624,6 +1624,9 @@ def test_ansible_apply_receipt_backfill_queries_existing_apply_rows() -> None:
|
||||
assert "operation_type = 'ansible_apply_executed'" in source
|
||||
assert "auto_repair_executions existing" in source
|
||||
assert "executed_steps::text LIKE" in source
|
||||
assert "apply.catalog_id" not in source
|
||||
assert "apply.playbook_path" not in source
|
||||
assert "apply.risk_level" not in source
|
||||
|
||||
|
||||
def test_ansible_auto_repair_receipt_insert_casts_asyncpg_parameters() -> None:
|
||||
@@ -1669,6 +1672,20 @@ def test_ansible_post_apply_km_writeback_is_idempotent_for_learning_backfill() -
|
||||
assert "KnowledgeDBRepository" in source
|
||||
|
||||
|
||||
def test_ansible_learning_writeback_operation_type_has_schema_migration() -> None:
|
||||
migration = Path(
|
||||
"apps/api/migrations/adr090e_ansible_learning_writeback_operation_type.sql"
|
||||
).read_text()
|
||||
down = Path(
|
||||
"apps/api/migrations/adr090e_ansible_learning_writeback_operation_type_down.sql"
|
||||
).read_text()
|
||||
|
||||
assert "ansible_learning_writeback_recorded" in migration
|
||||
assert "automation_operation_log_type_valid" in migration
|
||||
assert "DROP CONSTRAINT IF EXISTS automation_operation_log_type_valid" in migration
|
||||
assert "cannot remove ansible_learning_writeback_recorded" in down
|
||||
|
||||
|
||||
def test_ansible_live_controlled_apply_sends_telegram_receipt_but_backfill_does_not() -> None:
|
||||
live_source = inspect.getsource(run_controlled_apply_for_claim)
|
||||
backfill_source = inspect.getsource(backfill_missing_auto_repair_execution_receipts_once)
|
||||
|
||||
Reference in New Issue
Block a user