Skip to content

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

@danbim

Description

@danbim

Feature request

Is your feature request related to a problem?

Yes and no. It is a UX problem.

As a non-technical user of PostHog (or simply as someone who is not fluent in writing correct regular expressions), it is hard to specify release conditions (and filter for events) for users which have a certain app version (or above or below).

Describe the solution you'd like

Release conditions and event filters support matching semantic versions (<, >, =, >=, <=, !=) for app version.

Describe alternatives you've considered

  • Defining the release condition using regular expressions is sub-optimal. Regular expressions are hard to learn, really hard to get right and also up-to-date LLMs fail to generate regular expression that actually do what they should.
  • Matching on string equality requires to list all versions individually. If new versions are released, it is very very likely that someone forgets to add the new version.
  • posthog-semver-flattener plugin brings in an idea that could be applied to work-around PostHogs lack of semver support. However, it does only work for events and not for person properties. Also, it is a workaround that requires initial research + plus additional setup to be used.

Additional context

Use case / scenario: let's assume a development team that is working on a Mobile app. It builds a new complex feature for which it uses a "release toggle" flag (could be applied to multivariate flags equally). The team continuously merges to main and continuously release new app versions using semantic versioning. The release toggle is off in production during the duration of development, spanning multiple release. This way users don't see a partially incomplete feature until feature development is complete. Once complete, the team decides to take the feature live. In order to roll out the feature to only users that have the newest version, they define a "release condition" to match only versions newer than a certain semver version (say "1.19.0").

This example is written in a generic way but corresponds to our real use case.

I have previously asked for alternative ways to cover my use case in https://posthog.com/questions/release-condition-to-de-activate-for-version-greater-smaller-than-a-b-c but have not received any responses on this yet.

Debug info

- [x] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions