Commit 365fd12
committed
refactor(storage): revert per-queue Factory; storage is global
## Summary
### Why?
PR #188 added `storage.Factory` (`For(queue) (Storage, error)`) and threaded it into every controller, leaving a `TODO(queue-aware)` in all 11 orchestrator controllers: each fell back to `stores.For("")` because storage is needed *before* the by-ID entity load, so the queue isn't known yet. That chicken-and-egg was the sole reason for the TODO.
Behavioral extensions (mergechecker, buildrunner, scorer, conflict, changeprovider, pusher) are already correctly per-queue — resolved *after* the load from the loaded entity's queue. Storage, by contrast, does not vary by queue: every queue shares the same entity schema and tables. Per-queue storage, if ever needed, is better achieved by splitting the environment and wiring different stores per deployment, not an in-process Factory.
### What?
- Remove the `storage.Factory` interface and delete the `staticFactory` / `NewStaticFactory` implementation (+ its test). Regenerate the storage mock (drops `MockFactory`).
- Switch the 11 orchestrator controllers and the gateway `land` controller from `storage.Factory` to a single injected `storage.Storage`; drop the `stores.For("")` hack and the `TODO(queue-aware)` comments. Queue for logging and behavioral-extension resolution continues to come from the loaded entity.
- Update example wiring (gateway + orchestrator `main.go`) to pass the store directly instead of `NewStaticFactory(store)`.
- Behavioral-extension Factories are unchanged.
No behavior change under today's single-store deployment — `For("")` already returned this exact store.
## Test Plan
✅ `make build`, `make test` (39 pass)
✅ `make gazelle` / `make mocks` / `make tidy` / `make fmt` (all in sync)1 parent 61dd1ae commit 365fd12
36 files changed
Lines changed: 75 additions & 297 deletions
File tree
- example/submitqueue
- gateway/server
- orchestrator/server
- submitqueue
- extension/storage
- mock
- gateway/controller
- orchestrator/controller
- batch
- buildsignal
- build
- cancel
- conclude
- log
- merge
- score
- speculate
- start
- validate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
201 | 200 | | |
202 | 201 | | |
203 | 202 | | |
204 | | - | |
205 | | - | |
| 203 | + | |
| 204 | + | |
206 | 205 | | |
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
210 | | - | |
211 | 209 | | |
212 | 210 | | |
213 | 211 | | |
| |||
223 | 221 | | |
224 | 222 | | |
225 | 223 | | |
226 | | - | |
| 224 | + | |
227 | 225 | | |
228 | 226 | | |
229 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | 464 | | |
469 | 465 | | |
470 | 466 | | |
471 | | - | |
| 467 | + | |
472 | 468 | | |
473 | 469 | | |
474 | 470 | | |
| |||
481 | 477 | | |
482 | 478 | | |
483 | 479 | | |
484 | | - | |
| 480 | + | |
485 | 481 | | |
486 | 482 | | |
487 | 483 | | |
| |||
493 | 489 | | |
494 | 490 | | |
495 | 491 | | |
496 | | - | |
| 492 | + | |
497 | 493 | | |
498 | 494 | | |
499 | 495 | | |
| |||
510 | 506 | | |
511 | 507 | | |
512 | 508 | | |
513 | | - | |
| 509 | + | |
514 | 510 | | |
515 | 511 | | |
516 | 512 | | |
| |||
524 | 520 | | |
525 | 521 | | |
526 | 522 | | |
527 | | - | |
| 523 | + | |
528 | 524 | | |
529 | 525 | | |
530 | 526 | | |
| |||
549 | 545 | | |
550 | 546 | | |
551 | 547 | | |
552 | | - | |
| 548 | + | |
553 | 549 | | |
554 | 550 | | |
555 | 551 | | |
| |||
561 | 557 | | |
562 | 558 | | |
563 | 559 | | |
564 | | - | |
| 560 | + | |
565 | 561 | | |
566 | 562 | | |
567 | 563 | | |
| |||
574 | 570 | | |
575 | 571 | | |
576 | 572 | | |
577 | | - | |
| 573 | + | |
578 | 574 | | |
579 | 575 | | |
580 | 576 | | |
| |||
587 | 583 | | |
588 | 584 | | |
589 | 585 | | |
590 | | - | |
| 586 | + | |
591 | 587 | | |
592 | 588 | | |
593 | 589 | | |
| |||
600 | 596 | | |
601 | 597 | | |
602 | 598 | | |
603 | | - | |
| 599 | + | |
604 | 600 | | |
605 | 601 | | |
606 | 602 | | |
| |||
612 | 608 | | |
613 | 609 | | |
614 | 610 | | |
615 | | - | |
| 611 | + | |
616 | 612 | | |
617 | 613 | | |
618 | 614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
This file was deleted.
This file was deleted.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | 113 | | |
122 | 114 | | |
123 | 115 | | |
| |||
141 | 133 | | |
142 | 134 | | |
143 | 135 | | |
144 | | - | |
| 136 | + | |
145 | 137 | | |
146 | 138 | | |
147 | 139 | | |
| |||
0 commit comments