fix(fusion_plating): wet_process passthrough + per-clone unlink safety

Two follow-up fixes caught during the entech deploy of recipe cleanup:

1. RESOLVER_KIND_TO_ACTIVE_KIND was missing a self-pass entry for
   'wet_process'. The new aliases added in 19.0.21.3.0 (Chemical
   Conversion, Trivalent Chromate Conversion, Strip Process - AL,
   Plug The Threaded Holes via mask) directly return 'wet_process'
   from the resolver — without the passthrough they didn't translate
   to any active kind and stayed as 'other'. Added 'wet_process':
   'wet_process' so the migration's Phase 2 backfill catches them.

2. Migration 19.0.10.26.0 Phase 3 was using batch unlink
   (clone_recipes.unlink()) which tripped a PostgreSQL FK cascade
   ordering bug on entech ("insert or update on parent_id violates
   FK ..." during the CASCADE chain). Rewrote Phase 3 to delete one
   clone at a time with SAVEPOINT per clone — slower but immune to
   the batching bug, and one failed clone doesn't roll back the
   whole transaction.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-05-24 18:08:35 -04:00
parent 9a2975b154
commit e1fedf7231
2 changed files with 47 additions and 16 deletions

View File

@@ -362,6 +362,12 @@ RESOLVER_KIND_TO_ACTIVE_KIND = {
'strike': 'wet_process',
'dry': 'wet_process',
'wbf_test': 'wet_process',
'wet_process': 'wet_process', # the alias added in 19.0.21.3.0
# for "Strip Process - AL", "Chemical
# Conversion", "Trivalent Chromate
# Conversion" maps DIRECTLY to
# 'wet_process' — this passthrough
# entry lets those land correctly.
# 1:1 mappings (kind exists and is active)
'contract_review': 'contract_review',
'mask': 'mask',