fix(yaml): accept empty flow mappings in mapping bodies - #1680
Conversation
Signed-off-by: pcristin <xxxokzxxx@protonmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Merged — thank you for a model contribution! The mapping-body-scoped exception is exactly the right shape for this editor (narrow, positional, fail-closed on the key side), and the byte-identity regression tests for the reject paths made this an easy review: verified end-to-end here against a Goose-serialized config ( |
What does this PR do?
Fixes #1673.
Goose serializes stdio extension siblings with an empty flow mapping such as
envs: {}. The YAML editor rejected every unquoted brace in mapping bodies,so
op=mcp_installcould not update configuration that Goose itself hadwritten.
This change adds a narrow mapping-body exception for an exact empty mapping
value (
{}). The key and prefix still pass through the existing fail-closedscanner, and non-empty flow mappings remain unsupported.
Regression coverage verifies that:
envs: {}is preserved byte-for-bytewhile the owned entry is appended;
envs: {FOO: bar}is still rejected without changing the file; and<<: {}is still rejected without changingthe file.
Validation:
ASAN_OPTIONS=detect_leaks=0 scripts/test.sh --suites config_yaml_edit(47 passed)
ASAN_OPTIONS=detect_leaks=0 scripts/test.sh --suites cli(278 passed)ASAN_OPTIONS=detect_leaks=0 scripts/test.sh(7,498 passed, 0 failed, 5 permitted platform skips)
clang-format --dry-run --Werror src/cli/config_yaml_edit.c tests/test_config_yaml_edit.cgit diff --check upstream/main..HEADscripts/lint.sh --cistill reports pre-existing findings in untouched files:formatting in
src/mcp/mcp.candsrc/pipeline/pipeline_incremental.c, plus acppcheck style note in
src/store/store.c.Checklist
git commit -s) — required, CI rejectsunsigned commits (DCO, see CONTRIBUTING.md)
make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)