Skip to content

refactor: nest domain code under submitqueue/, extract shared layers#185

Merged
behinddwalls merged 1 commit into
mainfrom
refactor-structure
Jun 3, 2026
Merged

refactor: nest domain code under submitqueue/, extract shared layers#185
behinddwalls merged 1 commit into
mainfrom
refactor-structure

Conversation

@behinddwalls
Copy link
Copy Markdown
Collaborator

@behinddwalls behinddwalls commented Jun 3, 2026

Summary

Why?

SubmitQueue's domain code lived at the repo root (gateway/, orchestrator/,
entity/, extension/) while a second service family, Stovepipe, already lived
under stovepipe/. The layout was asymmetric and the line between
domain-specific and genuinely shared code was implicit. This restructure
gives every domain its own top-level folder and pulls shared code into
clearly labeled shared layers, so "what's shared vs domain" is obvious from
the directory tree.

What?

New layout — shared building blocks at the top level, one folder per domain:

core/             # SHARED cross-domain infra: errs, httpclient, metrics (no domain deps)
entity/           # SHARED entities: queue/
extension/        # SHARED extensions: queue/
submitqueue/      # SubmitQueue domain
├── gateway/
├── orchestrator/
├── entity/
├── extension/
└── core/         # consumer, request (shared between SubmitQueue's own services)
stovepipe/        # Stovepipe domain (gateway/ orchestrator/ entity/ extension/ core/)
example/
├── submitqueue/  # servers + clients + docker-compose
└── stovepipe/
test/
├── integration/{core,submitqueue,stovepipe}/
└── e2e/submitqueue/
doc/rfc/          # sql-queue-rfc.md (shared) + submitqueue/{workflow,build-runner}.md
  • Domain code nests per domain: submitqueue/{gateway,orchestrator,entity,extension,core}, mirroring the existing stovepipe/ layout.
  • Shared layers at the top level: core/ (cross-domain infra — errs, httpclient, metrics, now with zero domain deps), entity/ (shared entities: queue), extension/ (shared extensions: queue).
  • submitqueue/core/ holds infra shared only between SubmitQueue's own services (consumer, request), moved out of the top-level core/ so it is domain-free. stovepipe/core/ added as a placeholder for symmetry.
  • example/ and test/ mirror the split: example/submitqueue/..., test/integration/{core,submitqueue,stovepipe}/..., test/e2e/submitqueue/.
  • RFCs: SubmitQueue-specific RFCs moved under doc/rfc/submitqueue/; the shared sql-queue RFC stays at doc/rfc/.
  • Make targets made domain-explicit (build-submitqueue-, integration-test-submitqueue-, local-submitqueue-*), mirroring the existing -stovepipe- targets; CI updated to match.
  • Tests: domain-qualified docker-compose project names; integration/e2e run in parallel (--test_output=errors) and always execute a real pass (tags=["external"]) since they are non-hermetic.
  • Import paths rewritten throughout; protos regenerated; CLAUDE.md, READMEs, and doc/howto/TESTING.md updated to the new structure and naming convention.

No behavior changes — this is a structural move.

Test Plan

  • make build (bazel build //...) and make test (40/40 unit tests)
  • make integration-test — 8/8 pass; verified running in parallel (67s vs 275s serial) and always-run (uncached re-runs)
  • make e2e-test — passes; always-run
  • make lint (incl. license headers); gazelle / mocks / tidy / fmt all stable (CI gates clean)

@behinddwalls behinddwalls marked this pull request as ready for review June 3, 2026 13:26
@behinddwalls behinddwalls requested review from a team and sbalabanov as code owners June 3, 2026 13:26
## Summary

### Why?

SubmitQueue's domain code lived at the repo root (gateway/, orchestrator/,
entity/, extension/) while a second service family, Stovepipe, already lived
under stovepipe/. The layout was asymmetric and the line between
domain-specific and genuinely shared code was implicit. This restructure
gives every domain its own top-level folder and pulls shared code into
clearly labeled shared layers, so "what's shared vs domain" is obvious from
the directory tree.

### What?

New layout — shared building blocks at the top level, one folder per domain:

```
core/             # SHARED cross-domain infra: errs, httpclient, metrics (no domain deps)
entity/           # SHARED entities: queue/
extension/        # SHARED extensions: queue/
submitqueue/      # SubmitQueue domain
├── gateway/
├── orchestrator/
├── entity/
├── extension/
└── core/         # consumer, request (shared between SubmitQueue's own services)
stovepipe/        # Stovepipe domain (gateway/ orchestrator/ entity/ extension/ core/)
example/
├── submitqueue/  # servers + clients + docker-compose
└── stovepipe/
test/
├── integration/{core,submitqueue,stovepipe}/
└── e2e/submitqueue/
doc/rfc/          # sql-queue-rfc.md (shared) + submitqueue/{workflow,build-runner}.md
```

- Domain code nests per domain: submitqueue/{gateway,orchestrator,entity,extension,core}, mirroring the existing stovepipe/ layout.
- Shared layers at the top level: core/ (cross-domain infra — errs, httpclient, metrics, now with zero domain deps), entity/ (shared entities: queue), extension/ (shared extensions: queue).
- submitqueue/core/ holds infra shared only between SubmitQueue's own services (consumer, request), moved out of the top-level core/ so it is domain-free. stovepipe/core/ added as a placeholder for symmetry.
- example/ and test/ mirror the split: example/submitqueue/..., test/integration/{core,submitqueue,stovepipe}/..., test/e2e/submitqueue/.
- RFCs: SubmitQueue-specific RFCs moved under doc/rfc/submitqueue/; the shared sql-queue RFC stays at doc/rfc/.
- Make targets made domain-explicit (build-submitqueue-*, integration-test-submitqueue-*, local-submitqueue-*), mirroring the existing *-stovepipe-* targets; CI updated to match.
- Tests: domain-qualified docker-compose project names; integration/e2e run in parallel (--test_output=errors) and always execute a real pass (tags=["external"]) since they are non-hermetic.
- Import paths rewritten throughout; protos regenerated; CLAUDE.md, READMEs, and doc/howto/TESTING.md updated to the new structure and naming convention.

No behavior changes — this is a structural move.

## Test Plan

- ✅ `make build` (bazel build //...) and `make test` (40/40 unit tests)
- ✅ `make integration-test` — 8/8 pass; verified running in parallel (67s vs 275s serial) and always-run (uncached re-runs)
- ✅ `make e2e-test` — passes; always-run
- ✅ `make lint` (incl. license headers); gazelle / mocks / tidy / fmt all stable (CI gates clean)
@behinddwalls behinddwalls merged commit ef78d5b into main Jun 3, 2026
14 checks passed
@behinddwalls behinddwalls deleted the refactor-structure branch June 3, 2026 14:16
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