refactor: relocate counter and rename queue messaging packages#187
Merged
Conversation
JamyDev
approved these changes
Jun 3, 2026
Structural moves only — no behavior change. - Relocate submitqueue/extension/counter -> extension/counter (generic infrastructure belongs at the shared top level alongside the other cross-domain extensions). - Rename the messaging-transport packages entity/queue -> entity/messagequeue and extension/queue -> extension/messagequeue (package `messagequeue`), including the mysql impl, mock, ctl, and schema. "queue" was overloaded with the submit queue (Request.Queue, QueueConfig); messagequeue disambiguates. Repoints all import paths, converges call sites onto the entityqueue / extqueue / queuemock / queueMySQL aliases (no bare `queue.` package ref remains), moves the integration suites, and updates Makefile, CI targets, and docs. Test compose contexts renamed to ext-counter-mysql / ext-messagequeue-sql. ## Test Plan ✅ make build, make test ✅ make gazelle / tidy / mocks clean
a603f6e to
35f59cb
Compare
behinddwalls
added a commit
that referenced
this pull request
Jun 4, 2026
…tures (#188) ## Summary ### Why? Behavioral extensions were global singletons frozen at process start, and two leaked the queue into vendor-agnostic method signatures (`mergechecker.Check`, `buildrunner.Trigger`). Each extension should instead be produced by a Factory the controller asks for using the queue, identified only by name, so an implementation can be selected/configured per queue. ### What? - Reduce `entity.QueueConfig` to `{Name}` (the registry of valid queues); all behavioral/VCS config moves into the factory implementations. - Each extension (changeprovider, pusher, scorer, conflict, mergechecker, buildrunner) ships a narrow `Config{QueueName}` and a `Factory` interface (`For(cfg) (T, error)`); concrete factories are written by integrators in the example wiring and tests. Generated mocks updated. - Drop the queue argument from `mergechecker.Check(ctx, change)` and `buildrunner.Trigger(ctx, base, head, metadata)`; delete `mergechecker.MultiChecker`. `Status`/`Cancel` stay buildID-keyed. - Add `storage.Factory` (default mysql) and thread it into every controller; the gateway `land` controller resolves `For(req.Queue)` — the one place per-queue storage routing is actionable. Orchestrator controllers carry a `TODO(queue-aware)` to derive the queue from the loaded entity for logging/metrics/storage. - Controllers resolve each extension from its Factory using the loaded entity's queue; `buildsignal` fetches the batch before polling `Status`. Example servers wire concrete static factory structs. Stacked on #187 (now merged); rebased onto main. ## Test Plan ✅ `make build`, `make test` (40 pass) ✅ `make fmt` / `lint` / `check-gazelle` / `check-tidy` / `check-mocks` ✅ Integration + e2e (Docker) verified locally: counter, gateway, orchestrator, e2e suites pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Structural moves only — no behavior change.
submitqueue/extension/counter→extension/counter(generic infrastructure belongs at the shared top level alongside the other cross-domain extensions).entity/queue→entity/messagequeueandextension/queue→extension/messagequeue(packagemessagequeue), including the mysql impl, mock, ctl, and schema. "queue" was overloaded with the submit queue (Request.Queue,QueueConfig);messagequeuedisambiguates.Repoints all import paths, converges call sites onto the
entityqueue/extqueue/queuemock/queueMySQLaliases (no barequeue.package ref remains), moves the integration suites, and updates Makefile, CI targets, and docs. Test compose contexts renamed toext-counter-mysql/ext-messagequeue-sql.Test Plan
✅
make build,make test✅
make gazelle/check-tidy/check-mockscleanStack