mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-27 02:39:38 +02:00
feat(cli,server): warn on deprecated config at load; scaffold version: 1
Surface the config deprecation notices at load: the CLI prints them via `eprintln!` in `load_cli_config`; the server logs them via `tracing::warn!` in `load_server_settings` (a no-op under tests with no subscriber). `omnigraph init` now scaffolds a `version: 1` config using `storage:` instead of the legacy `uri:`. Migrate the shared test fixtures (`support::local_yaml_config` → `version: 1` + `storage:`; `remote_yaml_config` → `version: 1` + `servers:`/`server:`) to the current schema so they don't trip the new warnings; the resolved `.uri` is unchanged, so the tests behave identically. The no-`version:` notice is gated on a loaded config file, so commands with a bare URI and no `omnigraph.yaml` stay quiet (verified by the existing command-deprecation tests, which still pass). Extends the `init` test for the scaffold shape and adds a legacy-config-warns test.
This commit is contained in:
parent
72125c7b4f
commit
eb3c36d8aa
5 changed files with 46 additions and 4 deletions
|
|
@ -776,6 +776,9 @@ fn load_env_file_into_process(path: &Path) -> Result<()> {
|
|||
|
||||
fn load_cli_config(config_path: Option<&PathBuf>) -> Result<OmnigraphConfig> {
|
||||
let config = load_config(config_path)?;
|
||||
for warning in config.deprecation_warnings() {
|
||||
eprintln!("warning: {warning}");
|
||||
}
|
||||
if let Some(path) = config.resolve_auth_env_file() {
|
||||
load_env_file_into_process(&path)?;
|
||||
}
|
||||
|
|
@ -1569,12 +1572,13 @@ fn scaffold_config_if_missing(uri: &str) -> Result<()> {
|
|||
path,
|
||||
format!(
|
||||
"\
|
||||
version: 1
|
||||
project:
|
||||
name: Omnigraph Project
|
||||
|
||||
graphs:
|
||||
local:
|
||||
uri: {}
|
||||
storage: {}
|
||||
# bearer_token_env: OMNIGRAPH_BEARER_TOKEN
|
||||
|
||||
server:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue