feat: add strategy constraints support to set_flag_rollout#34
Open
KYHyeon wants to merge 7 commits intoUnleash:mainfrom
Open
feat: add strategy constraints support to set_flag_rollout#34KYHyeon wants to merge 7 commits intoUnleash:mainfrom
KYHyeon wants to merge 7 commits intoUnleash:mainfrom
Conversation
- Add Phase 4 section with constraints support plan for set_flag_rollout - Include input schema, operators, and example usage - Add Phase 4 to Success Metrics - Remove constraint configuration from Planned Improvements (now Phase 4)
…rface Add type definitions for strategy constraints support: - ConstraintOperator: all 15 operators (IN, NOT_IN, STR_*, NUM_*, SEMVER_*) - StrategyConstraint: interface with contextName, operator, values, etc. - Update SetFlagRolloutOptions to include optional constraints array
Pass constraints array to API payload when configuring strategy. Also includes constraints in dry-run return value.
Add support for strategy constraints in set_flag_rollout tool: - Add constraintOperatorSchema with all 15 operators - Add constraintSchema with contextName, operator, values, etc. - Add constraints to setFlagRolloutSchema - Map input constraints to StrategyConstraint type
Add comprehensive documentation for set_flag_rollout tool including: - Parameters description - Constraints explanation with all operators - Usage example with userId targeting
Update FeatureStrategy.constraints type from Record<string, unknown>[] to StrategyConstraint[] for type safety.
|
@gastonfournier Hi! We're using unleash-mcp on our team and this constraints feature would be really valuable for our use case. Would love to see this reviewed when you get a chance. Happy to help if there's anything needed to move it forward. Thanks! |
Contributor
# Conflicts: # src/tools/setFlagRollout.ts
Author
|
Hi @gastonfournier, thanks for getting back to us! I've merged latest main and resolved the conflict. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for strategy constraints in
set_flag_rollouttool, enabling targeting based on context fields likeuserId,environment, etc.Changes
ConstraintOperatortype with all 15 operators (IN, NOT_IN, STR_, NUM_, SEMVER_*)StrategyConstraintinterface for type-safe constraint definitionssetFlexibleRolloutStrategyto pass constraints to APIset_flag_rollouttool with full validationExample Usage
{ "featureName": "new-checkout-flow", "environment": "production", "rolloutPercentage": 50, "constraints": [ { "contextName": "userId", "operator": "IN", "values": ["user-123", "user-456"] } ] }