Commit 6f6be66
committed
refactor(import): extract shared CDK import pipeline to eliminate duplication
The three import handlers (import-runtime, import-memory, actions) all
repeated the same CDK build/synth/bootstrap/publish/phase1/phase2/state-update
pipeline (~120 lines each). Extract this into executeCdkImportPipeline() in
a new import-pipeline.ts module. Also add resolveImportContext() and
failResult() helpers to import-utils.ts for shared setup and error handling.
Net effect: -335 lines, zero behavior change, all 260 tests pass.
Constraint: Must not change any observable behavior — pure structural refactor
Rejected: Full strategy-pattern abstraction | over-engineering for 2 concrete cases
Confidence: high
Scope-risk: moderate
Not-tested: actions.ts YAML import path with real AWS (infra limitation)1 parent 7a1b407 commit 6f6be66
6 files changed
Lines changed: 542 additions & 728 deletions
File tree
- src/cli/commands/import
- __tests__
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
| 37 | + | |
29 | 38 | | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
34 | 50 | | |
35 | 51 | | |
36 | 52 | | |
| |||
110 | 126 | | |
111 | 127 | | |
112 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
113 | 137 | | |
114 | 138 | | |
115 | 139 | | |
| |||
123 | 147 | | |
124 | 148 | | |
125 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
126 | 165 | | |
127 | 166 | | |
128 | 167 | | |
| |||
133 | 172 | | |
134 | 173 | | |
135 | 174 | | |
| 175 | + | |
| 176 | + | |
136 | 177 | | |
137 | 178 | | |
138 | 179 | | |
| |||
0 commit comments