Skip to content
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

feat: evaluate features in CLI #71

Merged
merged 2 commits into from
Apr 26, 2024
Merged

feat: evaluate features in CLI #71

merged 2 commits into from
Apr 26, 2024

Conversation

polok
Copy link
Contributor

@polok polok commented Apr 19, 2024

What's done

For debugging purposes, a new command has been introduced:

 FeaturevisorTestRunner evaluate \
  --environment staging \
  --feature feature_key \
  --feature variable_key \
  --context '{"user_id":"123"}'

Example output:

Evaluating feature e_bar in environment staging...
Against context: ["user_id": FeaturevisorTypes.AttributeValue.string("123")]


###############
 Is enabled?
###############

Value: true

Details:

- bucketKey: e_bar
- bucketValue: 1000
- enabled: true
- reason: rule
- ruleKey: 1


###############
 Variation
###############

Value: control

Details:

- variation: control
- bucketKey: e_bar
- bucketValue: 1000
- reason: allocated
- ruleKey: 1


###############
 Variable: color
###############

Value: string("red")

Details:

- variableType: string
- defaultValue: string("red")
- bucketKey: e_bar
- bucketValue: 1000
- reason: defaulted
- variableValue: string("red")


###############
 Variable: hero
###############

Value: object(["alignment": FeaturevisorTypes.VariableValue.string("center for B"), "subtitle": FeaturevisorTypes.VariableValue.string("Hero Subtitle for B"), "title": FeaturevisorTypes.VariableValue.string("Hero Title for B")])

Details:

- variableType: object
- defaultValue: object(["alignment": FeaturevisorTypes.VariableValue.string("center"), "subtitle": FeaturevisorTypes.VariableValue.string("Hero Subtitle"), "title": FeaturevisorTypes.VariableValue.string("Hero Title")])
- bucketKey: e_bar
- bucketValue: 1000
- reason: allocated
- ruleKey: 1
- variableValue: object(["alignment": FeaturevisorTypes.VariableValue.string("center for B"), "subtitle": FeaturevisorTypes.VariableValue.string("Hero Subtitle for B"), "title": FeaturevisorTypes.VariableValue.string("Hero Title for B")])

As a reference featurevisor/featurevisor#295

@polok polok requested a review from a team as a code owner April 19, 2024 20:55
README.md Outdated
FeaturevisorTestRunner evaluate \
--environment staging \
--feature feature_key \
--feature variable_key \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nooooo, it's a copy & paste the issue. Removed

@polok polok merged commit 69fdb0e into main Apr 26, 2024
1 check passed
@polok polok deleted the feature_cli_evaluate branch April 26, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants