Split native targeting rule support for semantic versioning comparisons
This relates to setting up split targeting rules around app versions (necessary for mobile iOS/Android apps).
Right now, split targeting rules only allow greater/less than operations on integers. We are able to get around this by converting the app semantic version (in format MAJOR.MINOR.PATCH
- https://semver.org) to an integer. We do this like so:
MAJOR*1,000,000 + MINOR*1,000 + PATCH*1 = APP_VERSION
e.g. an app version of 2.12.45
becomes 2*1,000,000 + 12*1,000 + 45*1 = 2012045
It would be great if there was some native support in the split.io targeting rules interface to treat client app versions in a more natural way.
-
Official comment
Hi Dean,
From our end, we'd recommend you do version matching by using regex/matching matchers. We wrote a blog post about this topic a while ago:
https://www.split.io/blog/improving-version-targeting-splits-regex-matchers-feature-flags/
Let us know this doesn't solve your needs!
Regards,
Kevin
Comment actions -
Hey Kevin, appreciate the reply!
The way you mentioned is likely not a realistic option for us for two reasons:
- Non-engineers would definitely not be able to set these up
- High risk of human error
- Human readability is low, difficult to visually parse what version information is being checked
If there was a product solution it would simplify the user facing configuration and remove the risk of human error.
Thanks!
Tim
-
I'd like to bump this up as well. We are implementing Split and having support for semantic version comparison would improve our feature flagging process significantly. Using regex is a work around that we can use but, as mentioned above, has poor readability and is prone to error.
-
We're planning on separating major/minor/patch as separate attributes in order to maintain readability and so we do not need to rely on math that must be synced between the dashboard and the client. That said, it would be great if we had numeric targeting rules for `<` and `>` operators in addition to `>=` and `<=` to check against.
For example, here are our rules, but I'd rather serve "off" if the version attributes are lower than given, and serve "on" by default.
Please sign in to leave a comment.
Comments
5 comments