Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork21
Commit8672743
authored
fix: resolve nested step dependency and argument inheritance issues (#258)
This commit addresses multiple related issues with nested step dependenciesand argument inheritance in Reactor:**Core Issues Fixed:**- Steps inside nested contexts (around, group, switch, map) couldn't depend on parent scope results- Compose steps inside maps couldn't access the map's arguments- Missing dependency tracking for cross-scope references**Key Changes:**1. **Enhanced Planner (lib/reactor/planner.ex)**: - Added extract_nested_dependencies() to identify cross-scope dependencies - Added support for nested step dependency tracking via new nested_steps/1 callback - Properly handles result() references from nested steps to parent scope2. **Improved Map Step (lib/reactor/step/map.ex)**: - Implemented nested_steps/1 callback to expose contained steps to planner - Enhanced argument inheritance for nested compose steps - Added support for cross-scope element references - Fixed element argument resolution for nested contexts3. **Enhanced Step Protocol (lib/reactor/step.ex)**: - Added optional nested_steps/1 callback for steps containing other steps - Provides default empty implementation via use Reactor.Step4. **Map DSL Improvements (lib/reactor/dsl/map.ex)**: - Added context passing for argument inheritance - Compose steps now automatically inherit map arguments when not explicitly provided - Supports nested map contexts with proper argument propagation5. **Runtime Support (lib/reactor/executor/step_runner.ex)**: - Added nested dependency collection and context passing - Enables runtime access to cross-scope dependencies6. **Compose Builder Fix (lib/reactor/builder/compose.ex)**: - Improved error handling for missing arguments - Better error reporting when both extra and missing arguments exist**Test Coverage:**- Added comprehensive tests for nested dependency resolution- Added tests for compose steps in maps with argument inheritance- Added tests for cross-scope dependency scenarios- Verified proper error handling for invalid patterns**Backwards Compatibility:**- All changes are backwards compatible- Existing functionality unchanged- New features are opt-in via the nested_steps callbackFixes issues with compose steps in maps not having access to map argumentsand resolves dependency planning issues for nested step contexts.1 parent981aea1 commit8672743
File tree
9 files changed
+639
-26
lines changed- lib/reactor
- builder
- dsl
- executor
- step
- test/reactor
- bugs
- dsl
9 files changed
+639
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
170 | 174 | | |
171 | 175 | | |
172 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
173 | 180 | | |
174 | 181 | | |
175 | 182 | | |
| |||
244 | 251 | | |
245 | 252 | | |
246 | 253 | | |
247 | | - | |
| 254 | + | |
248 | 255 | | |
249 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
250 | 283 | | |
251 | 284 | | |
252 | 285 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
448 | 451 | | |
449 | 452 | | |
450 | 453 | | |
| |||
453 | 456 | | |
454 | 457 | | |
455 | 458 | | |
456 | | - | |
| 459 | + | |
| 460 | + | |
457 | 461 | | |
458 | 462 | | |
459 | 463 | | |
460 | 464 | | |
461 | 465 | | |
462 | 466 | | |
463 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
464 | 491 | | |
465 | 492 | | |
466 | 493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
| |||
107 | 116 | | |
108 | 117 | | |
109 | 118 | | |
110 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
111 | 188 | | |
112 | 189 | | |
113 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
200 | 222 | | |
201 | 223 | | |
202 | 224 | | |
| |||
249 | 271 | | |
250 | 272 | | |
251 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
252 | 288 | | |
253 | 289 | | |
254 | 290 | | |
| |||
277 | 313 | | |
278 | 314 | | |
279 | 315 | | |
280 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
281 | 321 | | |
282 | 322 | | |
283 | 323 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | | - | |
| 5 | + | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
94 | | - | |
| 93 | + | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
104 | | - | |
| 109 | + | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
109 | | - | |
| 114 | + | |
| 115 | + | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
116 | 128 | | |
117 | 129 | | |
118 | 130 | | |
| |||
124 | 136 | | |
125 | 137 | | |
126 | 138 | | |
127 | | - | |
| 139 | + | |
128 | 140 | | |
129 | 141 | | |
130 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
131 | 156 | | |
132 | 157 | | |
133 | 158 | | |
| |||
289 | 314 | | |
290 | 315 | | |
291 | 316 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | 317 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
304 | 325 | | |
305 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
306 | 332 | | |
307 | 333 | | |
308 | 334 | | |
| |||
0 commit comments
Comments
(0)