Closed
Conversation
… into feat/semver-targeting-ui
Contributor
Author
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.
Problem
Users need to target feature flags based on semantic versioning comparisons (e.g., "show this feature to users on app version >=
2.0.0"). We didn't have semver operators - only basic string/numeric comparisons which don't handle version strings correctly
(e.g., "1.10.0" > "1.9.0" fails with string comparison).
Closes #24485
Changes
Added 9 new semver operators:
>,>=,<,<=,=,≠(semver-aware)~(patch-level),^(minor-level),*(wildcard)Frontend:
PropertyOperatorenum values for all semver operators{ symbol, label }objects instead of string manipulation>= (semver)in both dropdowns and readonly viewsPython backend:
sortableSemverfunction for clean, maintainable SQL generation~1.2.3=>=1.2.3 <1.3.0, etc.)Rust feature-flags service:
semvercratevprefix strippingTODO INCLUDE VIDEO
How did you test this code?
TestSemverPropertyFilteringtest class with tests for all semver operators (test_semver_gt,test_semver_gte,test_semver_lt,test_semver_lte,test_semver_eq,test_semver_neq,test_semver_tilde,test_semver_caret,test_semver_wildcard_patch,test_semver_wildcard_minor) plus a test for double-digit version handlingtest_user_blast_radius_semver_operatorsto verify blast radius calculations work correctly (catches numeric vsstring comparison bugs)
versions)
Publish to changelog?
Yes - "Added semantic version (semver) targeting for feature flags. Target users by app version with comparisons like
>= 2.0.0or npm-style ranges like
^1.2.0(minor updates) and~1.2.3(patch updates)."