Skip to content

feat(flags): SemVer targeting#44489

Closed
dmarticus wants to merge 14 commits intomasterfrom
feat/semver-targeting-ui
Closed

feat(flags): SemVer targeting#44489
dmarticus wants to merge 14 commits intomasterfrom
feat/semver-targeting-ui

Conversation

@dmarticus
Copy link
Contributor

@dmarticus dmarticus commented Jan 8, 2026

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:

  • Basic comparisons: >, >=, <, <=, =, (semver-aware)
  • Range operators: ~ (patch-level), ^ (minor-level), * (wildcard)

Frontend:

  • Added PropertyOperator enum values for all semver operators
  • Refactored operator display system to use structured { symbol, label } objects instead of string manipulation
  • Semver operators display as >= (semver) in both dropdowns and readonly views

Python backend:

  • Added ClickHouse property filtering for semver operators using array-based version comparison
  • Uses HogQL's sortableSemver function for clean, maintainable SQL generation
  • Handles basic comparisons and range matching (~1.2.3 = >=1.2.3 <1.3.0, etc.)

Rust feature-flags service:

  • Added semver operator support using the semver crate
  • Full support for comparisons, ranges, pre-release versions, and v prefix stripping

TODO INCLUDE VIDEO

How did you test this code?

  • Python: Added TestSemverPropertyFiltering test 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 handling
  • API: Added test_user_blast_radius_semver_operators to verify blast radius calculations work correctly (catches numeric vs
    string comparison bugs)
  • Rust: Extensive unit tests for all semver operators including edge cases (pre-release, build metadata, v-prefix, invalid
    versions)
  • Manual testing of feature flag UI for operator selection and display

Publish to changelog?

Yes - "Added semantic version (semver) targeting for feature flags. Target users by app version with comparisons like >= 2.0.0
or npm-style ranges like ^1.2.0 (minor updates) and ~1.2.3 (patch updates)."

@dmarticus
Copy link
Contributor Author

closing in favor of #44747, #44598, and #44596

@dmarticus dmarticus closed this Jan 11, 2026
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.

Support for semantic (app) versions in event filters and feature flag release conditions

1 participant