{{ message }}
Gate /internal/config_toml on runtime DB mode + add zero-config E2E#7362
Open
AntoineToussaint wants to merge 2 commits intodb-config-bootfrom
Open
Gate /internal/config_toml on runtime DB mode + add zero-config E2E#7362AntoineToussaint wants to merge 2 commits intodb-config-bootfrom
AntoineToussaint wants to merge 2 commits intodb-config-bootfrom
Conversation
The three `/internal/config_toml*` endpoints were gated on `ENABLE_CONFIG_IN_DATABASE` at route registration. That made them unreachable when the feature flag was off, even if the gateway had already booted in DB-authoritative mode (which now also happens implicitly when `TENSORZERO_POSTGRES_URL` is set and no config file is provided). Move the gate from the router into the handlers, keyed on `app_state.config_in_database`. The endpoints are now available whenever the gateway is actually using the DB as its config source, including the zero-config boot path. File-backed gateways still get a `NotImplemented` error with a clear explanation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
First E2E coverage for the "gateway boots with empty DB" path: - `zero_config_health_returns_ok` — `/health` returns 200 with both `gateway: ok` and `clickhouse: ok` and the expected version header. - `zero_config_get_config_toml_returns_defaults` — `GET /internal/config_toml` returns a valid default document: non-empty TOML with only the default singletons, no user-defined function/model/tool/metric blocks, empty `path_contents`, and a non-empty CAS signature and hash. These assertions establish the baseline that downstream REST-bootstrap tests will build on. Includes: - new `zero_config` test module, excluded from the main `e2e` profile - `[profile.zero-config]` nextest profile - `docker-compose.zero-config.yml` that overrides `docker-compose.e2e.yml` to clear the `--config-file` arg and drop the fixtures loader, so the gateway boots against a migrated-but-empty Postgres database Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
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.

Stacked on top of #7361.
Summary
/internal/config_toml*on runtime DB mode, not feature flag. These three endpoints were gated onENABLE_CONFIG_IN_DATABASEat route registration, making them unreachable even when the gateway had booted in DB-authoritative mode via the new zero-config boot path. The gate now lives in the handlers, keyed onapp_state.config_in_database./healthreturns 200 withgateway: okandclickhouse: okGET /internal/config_tomlreturns a valid default document (empty collections, non-empty CAS signature) so callers can chain into/applyzero-confignextest profile +docker-compose.zero-config.ymlthat overridesdocker-compose.e2e.ymlto clear--config-fileand drop the fixtures loader.Test plan
cargo nextest run --profile zero-config -E 'binary(e2e) and test(zero_config::)'against the new docker-compose stackNotImplementedfrom/internal/config_toml*with a clear message🤖 Generated with Claude Code