Repository navigation
Tracking: standardize expression types across schema, Ruby, and UIs #11
Copy link
Copy link
Open
Description
Tracking issue for enforcing expression types from a single source of truth (this schema repo), spanning three repos. Lives here because expressions is the root dependency and lowest-traffic repo.
Goal
- Q1: enforce
flipper_propertiesvalue types (scalars only). - Q2: enforce operator argument types via the JSON Schema, shared by Ruby + JS.
- Standardize on
flippercloud/expressionsas the source of truth; Ruby vendors the schemas, the Vue UIs import the JS package.
Merge / publish order (hard dependency chain)
① expressions (merge + npm publish) → ② flipper → ③ Vue UIs. Nothing downstream can land until the package is published.
① expressions (this repo)
- Commit the schema work — added
FeatureEnabled.schema.json,categorymetadata. (Note: thepropertydefinition was dropped during review since it described context values, not expressions.) - Push, open PR, review, merge — Add FeatureEnabled expression, schema metadata, and publish under @flippercloud scope #10 (MERGED).
- Package renamed
@flippercloud.io/expressions→@flippercloud/expressions, version bumped to1.1.0onmain. - Publish npm
@flippercloud/expressions@1.1.0← still pending; this unblocks everything below (npm currently 404s for the new name).
② flipper — PR flippercloud/flipper#1000 (green, ready)
- Vendored schemas into
lib/flipper/expression/schemas(no npm);Flipper::Expression::Schema+#validate/#valid?backed by an optional, lazily-requiredjson_schemer(core stays lightweight; validation runs at the boundaries, not on the evaluate hot path or inenable). - Q1 property enforcement in
Gates::Expression(warn + drop non-scalar values; uses a RubyALLOWED_PROPERTY_TYPESconstant, so unaffected by the droppedpropertydefinition). - Operator parity: added
Add/Subtract/Multiply/Divide/Min/Max, restoredDuration(enables relative-time windows, e.g.Now < Time(signup_at) + Duration(7, "days")). - Shared example test runs the vendored
examples/*.jsonso Ruby and JS test the same cases;rake expressions:vendorre-copies schemas + examples. - Re-vendored to match merged
main(droppedpropertydef). Vendored schemas now identical to the source of truth. - After ①.publish: optional version bump + CHANGELOG; merge #1000.
③ Vue UIs — flippercloud + flipper-pro (not started; needs its own workspace)
- Add
@flippercloud/expressionsdependency (note the renamed scope). - Derive operators + constraints from the schema in
Condition.vue/templates.jsinstead of hardcoding. - Validate client-side before save.
- Add operators the UIs are missing (
FeatureEnabled,flippercloud).
Decisions locked in
json_schemeroptional (its depbigdecimalis a C extension); validation at the UI/API boundaries, not coreenable.In/NotIndeferred until implemented end-to-end (referenced only in flippercloud's display-onlyExpressionDescriber; not evaluable in Ruby today).Durationkept; full arithmetic family kept and tested; per-operator Ruby specs kept alongside the shared suite.- Property values are scalar-only (string/number/boolean/null), enforced in Ruby via
ALLOWED_PROPERTY_TYPES; arrays gated behind a futureIn/NotIn.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
jnunemaker commentedon Jun 8, 2026
✅ ①.publish done —
@flippercloud/expressions@1.1.0is live on npm (59 files, all 26 schemas incl. FeatureEnabled, examples, dist).② flipper PR #1000 is green (46/46) and ready to merge — no version bump / CHANGELOG needed (version bumps at release time; changelog via GitHub Releases). Gate is cleared.
Next: merge #1000, then start ③ (Vue UIs) — note the renamed scope
@flippercloud/expressions.