fix(api): record ansible repair receipts with typed inserts
All checks were successful
Code Review / ai-code-review (push) Successful in 15s
CD Pipeline / tests (push) Successful in 1m46s
CD Pipeline / build-and-deploy (push) Successful in 5m28s
CD Pipeline / post-deploy-checks (push) Successful in 1m50s

This commit is contained in:
Your Name
2026-06-27 14:27:15 +08:00
parent e92d8e35aa
commit 8d31fbf69e
2 changed files with 18 additions and 8 deletions

View File

@@ -17,6 +17,7 @@ from src.services.awooop_ansible_check_mode_service import (
_automation_operation_log_incident_id,
_build_auto_repair_execution_receipt,
_claim_from_apply_operation_row,
_record_auto_repair_execution_receipt,
build_ansible_apply_command,
build_ansible_check_mode_claim_input,
build_ansible_check_mode_command,
@@ -1519,6 +1520,15 @@ def test_ansible_apply_receipt_backfill_queries_existing_apply_rows() -> None:
assert "executed_steps::text LIKE" in source
def test_ansible_auto_repair_receipt_insert_casts_asyncpg_parameters() -> None:
source = inspect.getsource(_record_auto_repair_execution_receipt)
assert "CAST(:incident_id AS varchar(30))" in source
assert "CAST(:playbook_id AS varchar(36))" in source
assert "CAST(:triggered_by AS varchar(50))" in source
assert "CAST(:apply_op_id_needle AS text)" in source
def test_ansible_claim_query_limits_recent_candidate_backlog() -> None:
source = inspect.getsource(claim_pending_check_modes)