Commit b93affb
committed
refactor: [#174] remove OpenTofuClient from ProvisionCommandHandler constructor
Move OpenTofuClient from constructor dependency to local creation within
execute_provisioning_with_tracking method. This continues the pattern of
separating global dependencies from runtime/environment-specific ones.
Changes:
- Remove opentofu_client field from ProvisionCommandHandler struct
- Create OpenTofuClient locally with environment.tofu_build_dir()
- Convert create_instance() and get_instance_info() to static methods
that accept opentofu_client as parameter
- Update test builders and E2E tests to remove opentofu_client injection
- Add OpenTofuClient import to use type directly
Benefits:
- OpenTofuClient now created with environment-specific working directory
- Clearer separation between global and runtime dependencies
- Reduced constructor complexity (one less parameter)
- Static helper methods are more testable independently1 parent b79d7cf commit b93affb
File tree
3 files changed
+21
-25
lines changed- src
- application/command_handlers/provision
- tests
- testing/e2e/tasks/virtual_machine
3 files changed
+21
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
71 | | - | |
72 | 70 | | |
73 | 71 | | |
74 | 72 | | |
| |||
178 | 176 | | |
179 | 177 | | |
180 | 178 | | |
| 179 | + | |
181 | 180 | | |
182 | 181 | | |
183 | 182 | | |
| |||
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
191 | | - | |
| 190 | + | |
192 | 191 | | |
193 | 192 | | |
194 | | - | |
| 193 | + | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
246 | 249 | | |
247 | 250 | | |
248 | 251 | | |
| |||
253 | 256 | | |
254 | 257 | | |
255 | 258 | | |
256 | | - | |
257 | | - | |
258 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
| |||
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| 285 | + | |
281 | 286 | | |
282 | 287 | | |
283 | 288 | | |
284 | 289 | | |
285 | 290 | | |
286 | 291 | | |
287 | 292 | | |
| 293 | + | |
288 | 294 | | |
289 | 295 | | |
290 | 296 | | |
| |||
Lines changed: 2 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | 83 | | |
88 | 84 | | |
89 | 85 | | |
| |||
92 | 88 | | |
93 | 89 | | |
94 | 90 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 91 | + | |
| 92 | + | |
102 | 93 | | |
103 | 94 | | |
104 | 95 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | 152 | | |
154 | 153 | | |
155 | 154 | | |
| |||
0 commit comments