2.7 KiB
2.7 KiB
ECM Sync Quality Cleanup Execution Plan
Goal
This cleanup pass keeps behavior unchanged and prioritizes deleting, merging, and unifying duplicated code on the single-pipeline path.
Acceptance remains unchanged:
backend/local_tests/sync_system_tests/depm_to_ecm_bootstrap_pull_then_project_push.pipeline.yamlmust still run successfully.- Local Summary and Remote Summary must keep the same structure and stable output shape.
Constraints
- Do not modify
schemas/. - Do not modify
filtered_datasource/. - Do not bypass schema validation.
- Do not add fallback logic that changes behavior.
- Prefer helper extraction, deletion, and merge over new abstraction layers.
Execution Order
Batch 1: Entry + Factory
Status: completed
- Turn
run.pyinto a thin wrapper aroundsync_state_machine.cli.main. - Merge duplicated datasource lifecycle and resolved-config logging in
sync_state_machine/pipeline/factory.py. - Verify with focused unit tests and the real DEPM to ECM profile.
Batch 2: Pipeline Flow + Backend Runner
Status: completed
- Reduce repeated phase-completion, strategy-loop, reload-skip, and close-handling code in
sync_state_machine/pipeline/full_sync_pipeline.py. - Reduce repeated orchestration code in
backend/app/thirdparty/ecm_sync/scripts/depm_to_ecm/run_pipeline.pywithout changing CLI behavior or fail-fast rules. - Keep log text stable where practical.
Batch 3: Datasource + Handler Base Cleanup
Status: completed
- Reduce duplicated handler registration and context injection between datasource base classes and subclasses.
- Reduce duplicated node metadata initialization across handler subclasses by pushing safe defaults into handler base classes.
- Delete domain-level constructor boilerplate where subclasses only repeat node type, node class, schema, or no-op
_create_nodewrappers.
Batch 4: Domain Repeat Cleanup + Docs
Status: in progress
- Inspect domain handlers for repeated load/update helper logic and merge only stable repeated fragments into shared helpers.
- Update docs so they only describe the real maintained execution path.
- Keep backend runner documentation aligned with current script behavior.
- Remove stale references only after code paths are confirmed stable.
Validation Plan
- Run targeted
ecm_sync_systemunit tests for the touched pipeline code. - Run the real backend profile with the backend interpreter.
- Confirm the output still ends with pipeline completion plus Local Summary and Remote Summary tables.
Current Focus
Current implementation focus is Batch 4.
- repeated load/update helpers under
sync_state_machine/domain/ - maintained execution-path docs under
docs/
The intent is code reduction only, not behavior redesign.