feat(flags): support semver targeting in feature flags UI#44747
feat(flags): support semver targeting in feature flags UI#44747
Conversation
…' into feat/support-semver-comparisons-in-user-blast-radius
Migration SQL ChangesHey 👋, we've detected some migrations on this PR. Here's the SQL output for each migration, make sure they make sense:
|
❌ Hobby deploy smoke test: FAILEDFailing fast because: Timed out after 45 minutes Connection errors: 174 Run 20900072219 | Consecutive failures: 1 |
…f github.com:PostHog/posthog into feat/support-semver-comparisons-in-user-blast-radius
…nto feat/support-semver-targeting-in-feature-flags
…at/support-semver-targeting-in-feature-flags-ui
…at/support-semver-targeting-in-feature-flags-ui
…at/support-semver-targeting-in-feature-flags-ui
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="frontend/src/lib/utils.tsx">
<violation number="1" location="frontend/src/lib/utils.tsx:425">
P1: Missing `PropertyOperator.SemverEq` in the semver operator check. The `semverOperatorMap` includes `semver_eq`, and `PropertyOperator.SemverEq` exists in the types, but this function doesn't check for it.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Greptile SummaryThis PR adds UI support for semantic versioning operators in feature flag targeting, enabling users to create version-based rollout rules (e.g., target users with Changes OverviewType System (
Operator Maps (
Property Value Component (
Critical Issues Found1. Missing
|
Visual regression: Storybook UI snapshots updatedChanges: 1 snapshots (1 modified, 0 added, 0 deleted) What this means:
Next steps:
|
…ithub.com:PostHog/posthog into feat/support-semver-targeting-in-feature-flags-ui
Problem
With #44598 and #44596, we'll have backend support for supporting creating flags that will target semver-like string properties (such as e.g.
$app_version); this change implements UI support for creating these rules. Together, these 3 PRs will close #24485Users need to be able to:
string comparisons
Changes
Frontend UI Updates
Added semver operators to string property filters:
stringOperatorMapso they appear alongside regular string operators(semver)prefix for easy identification:> (semver) greater than≥ (semver) greater than or equal< (semver) less than≤ (semver) less than or equal~ (semver) tilde range^ (semver) caret range* (semver) wildcardType system updates (
frontend/src/types.ts):SemvertoPropertyTypeenumSemverGt,SemverGte,etc.) from backend work
Utility functions (
frontend/src/lib/utils.tsx):isOperatorSemver()helper function fordetecting semver operators
SemvertooperatorMappingChoicetype mappingsemverOperatorMapwith human-readable labelsFuture work (
frontend/src/lib/components/PropertyFilters/co mponents/PropertyValue.tsx:82-84):How did you test this code?
Manual Testing
$app_version)with clear
(semver)labels> (semver) greater thanoperator1.2.0semver operator in the UI
selectable
Expected User Experience
When creating a feature flag targeting rule:
app_version,$lib_version)(semver)postfixPublish to changelog?
Feature flag targeting now supports semantic versioning
operators (>, ≥, <, ≤, ~, ^, *) for version-based rollouts.