myxce/src/configs
Rongsong Shen 7982f28557
feat(xceadmin): validate percent-based limit values are in [0.0, 1.0] (bug-1833)
Adds an if/then JSON Schema (draft 2020-12) conditional constraint to
limits.schema.json's Limit definition: when percent is true, value
must be a number in [0.0, 1.0]. This is the class of authoring mistake
bug-1831/bug-1832 fixed manually (night_mem_pct: value: 50 instead of
0.5) -- now caught automatically at real `xceadmin config build` time
(the actual cluster.bin generation path deploy-ha.sh uses), not merely
by a unit test.

Empirically verified against the real jsonschema library this repo
uses: a violation surfaces with the exact same file/json_pointer/
constraint contract validate_yaml()'s existing ValidationError already
provides, so zero changes were needed to its error-reporting code.

While implementing this, the new constraint caught an identical
pre-existing defect in xceadmin's own checked-in "full" golden test
fixture (fixtures/full/configs/limits.yaml, night_mem_pct: value: 50)
-- fixed the same way, and regenerated the checked-in expected.bin
golden artifact to match the corrected input.

Added 3 tests to test_validation.py: reject an out-of-range percent
value, accept an in-range one, and confirm a non-percent value is
never range-checked regardless of magnitude.

Build gotcha discovered and documented (cerebrum.md): this repo has
two copies of every bundled schema -- src/configs/schema/ (canonical)
and src/xceadmin/src/xcecommon/schema_files/json/ (a gitignored local
mirror meson-build.sh always overwrites from the canonical copy on
every build). Only the canonical copy needed a source-controlled edit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
2026-09-20 10:50:21 +00:00
..
schema feat(xceadmin): validate percent-based limit values are in [0.0, 1.0] (bug-1833) 2026-09-20 10:50:21 +00:00
hosts.yaml remove override of maxswap 2026-09-08 11:15:11 +08:00
limits.yaml fix(config): night_mem_pct's percent value was 100x too large (bug-1832) 2026-09-20 10:00:30 +00:00
queues.yaml fix(admin-config-tool): resolve xceadmin config build warnings 2026-07-23 09:10:14 +00:00
resources.yaml fix(controller): close 6 data-safety races + apply-pump O(N^2) regression + boot TOCTOU 2026-08-16 10:20:02 +00:00
scaler.yaml docs(admin-config-tool): commit spec docs and example configs 2026-07-22 10:11:08 +00:00
users.yaml fix(admin-config-tool): resolve xceadmin config build warnings 2026-07-23 09:10:14 +00:00
xce.yaml docs(admin-config-tool): commit spec docs and example configs 2026-07-22 10:11:08 +00:00