soluto / tweek Goto Github PK
View Code? Open in Web Editor NEWTweek - an open source feature manager
Home Page: https://tweek.soluto.io
License: MIT License
Tweek - an open source feature manager
Home Page: https://tweek.soluto.io
License: MIT License
type Tag:String
type KeyMetaData{
key:string;
displayName:string;
description?:string;
type?:string;
tags:string;
}
type SearchQuery{
text:string;
tags:string;
}
type MetaPropertyType{
name:string;
type:string | MetaDataType (inline);
defaultValue?:string;
description?:string;
}
type MetaDataType{
name:string;
baseType:string;
allowedValues?:string[];
compare?:string;
validate?:string;
}
type MetaRepository{
//keys
getKeyMetaData(key:string):Promise<KeyMetaData>;
setKeyMetaData(key:string, meta:KeyMetaData):Promise;
searchKeys(SearchQuery):Promise<KeyMetaData[]>;
//props
listProperties():Promise<PropertyMetaData[]>;
setPropertyMetaData(property:string, meta:PropertyMetaData ):Promise;
deletePropertyMetaData(property:string, meta:PropertyMetaData ):Promise;
//tags
listTags():Promise<Tag[]>;
deleteTag(tag:string):Promise;
//datatypes
listMetaDataTypes():Promise<MetaDataType[]>;
setMetaDataType(dataType:string, meta:PropertyMetaData ):Promise;
deleteMetaDataType(dataType:string):Promise;
}
each tag adding, jpad or meta change, doing a pull and push, this operation causes a jpads build taking ~1-2 minutes.
as a mvp we will do 1 save for all changes (tags,meta,jpad) instead of save for each
Partitions are way to organize rules on key.
Instead of having a flat view of rules, rules are organized/grouped by a partition.
A partition can be defined by using one or more properties.
// link to example
both client and server should have mock/real meta provider
Editor Experience
include writing the reducer, add action types
Expose api for writing user data to context.
Suggest format:
POST /context/{identityType}/{identityId}/{key}
value
or
POST /context/{identityType}/{identityId}
{key1:value1, key2:value2, ...}
Need to consider security (not MVP)
suggested keys:
@tests
simple
nested
key1
key2
key3
multivarientkeys
uniform
bernoulli
weighted
matchers
context
not
equal
in
comparison
fixedcontextbasedkey
keydependency
rules
multipleconditions
multiplerules
Couchbase is a document and kv db based on memcached.
It got the following advantages:
You can check the admin panel on:
http://couchbase-07cc5a45.b5501720.svc.dockerapp.io:8091/
username: tweek
pass:...
While we continue to use our "drivers" abstraction to decouple our app from the db, it might be the best solution to meet all our needs easily.
Most benchmarks are lies, but it should have very fast read performance -
http://www.datastax.com/dev/blog/how-not-to-benchmark-cassandra-a-case-study
http://www.couchbase.com/sites/default/files/uploads/all/Benchmarking-Couchbase-Server-for-Interactive-Applications.pdf
Current:
tweek-rules:
rules/{*keypath}.jpad
meta/{*keypath}.json
tags.json
suggested:
tweek-authoring:
dist/keys/{*keypath}.jpad
meta/keys/{*keypath}.json
tags/{tagname}.json
identities/{identity}.json (identity+properties)
types/{type}.json
Support for checking if key is not in context
//Key does not exists
{
"MyProp":null
}
//Key exists
{
"MyProp":{"$not": null}
}
Allow to add rules in ui
backoffice build time takes ~10 minutes due to npm i.
let's set a container with npm cache: https://github.com/tswicegood/docker-npm-cache
should speed it quite a lot.
should have simple client side cache to allow using it in sync code
Current C# wrapper is really not need and make code more complex with ugly interop tricks.
EntryPoints are pretty much the same as C# api:
type JPadParser(settings:ParserSettings) :
Parse: (source:string)->IRule
type JPadGenerator :
AddSingleVariant: (...params)-> generator
AddMultiVariant: (...params)-> generator
Build() -> RuleDefinition //(format*string)
Currently changes are not persisted to rules store.
maybe should have simple client side cache to allow using it in sync code
Currently, it's reading it directly from our code.
Both in services and integration tests.
Tweek value distributor currently create different distribution for different users based on the CreationDate of the user vs the experiment start-time.
In that way, by adding a new distribution, old users will get the old distribution values (retaining persistence) while new ones will get the new distribution values.
It was assumed that simply updating the rule instead of adding a new distribution is the same as reshuffle, but it's actually not the same because of the algo. (unless we replace the ruleid as well)
FF uses bernoulliTrial, which means a two variant distribution of [true|false] based on percentage.
It seems that in this case, since rule id, identity id, total bucket size (100) does not change, the users that got true will get the same values on increasing the "true" distribution.
In the case, FF rollout will work properly - meaning old users won't get "reshuffled".
We need to write a simple unit test to prove it, it might be that we already implement FF rollout by accident :)
Backoffice fail to save rules
Write a specification for JPad format.
Write a schema for validation.
Should be deprecated once we implement proper diff view.
Allow getting values from "context", can be useful for migration of calculated values.
Suggested flow:
Some notes
Tweek management service does not exist yet.
I think it will include in the future (Not all MVP):
Error on the "target" value breaks the service which make sense, since we can easily prevent it.
Error on the value from the context fail the request.
It might be better to fail only the specific rule and log error, and return the other rules data to the agents.
using travis-ci and docker
Current folder structure is a bit of mess.
the server logs for tweek backoffice are currently in the docker service logs.
the docker logs are not user-friendly, slow, doesnt show past logs
Currently, we use these frameworks for tests:
xunit
nunit 2.x
nunit 3.x
We also use FsCheck and FsUnit libraries for F# tests.
Both of them works properly with nunit 2.x and xunit, but not with nunit 3.x.
Since nunit 2.x will be obsolete and there are many breaking changes between 3.x and 2.x, it might makes sense to drop nunit in favor of xunit.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.