Skip to content

refactor: relocate counter and rename queue messaging packages#187

Merged
behinddwalls merged 1 commit into
mainfrom
messagequeue-moves
Jun 3, 2026
Merged

refactor: relocate counter and rename queue messaging packages#187
behinddwalls merged 1 commit into
mainfrom
messagequeue-moves

Conversation

@behinddwalls
Copy link
Copy Markdown
Collaborator

@behinddwalls behinddwalls commented Jun 3, 2026

Summary

Structural moves only — no behavior change.

  • Relocate submitqueue/extension/counterextension/counter (generic infrastructure belongs at the shared top level alongside the other cross-domain extensions).
  • Rename the messaging-transport packages entity/queueentity/messagequeue and extension/queueextension/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 / check-tidy / check-mocks clean

Stack

  1. @ refactor: relocate counter and rename queue messaging packages #187
  2. refactor(extensions): per-queue Factory; drop queue from method signatures #188

@behinddwalls behinddwalls marked this pull request as ready for review June 3, 2026 22:56
@behinddwalls behinddwalls requested review from a team and sbalabanov as code owners June 3, 2026 22:56
@behinddwalls behinddwalls marked this pull request as draft June 3, 2026 22:57
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
@behinddwalls behinddwalls marked this pull request as ready for review June 3, 2026 23:08
@behinddwalls behinddwalls merged commit 7032251 into main Jun 3, 2026
25 checks passed
@behinddwalls behinddwalls deleted the messagequeue-moves branch June 3, 2026 23:13
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants