Commit 2b3ba3c
authored
fix(gen2-migration): skip imported auth resources in refactor step (#14722)
fix(cli-internal): skip imported auth resources in refactor step
Imported (reference) auth resources have no nested CloudFormation
stack — they reference externally-managed Cognito resources. The
refactor step was unconditionally creating an
AuthCognitoForwardRefactorer for every auth:Cognito resource,
which then failed with "unable to find source stack" because
there is no stack to find.
Now checks serviceType === 'imported' in amplify-meta.json before
creating the refactorer, matching the existing pattern in the
generate step. Added tests for both forward and rollback paths.
---
Prompt: In the gen2-migration tool, I am getting this error
when trying to refactor an app with an imported auth resource -
"[AuthCognitoForwardRefactorer] unable to find source stack"1 parent c86f4e5 commit 2b3ba3c
2 files changed
Lines changed: 63 additions & 21 deletions
File tree
- packages/amplify-cli/src
- __tests__/commands/gen2-migration/refactor
- commands/gen2-migration/refactor
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
235 | 246 | | |
236 | 247 | | |
237 | 248 | | |
| |||
254 | 265 | | |
255 | 266 | | |
256 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
257 | 279 | | |
258 | 280 | | |
Lines changed: 39 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
85 | 94 | | |
| 95 | + | |
86 | 96 | | |
87 | 97 | | |
88 | 98 | | |
| |||
143 | 153 | | |
144 | 154 | | |
145 | 155 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
150 | 169 | | |
| 170 | + | |
151 | 171 | | |
152 | 172 | | |
153 | 173 | | |
| |||
0 commit comments