Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(actions): resolve semver operators in action tooltip instead of "equals" (#66246)

Vasco de Krijger3be86683d706
diff --git a/frontend/src/lib/components/DefinitionPopover/utils.test.ts b/frontend/src/lib/components/DefinitionPopover/utils.test.ts
index d0a273b944f5..877132dd4d62 100644
--- a/frontend/src/lib/components/DefinitionPopover/utils.test.ts
+++ b/frontend/src/lib/components/DefinitionPopover/utils.test.ts
@@ -10,19 +10,23 @@ describe('DefinitionPopover operator helpers', () => {
[PropertyOperator.LessThanOrEqual, 'less than or equal'],
[PropertyOperator.GreaterThan, 'greater than'],
[PropertyOperator.IContains, 'contains'],
+ // Semver operators live outside the generic map and must still resolve, not fall back to "equals"
+ [PropertyOperator.SemverGte, 'greater than or equal (semver)'],
])('maps a typed property with operator %s to "%s"', (operator, expected) => {
const property = { type: PropertyFilterType.Event, key: 'amount', value: 5, operator } as AnyPropertyFilter
expect(genericOperatorToHumanName(property)).toBe(expected)
})
- it('reads the operator from a legacy action step property that has no type', () => {
+ it.each([
+ [PropertyOperator.GreaterThanOrEqual, 'greater than or equal'],
+ // Semver filters on e.g. $os_version (no `type` on the legacy step) — the reported bug
+ [PropertyOperator.SemverGte, 'greater than or equal (semver)'],
+ [PropertyOperator.SemverLte, 'less than or equal (semver)'],
+ [PropertyOperator.SemverEq, 'equals (semver)'],
+ ])('reads operator %s from a legacy action step property that has no type', (operator, expected) => {
// Legacy action step properties are stored without a `type` field
- const property = {
- key: 'amount',
- value: 5,
- operator: PropertyOperator.GreaterThanOrEqual,
- } as AnyPropertyFilter
- expect(genericOperatorToHumanName(property)).toBe('greater than or equal')
+ const property = { key: '$os_version', value: '14.4.1', operator } as AnyPropertyFilter
+ expect(genericOperatorToHumanName(property)).toBe(expected)
})
it.each([null, undefined, {} as AnyPropertyFilter])('falls back to "equals" for %s', (property) => {
diff --git a/frontend/src/lib/components/DefinitionPopover/utils.ts b/frontend/src/lib/components/DefinitionPopover/utils.ts
index 0929f068b728..bef0eab6b23b 100644
--- a/frontend/src/lib/components/DefinitionPopover/utils.ts
+++ b/frontend/src/lib/components/DefinitionPopover/utils.ts
@@ -15,12 +15,14 @@ export function operatorToHumanName(operator?: string): string {
export function genericOperatorToHumanName(property?: AnyPropertyFilter | null): string {
// Legacy action step properties have no `type`, so isPropertyFilterWithOperator would reject them
- // and collapse every operator to "equals" — read the operator directly instead.
+ // and collapse every operator to "equals" — read the operator directly instead. Prefer the curated
+ // generic labels, but fall back to the full operator map (covers semver etc.) rather than a
+ // hardcoded "equals" for anything outside the generic subset.
const operator = property && 'operator' in property ? property.operator : undefined
if (operator && genericOperatorMap[operator]) {
return genericOperatorMap[operator].slice(2)
}
- return 'equals'
+ return allOperatorsToHumanName(operator)
}
// Most operator labels carry a 2-char "<symbol> " prefix that slice(2) strips (e.g. "= equals"