-
Notifications
You must be signed in to change notification settings - Fork 5
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
[SDKS-7557/7554] getTreatment/s byFlagset withConfig/s #250
Conversation
const attributes = validateAttributes(log, maybeAttributes, methodName); | ||
const isNotDestroyed = validateIfNotDestroyed(log, readinessManager, methodName); | ||
// @todo maybeFlagSets validation method | ||
const flagSetOrFlagSets = maybeFlagSetNameOrNames; |
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.
You can reuse validateSplits
to validate flag sets, in order to avoid increasing the code size. Check validateSplits
and you will see that you can pass additional params (listName and item) to customize the logging (should log "... flag set" rather than "... feature flag name").
You can also simplify the maybeFlagSetNameOrNames
param as string[] | undefined
(e.g., for getTreatmentsByFlagSets
you can call it with [maybeFlagSet]
). This way you don't need to use the multi
variable here, and only call validateSplits
(the plural version of validateSplit
), of course with listName and item params updated to log errors and warnings properly.
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 will add input validation in another pr, but I will take this into account
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.
LGTM. Thanks Emma for the updates!
Javascript commons library
What did you accomplish?
Added getTreatments methods for flagsets
Added evaluation methods for flagsets in evaluator
make
sets
property optionalHow do we test the changes introduced in this PR?
unit tests included
Extra Notes