Commit 2f0096e
fix(bootstrap): resolve all versions in multiple-versions mode and prevent duplicate edges
Address architect and engineer feedback on multiple-versions implementation:
1. **Process all versions in resolve_and_add_top_level()**
- Pass return_all_versions=self.multiple_versions to resolve_versions()
- Loop through all resolved versions and add each to the graph
- Previously only processed results[0], losing other versions
- Maintain backward compatibility by returning first version
2. **Prevent duplicate TOP_LEVEL edges in graph**
- Skip _add_to_graph() call for TOP_LEVEL in _bootstrap_single_version()
- TOP_LEVEL nodes are already added in resolve_and_add_top_level()
- Calling _add_to_graph() again would create duplicate edges
3. **Handle empty resolution results**
- Check if resolved_versions is empty after resolution
- Raise RuntimeError to prevent silently skipping dependencies
- Existing exception handler routes to test_mode or fail-fast
4. **Fix test: move import to top of file**
- Move canonicalize_name import from local to top-level
- Change test to use RequirementType.INSTALL instead of TOP_LEVEL
- TOP_LEVEL graph addition now happens in resolve_and_add_top_level()
All 447 unit tests pass. All 20 bootstrap/build e2e tests pass.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Rohan Devasthale <rdevasth@redhat.com>1 parent 889df21 commit 2f0096e
2 files changed
Lines changed: 35 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
| |||
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
| 163 | + | |
159 | 164 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
173 | 184 | | |
174 | 185 | | |
175 | 186 | | |
| |||
286 | 297 | | |
287 | 298 | | |
288 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
289 | 304 | | |
290 | 305 | | |
291 | 306 | | |
| |||
322 | 337 | | |
323 | 338 | | |
324 | 339 | | |
325 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
326 | 343 | | |
327 | 344 | | |
328 | 345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | 301 | | |
304 | 302 | | |
305 | 303 | | |
| |||
336 | 334 | | |
337 | 335 | | |
338 | 336 | | |
339 | | - | |
| 337 | + | |
| 338 | + | |
340 | 339 | | |
341 | 340 | | |
342 | | - | |
| 341 | + | |
343 | 342 | | |
344 | 343 | | |
345 | 344 | | |
| |||
0 commit comments