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: Support semantic versioning in Constraint #391

Closed
zakazai opened this issue Aug 25, 2020 · 2 comments
Closed

Feat: Support semantic versioning in Constraint #391

zakazai opened this issue Aug 25, 2020 · 2 comments

Comments

@zakazai
Copy link
Contributor

zakazai commented Aug 25, 2020

I have a use case where I want to limit a segment using semantic versioning (e.g only enable feature when version >= 5.1.0, etc)

Expected Behavior

I can specify constraint using semantic versioning on flagr UI

Current Behavior

I don't think this is available yet. I've tried this at https://play.golang.org/p/9NYt1V1B_RB

Update : I think we can define it by creating multiple segments for each version that available for now

Possible Solution

We can use https://github.com/blang/semver/ and maybe introduce a new operator perhaps at https://github.com/zhouzhuojie/conditions.

Context

I'm currently evaluating flagr and I have a use case to limit certain feature based on the app version.

@zhouzhuojie
Copy link
Collaborator

Thanks for reporting the feature request. I think semver maybe a little bit specific to be added for a generic condition's operator. I was thinking of supporting general functions in the constraints, that may work to cover the semver use case.

Before that, how about your application can parse the semver and pass the components as entity context? For example:

{
  "entityContext": {
    "major": 1,
    "minor": 0,
    "patch": 3
  }
}

And you can specify the conditions like major <= 1 or major <= 1 and minor >= 0.

@zakazai
Copy link
Contributor Author

zakazai commented Aug 26, 2020

Thanks for the prompt reply.

That's a good idea, I haven't thought about that. I think that'll be enough for my use case

@zakazai zakazai closed this as completed Aug 26, 2020
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

No branches or pull requests

2 participants