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.

608 B
Raw Blame
# Test cases for clickhouse-migrations-use-run-mode rule.
# ruff: noqa: F821, E501
from posthog import settings
from posthog.run_mode import RunMode, run_mode

# ruleid: clickhouse-migrations-use-run-mode
_gate = settings.CLOUD_DEPLOYMENT not in ("US", "EU", "DEV")

# ruleid: clickhouse-migrations-use-run-mode
_region_is_us = settings.CLOUD_DEPLOYMENT == "US"

# ok: clickhouse-migrations-use-run-mode
_ok_gate = run_mode().is_deployed_cloud

# ok: clickhouse-migrations-use-run-mode
_ok_prod = run_mode().is_prod_cloud

# ok: clickhouse-migrations-use-run-mode
_ok_region = run_mode() is RunMode.CLOUD_US