fix(playbook): seed tuple unpack + text[] → jsonb migration
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled

- playbook_seed_service.py: list_playbooks 回傳 tuple[list, int],
  缺少解包導致 'list' has no attribute 'source'
- fix_playbooks_array_to_jsonb.sql: source_incident_ids/tags text[] → jsonb
  (已手動套用 prod DB)

2026-04-15 ogt + Claude Sonnet 4.6(亞太)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-15 22:03:59 +08:00
parent da871fc149
commit c05bac6112
2 changed files with 12 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ async def seed_playbooks_from_rules() -> None:
repo = get_playbook_repository()
# 取得現有 playbook source_ids避免重複建立
existing = await repo.list_playbooks(status=PlaybookStatus.APPROVED, limit=500)
existing, _ = await repo.list_playbooks(status=PlaybookStatus.APPROVED, limit=500)
existing_sources = {p.source for p in existing if p.source}
seeded = 0