Schema: each expression field says which values and variables it accepts
ci / fork-checks (pull_request) Successful in 52s
ci / build (pull_request) Successful in 5m24s

The registry knows, for every expression field, the constants it may
evaluate to and the variables its conditions may read, and enforces both.
The schema served to INBUXA Admin described every one as a bare
x:Expression, so the console could offer nothing better than free text.

tools/fork/expr-schema.py reads those contexts from the generated registry
code and writes them onto each field's type as
expression: {constants, variables}. All 124 expression fields are covered.
CI runs it with --check so the schema can't drift from the registry.
This commit is contained in:
2026-09-28 12:32:28 -07:00
parent 5a73a1183a
commit e61a475859
5 changed files with 164 additions and 1 deletions
+15
View File
@@ -112,3 +112,18 @@ a fresh copy for each one. See `docs/spec/compat-tests.md`.
tools/fork/run-compat.sh --store /srv/inbuxa-copy/rocks.db \
--admin '[email protected]:PASSWORD' --recordings ~/compat
```
## expr-schema.py
Writes each expression field's allowed constants and variables, read from the
generated registry code, into the schema the server serves INBUXA Admin
(`resources/schema/schema.json.gz` and its checksum). The admin uses them to
offer plain choices instead of a free-text box.
```bash
tools/fork/expr-schema.py # update the schema
tools/fork/expr-schema.py --check # exit 1 if it's out of date (CI)
```
Re-run it after anything that regenerates the registry, an upstream import
included.