feat(queueconfig): add YAML-backed Store and wire gateway Land validation#160
Merged
Merged
Conversation
…tion Adds the first implementation of queueconfig.Store, backed by a YAML file read once at startup. Wires it into the gateway LandController so unknown queue names are rejected at the API edge with a typed UnrecognizedQueueError that carries the queue name — set up for a future gRPC interceptor to map it into pb.UnrecognizedQueueError. - extension/queueconfig/yaml: new Store with NewStore(path), validates non-empty + unique names; returns queueconfig.ErrNotFound for misses - extension/queueconfig/mock: generated mock (new //go:generate directive + queueconfig path added to the Makefile mocks target) - gateway/controller/land.go: validates queue via the store and returns *UnrecognizedQueueError wrapped with errs.NewUserError when missing - example/server/gateway: requires QUEUE_CONFIG_PATH env var; sample queues.yaml covers test-queue + e2e-test-queue and is baked into the Dockerfile + wired into both compose files The entity/queue_config.go docstring tweak is from \`make fmt\` and is included to keep the formatter idempotent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Introduces an initial queueconfig.Store implementation backed by a YAML file loaded at startup, and wires it into the gateway land flow so requests for unknown queues are rejected at the API edge.
Changes:
- Add
extension/queueconfig/yamlStore (YAML snapshot in memory) plus tests and Bazel wiring. - Validate
LandRequest.Queueagainstqueueconfig.StoreinLandController, returning a typedUnrecognizedQueueErrorwrapped as a user error on misses. - Update the example gateway server + container setup to require and provide
QUEUE_CONFIG_PATHand a samplequeues.yaml.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| MODULE.bazel | Adds Bazel module repo for gopkg.in/yaml.v3. |
| Makefile | Includes ./extension/queueconfig/... in mock generation target. |
| go.mod | Promotes gopkg.in/yaml.v3 to a direct dependency. |
| gateway/controller/land.go | Adds queue validation via queueconfig.Store and introduces UnrecognizedQueueError. |
| gateway/controller/land_test.go | Updates constructor usage and adds tests for queue validation behavior. |
| gateway/controller/BUILD.bazel | Adds queueconfig deps for controller lib/tests. |
| extension/queueconfig/yaml/yaml.go | Implements YAML-backed queueconfig store loaded once at startup. |
| extension/queueconfig/yaml/yaml_test.go | Tests YAML store parsing/validation, Get/List behavior, and copy semantics. |
| extension/queueconfig/yaml/BUILD.bazel | Bazel targets for YAML store and tests. |
| extension/queueconfig/queueconfig.go | Adds //go:generate directive for mock generation. |
| extension/queueconfig/mock/queueconfig_mock.go | Adds generated GoMock for queueconfig.Store. |
| extension/queueconfig/mock/BUILD.bazel | Bazel target for the generated mock package. |
| example/server/gateway/queues.yaml | Provides sample queue configuration YAML for the example gateway. |
| example/server/gateway/main.go | Loads queue configs from QUEUE_CONFIG_PATH and injects into LandController. |
| example/server/gateway/Dockerfile | Bakes the sample queues.yaml into the image. |
| example/server/gateway/docker-compose.yml | Sets QUEUE_CONFIG_PATH env var for the example gateway container. |
| example/server/gateway/BUILD.bazel | Adds Bazel dep on the YAML queueconfig store. |
| example/server/docker-compose.yml | Sets QUEUE_CONFIG_PATH env var for the example stack. |
| entity/queue_config.go | Minor docstring wording adjustment for BuildRunner. |
Files not reviewed (1)
- extension/queueconfig/mock/queueconfig_mock.go: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
behinddwalls
approved these changes
May 28, 2026
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
Adds the first implementation of queueconfig.Store, backed by a YAML file read once at startup. Wires it into the gateway
LandControllerso unknown queue names are rejected at the API edge with a typedUnrecognizedQueueErrorthat carries the queue name.Also updated the example/server app to use an example
queues.yamlconfig file, and verified that things work end-to-end (seeTest Plandown below).Test Plan
✅
make test✅ Ran
make local-gateway-startand verified:invalid requestIssues