Skip to content

feat(stovepipe): wire gateway Ingest to the request log#270

Open
behinddwalls wants to merge 1 commit into
mainfrom
preetam/gateway_request_api
Open

feat(stovepipe): wire gateway Ingest to the request log#270
behinddwalls wants to merge 1 commit into
mainfrom
preetam/gateway_request_api

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why?

The Stovepipe gateway minted a SPID and published to the queue but persisted nothing, so a freshly ingested commit had no observable record until the orchestrator processed it. SubmitQueue's gateway records an accepted status synchronously on entry and owns the request log end to end; this brings the Stovepipe gateway to the same shape now that the entity stores exist.

What?

Wires the gateway to the gateway-owned RequestLogStore (persist + consume); identity stays the synthetic SPID and there is no new read RPC or proto change.

  • Ingest now records an accepted RequestLog synchronously (written straight to storage, before publishing to the start topic) so the status is visible the moment the RPC returns. A log-write failure aborts before anything is published.
  • Adds a gateway log-topic consumer (stovepipe/gateway/controller/log) that persists RequestLog entries — the gateway is the sole writer of the request log; the orchestrator only publishes log events for it to persist.
  • Adds the log topic key to stovepipe/core/topickey.
  • Rewires the example gateway server: opens the app DB (storage + SPID counter) and the queue, builds a registry that publishes start and consumes log, registers Ingest behind an InvalidArgument interceptor, and runs the log consumer with graceful shutdown.
  • Adds local-init-stovepipe-schemas (storage + counter to mysql-app, queue to mysql-queue) and points the gateway / full-stack local start targets at it.

The IngestController and the log consumer both depend on the narrow RequestLogStore interface rather than the full Storage facade, since that is all either needs.

Test Plan

  • bazel test //stovepipe/... — all targets pass (new gateway log consumer + updated ingest tests)
  • bazel build //stovepipe/... //example/stovepipe/...
  • make fmt, make lint-license, make gazelle — clean / idempotent

Stack

  1. @ feat(stovepipe): wire gateway Ingest to the request log #270

## Summary

### Why?

The Stovepipe gateway minted a SPID and published to the queue but persisted nothing, so a freshly ingested commit had no observable record until the orchestrator processed it. SubmitQueue's gateway records an `accepted` status synchronously on entry and owns the request log end to end; this brings the Stovepipe gateway to the same shape now that the entity stores exist.

### What?

Wires the gateway to the gateway-owned `RequestLogStore` (persist + consume); identity stays the synthetic SPID and there is no new read RPC or proto change.

- `Ingest` now records an `accepted` `RequestLog` synchronously (written straight to storage, before publishing to the start topic) so the status is visible the moment the RPC returns. A log-write failure aborts before anything is published.
- Adds a gateway `log`-topic consumer (`stovepipe/gateway/controller/log`) that persists `RequestLog` entries — the gateway is the sole writer of the request log; the orchestrator only publishes log events for it to persist.
- Adds the `log` topic key to `stovepipe/core/topickey`.
- Rewires the example gateway server: opens the app DB (storage + SPID counter) and the queue, builds a registry that publishes `start` and consumes `log`, registers `Ingest` behind an InvalidArgument interceptor, and runs the log consumer with graceful shutdown.
- Adds `local-init-stovepipe-schemas` (storage + counter to mysql-app, queue to mysql-queue) and points the gateway / full-stack local start targets at it.

The `IngestController` and the log consumer both depend on the narrow `RequestLogStore` interface rather than the full `Storage` facade, since that is all either needs.

## Test Plan

- `bazel test //stovepipe/...` — all targets pass (new gateway log consumer + updated ingest tests)
- `bazel build //stovepipe/... //example/stovepipe/...`
- `make fmt`, `make lint-license`, `make gazelle` — clean / idempotent
@behinddwalls behinddwalls force-pushed the preetam/gateway_request_api branch from d43bb75 to d472633 Compare June 24, 2026 16:31
@behinddwalls behinddwalls changed the base branch from preetam/ingest_entity_store to main June 24, 2026 16:31
@behinddwalls behinddwalls marked this pull request as ready for review June 24, 2026 16:40
@behinddwalls behinddwalls requested review from a team and sbalabanov as code owners June 24, 2026 16:40

@roychying roychying left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants