-
-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema for Expressions #718
base: main
Are you sure you want to change the base?
Conversation
e88da6d
to
c8a5852
Compare
c8a5852
to
4c35f3e
Compare
dce960e
to
8f69da4
Compare
8152bec
to
3f6d241
Compare
- Adds `class Function extends Expression` - `class Constant extends Expresson`
* commit 'd06da06ecee15d66043dbf563996f7ba4f92bb09': (55 commits) Remove kwarg for Strict handler, use arg or block Define default Adapter#name Update Changelog.md Explose handler Example for strict adapter Spec for proc handler Add get_multi, remove name param Add Strict adapter to ensure feature exists on get Allow head requests to api Use base_class to determine flipper_id for ActiveRecord actors Bump actions/checkout from 3 to 4 Ignore asdf version manager file Prepare for 1.0.0 release Ignore asdf version manager file Update links from jnunemaker => flippercloud Update links from jnunemaker => flippercloud Bump supercharge/mongodb-github-action from 1.9.0 to 1.10.0 Removed `bool`, `actors`, `time`, `actor`, `percentage_of_actors`, and `percentage_of_time` methods on `Flipper` and `Flipper::DSL` Bump version for prerelease Update changelog ...
* origin/main: Make examples and ci metrix exclusions in line with each other Don't run 3.2 on rails 5 examples Remove telemetry junk that shouldn't have been committed Add rails 7.1 and ruby 3.2 to examples and 7.1 to ci
'lib/flipper/expression/schema.rb', | ||
'lib/flipper/version.rb', | ||
] + Dir['node_modules/@flippercloud.io/expressions/schemas/*.json'] | ||
gem.name = 'flipper-expressions-schema' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be flipper-expression-schemas
? The ruby class is Flipper::Expression::Schema
to avoid conflicts with functions declared in Flipper::Expressions::*
, but maybe those should be renamed to Flipper::Function::*
. The JS package is @flippercloud.io/expressions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you just wondering if it should be plural? I think matching to ruby is fine even if singular.
8180585
to
6350f0e
Compare
* origin/main: Add changelog note for human readable names Use human action name if present Make sure actor_names_source can be updated Add actor_names_source to configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this at a high level. I'm not sure what it will feel like moving forward but the best way is to merge and find out.
This introduces a schema based on JSON Schema (draft-07 since it is the latest draft supported by Ruby libraries) for validating expressions (#692) and the arguments to expression functions. It also moves all of the tests into JSON file format so we they can be used when we add support for other clients.
Update: The schemas live in a separate repository, which will also be published as an npm module that will be consumed by flippercloud.io. I tried moving them into this repository, but there were some challenges with using npm modules in a subdirectory.
Punting on this until later:
Validate expression before saving, e.g.Flipper.enable_expression :feature, expression