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:
Ragnor Comerford 2026-06-04 08:48:04 +02:00
parent 72125c7b4f
commit eb3c36d8aa
No known key found for this signature in database
5 changed files with 46 additions and 4 deletions

View file

@ -232,7 +232,11 @@ fn init_creates_graph_successfully_on_missing_local_directory() {
assert!(stdout.contains("initialized"));
assert!(graph.join("_schema.pg").exists());
assert!(graph.join("__manifest").exists());
assert!(temp.path().join("omnigraph.yaml").exists());
let scaffold = fs::read_to_string(temp.path().join("omnigraph.yaml")).unwrap();
assert!(
scaffold.contains("version: 1") && scaffold.contains("storage:"),
"init must scaffold a `version: 1` config using `storage:`; got:\n{scaffold}"
);
}
#[test]