From dfae4dfc445b21fdd4d2051700ccdf16f6de925a Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 12 Dec 2024 15:43:55 +0100 Subject: [PATCH 01/17] Updated remote config to include domain restrictions param --- posthog/models/remote_config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/posthog/models/remote_config.py b/posthog/models/remote_config.py index 637ce7ff4566a..847cb02c02bce 100644 --- a/posthog/models/remote_config.py +++ b/posthog/models/remote_config.py @@ -166,6 +166,8 @@ def build_config(self): "urlBlocklist": team.session_recording_url_blocklist_config, "eventTriggers": team.session_recording_event_trigger_config, "scriptConfig": rrweb_script_config, + # Indicates there are domain restrictions - so the SDK can make one follow up call to check + "domainRestrictions": len(team.recording_domains or []) > 0, } if isinstance(team.session_replay_config, dict): From 376e36c07cea83d794aa182d23f6cb7f093b659e Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 12 Dec 2024 15:45:52 +0100 Subject: [PATCH 02/17] Fixes --- posthog/models/test/test_remote_config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/posthog/models/test/test_remote_config.py b/posthog/models/test/test_remote_config.py index 406575184d2e5..46c1efdb5f691 100644 --- a/posthog/models/test/test_remote_config.py +++ b/posthog/models/test/test_remote_config.py @@ -112,6 +112,12 @@ def test_session_recording_sample_rate(self): self.remote_config.refresh_from_db() assert self.remote_config.config["sessionRecording"]["sampleRate"] == "0.50" + def test_session_recording_domains(self): + self.team.recording_domains = ["posthog.com", "posthog.com/docs"] + self.team.save() + self.remote_config.refresh_from_db() + assert self.remote_config.config["sessionRecording"]["domainRestrictions"] + class TestRemoteConfigSurveys(_RemoteConfigBase): # Largely copied from TestSurveysAPIList From d815ea11e043ae68c32bacd56b2ea3174bbcebc2 Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 12 Dec 2024 15:46:28 +0100 Subject: [PATCH 03/17] Fix --- posthog/models/test/test_remote_config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/posthog/models/test/test_remote_config.py b/posthog/models/test/test_remote_config.py index 46c1efdb5f691..ed4f299982a8c 100644 --- a/posthog/models/test/test_remote_config.py +++ b/posthog/models/test/test_remote_config.py @@ -113,6 +113,7 @@ def test_session_recording_sample_rate(self): assert self.remote_config.config["sessionRecording"]["sampleRate"] == "0.50" def test_session_recording_domains(self): + self.team.session_recording_opt_in = True self.team.recording_domains = ["posthog.com", "posthog.com/docs"] self.team.save() self.remote_config.refresh_from_db() From d129e6326c257c3c4c06217b6f7392eeaddfa105 Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 12 Dec 2024 17:53:07 +0100 Subject: [PATCH 04/17] Reduce amount of cached content and allow dynamic loading --- posthog/api/remote_config.py | 20 ++- posthog/models/remote_config.py | 89 ++++++++---- posthog/models/test/test_remote_config.py | 167 +++++++++++++++++++--- 3 files changed, 219 insertions(+), 57 deletions(-) diff --git a/posthog/api/remote_config.py b/posthog/api/remote_config.py index f1a896c2f527b..803a0871bbcad 100644 --- a/posthog/api/remote_config.py +++ b/posthog/api/remote_config.py @@ -19,11 +19,21 @@ def check_token(self, token: str): raise ValidationError("Invalid token") return token + def get_domain_param(self): + domain = self.request.GET.get("domain") + if not domain: + return None + + # Simple check that the domain is simple like a.b.com + if not re.match(r"^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$", domain): + raise ValidationError("Invalid domain") + return domain + class RemoteConfigAPIView(BaseRemoteConfigAPIView): def get(self, request, token: str, *args, **kwargs): try: - resource = RemoteConfig.get_config_via_token(self.check_token(token)) + resource = RemoteConfig.get_config_via_token(self.check_token(token), domain=self.get_domain_param()) except RemoteConfig.DoesNotExist: raise Http404() @@ -33,7 +43,9 @@ def get(self, request, token: str, *args, **kwargs): class RemoteConfigJSAPIView(BaseRemoteConfigAPIView): def get(self, request, token: str, *args, **kwargs): try: - script_content = RemoteConfig.get_config_js_via_token(self.check_token(token)) + script_content = RemoteConfig.get_config_js_via_token( + self.check_token(token), domain=self.get_domain_param() + ) except RemoteConfig.DoesNotExist: raise Http404() @@ -43,7 +55,9 @@ def get(self, request, token: str, *args, **kwargs): class RemoteConfigArrayJSAPIView(BaseRemoteConfigAPIView): def get(self, request, token: str, *args, **kwargs): try: - script_content = RemoteConfig.get_array_js_via_token(self.check_token(token)) + script_content = RemoteConfig.get_array_js_via_token( + self.check_token(token), domain=self.get_domain_param() + ) except RemoteConfig.DoesNotExist: raise Http404() diff --git a/posthog/models/remote_config.py b/posthog/models/remote_config.py index 847cb02c02bce..cef2f98a105ef 100644 --- a/posthog/models/remote_config.py +++ b/posthog/models/remote_config.py @@ -1,3 +1,4 @@ +from base64 import b64encode import json import os from typing import Any, Optional @@ -65,6 +66,25 @@ def cache_key_for_team_token(team_token: str, suffix: str) -> str: return f"remote_config/{team_token}/{suffix}" +def sanitize_config_for_public_cdn(config: dict, domain: Optional[str] = None) -> dict: + from posthog.api.utils import hostname_in_allowed_url_list + + # Remove domains from session recording + if config.get("sessionRecording"): + if "domains" in config["sessionRecording"]: + domains = config["sessionRecording"].pop("domains") + + if domain: + is_recording_allowed = hostname_in_allowed_url_list(domains, domain) + + if not is_recording_allowed: + config["sessionRecording"] = False + + # Remove site apps JS + config.pop("siteAppsJS", None) + return config + + class RemoteConfig(UUIDModel): """ RemoteConfig is a helper model. There is one per team and stores a highly cacheable JSON object @@ -166,8 +186,8 @@ def build_config(self): "urlBlocklist": team.session_recording_url_blocklist_config, "eventTriggers": team.session_recording_event_trigger_config, "scriptConfig": rrweb_script_config, - # Indicates there are domain restrictions - so the SDK can make one follow up call to check - "domainRestrictions": len(team.recording_domains or []) > 0, + # NOTE: This is cached but stripped out at the api level depending on the caller + "domains": team.recording_domains or [], } if isinstance(team.session_replay_config, dict): @@ -218,9 +238,12 @@ def build_config(self): config["siteApps"] = site_apps + # Array of JS objects to be included when building the final JS + config["siteAppsJS"] = self._build_site_apps_js() + return config - def build_js_config(self): + def _build_site_apps_js(self): # NOTE: This is the web focused config for the frontend that includes site apps from posthog.plugins.site import get_site_apps_for_team, get_site_config_from_schema @@ -236,13 +259,14 @@ def build_js_config(self): f"\n{{\n id: '{site_app.token}',\n init: function(config) {{\n {indent_js(site_app.source, indent=4)}().inject({{ config:{json.dumps(config)}, posthog:config.posthog }});\n config.callback();\n }}\n}}" ) ) - site_functions = HogFunction.objects.filter( team=self.team, enabled=True, type__in=("site_destination", "site_app") ).all() site_functions_js = [] + print("found", site_functions) + for site_function in site_functions: try: source = get_transpiled_function(site_function) @@ -258,16 +282,12 @@ def build_js_config(self): logger.exception(f"Failed to build JS for site function {site_function.id}") pass - js_content = f"""(function() {{ - window._POSTHOG_CONFIG = {json.dumps(self.config)}; - window._POSTHOG_JS_APPS = [{','.join(site_apps_js + site_functions_js)}]; -}})(); - """.strip() - - return js_content + return site_apps_js + site_functions_js @classmethod - def _get_via_cache(cls, token: str, suffix: str, fn: Callable[["RemoteConfig"], dict | str]) -> Any: + def _get_via_cache( + cls, token: str, suffix: str, fn: Callable[["RemoteConfig"], dict | str], timeout: int = CACHE_TIMEOUT + ) -> Any: key = cache_key_for_team_token(token, suffix) data = cache.get(key) @@ -282,35 +302,47 @@ def _get_via_cache(cls, token: str, suffix: str, fn: Callable[["RemoteConfig"], REMOTE_CONFIG_CACHE_COUNTER.labels(result="miss").inc() try: remote_config = cls.objects.select_related("team").get(team__api_token=token) + print("remote_config got fresh", remote_config) except cls.DoesNotExist: - cache.set(key, "404", timeout=CACHE_TIMEOUT) + cache.set(key, "404", timeout=timeout) REMOTE_CONFIG_CACHE_COUNTER.labels(result="miss_but_missing").inc() raise data = fn(remote_config) - cache.set(key, data, timeout=CACHE_TIMEOUT) + cache.set(key, data, timeout=timeout) return data @classmethod - def get_config_via_token(cls, token: str) -> dict: - return cls._get_via_cache(token, "config", lambda remote_config: remote_config.build_config()) + def get_config_via_token(cls, token: str, domain: Optional[str] = None) -> dict: + config = cls._get_via_cache(token, "config", lambda remote_config: remote_config.build_config()) + config = sanitize_config_for_public_cdn(config, domain) - @classmethod - def get_config_js_via_token(cls, token: str) -> str: - return cls._get_via_cache(token, "config.js", lambda remote_config: remote_config.build_js_config()) + return config @classmethod + def get_config_js_via_token(cls, token: str, domain: Optional[str] = None) -> str: + config = cls._get_via_cache(token, "config", lambda remote_config: remote_config.build_config()) + # Get the site apps JS so we can render it in the JS + site_apps_js = config.pop("siteAppsJS", None) + # We don't want to include the minimal site apps content as we have the JS now + config.pop("siteApps", None) + config = sanitize_config_for_public_cdn(config, domain) + + js_content = f"""(function() {{ + window._POSTHOG_CONFIG = {json.dumps(config)}; + window._POSTHOG_JS_APPS = [{','.join(site_apps_js)}]; +}})(); + """.strip() + + return js_content + @classmethod - def get_array_js_via_token(cls, token: str) -> str: + def get_array_js_via_token(cls, token: str, domain: Optional[str] = None) -> str: # NOTE: Unlike the other methods we dont store this in the cache as it is cheap to build at runtime - data = cls.get_config_js_via_token(token) + js_content = cls.get_config_js_via_token(token, domain) - return f""" - {get_array_js_content()} - - {data} - """ + return f"""{get_array_js_content()}\n\n{js_content}""" def sync(self): """ @@ -324,11 +356,6 @@ def sync(self): self.config = config cache.set(cache_key_for_team_token(self.team.api_token, "config"), config, timeout=CACHE_TIMEOUT) - cache.set( - cache_key_for_team_token(self.team.api_token, "config.js"), - self.build_js_config(), - timeout=CACHE_TIMEOUT, - ) # TODO: Invalidate caches - in particular this will be the Cloudflare CDN cache self.synced_at = timezone.now() diff --git a/posthog/models/test/test_remote_config.py b/posthog/models/test/test_remote_config.py index ed4f299982a8c..004ced96516e4 100644 --- a/posthog/models/test/test_remote_config.py +++ b/posthog/models/test/test_remote_config.py @@ -12,6 +12,8 @@ from posthog.test.base import BaseTest from django.core.cache import cache +CONFIG_REFRESH_QUERY_COUNT = 6 + class _RemoteConfigBase(BaseTest): remote_config: RemoteConfig @@ -26,6 +28,8 @@ def setUp(self): ) self.team = team self.team.api_token = "phc_12345" # Easier to test against + self.team.recording_domains = ["https://*.example.com"] + self.team.session_recording_opt_in = True self.team.save() # There will always be a config thanks to the signal @@ -45,8 +49,22 @@ def test_creates_remote_config_immediately(self): "heatmaps": False, "siteApps": [], "analytics": {"endpoint": "/i/v0/e/"}, + "siteAppsJS": [], "hasFeatureFlags": False, - "sessionRecording": False, + "sessionRecording": { + "domains": ["https://*.example.com"], + "endpoint": "/s/", + "linkedFlag": None, + "sampleRate": None, + "urlTriggers": [], + "scriptConfig": None, + "urlBlocklist": [], + "eventTriggers": [], + "recorderVersion": "v2", + "networkPayloadCapture": None, + "consoleLogRecordingEnabled": True, + "minimumDurationMilliseconds": None, + }, "captureDeadClicks": False, "capturePerformance": {"web_vitals": False, "network_timing": True, "web_vitals_allowed_metrics": None}, "autocapture_opt_out": False, @@ -114,10 +132,10 @@ def test_session_recording_sample_rate(self): def test_session_recording_domains(self): self.team.session_recording_opt_in = True - self.team.recording_domains = ["posthog.com", "posthog.com/docs"] + self.team.recording_domains = ["https://posthog.com", "https://*.posthog.com"] self.team.save() self.remote_config.refresh_from_db() - assert self.remote_config.config["sessionRecording"]["domainRestrictions"] + assert self.remote_config.config["sessionRecording"]["domains"] == self.team.recording_domains class TestRemoteConfigSurveys(_RemoteConfigBase): @@ -262,7 +280,60 @@ def setUp(self): self.remote_config.refresh_from_db() # Clear the cache so we are properly testing each flow assert cache.delete(cache_key_for_team_token(self.team.api_token, "config")) - assert cache.delete(cache_key_for_team_token(self.team.api_token, "config.js")) + + def _assert_matches_config(self, data): + assert data == snapshot( + { + "token": "phc_12345", + "supportedCompression": ["gzip", "gzip-js"], + "hasFeatureFlags": False, + "captureDeadClicks": False, + "capturePerformance": {"network_timing": True, "web_vitals": False, "web_vitals_allowed_metrics": None}, + "autocapture_opt_out": False, + "autocaptureExceptions": False, + "analytics": {"endpoint": "/i/v0/e/"}, + "elementsChainAsString": True, + "sessionRecording": { + "endpoint": "/s/", + "consoleLogRecordingEnabled": True, + "recorderVersion": "v2", + "sampleRate": None, + "minimumDurationMilliseconds": None, + "linkedFlag": None, + "networkPayloadCapture": None, + "urlTriggers": [], + "urlBlocklist": [], + "eventTriggers": [], + "scriptConfig": None, + }, + "heatmaps": False, + "surveys": [], + "defaultIdentifiedOnly": True, + "siteApps": [], + } + ) + + def _assert_matches_config_js(self, data): + assert data == snapshot( + """\ +(function() { + window._POSTHOG_CONFIG = {"token": "phc_12345", "supportedCompression": ["gzip", "gzip-js"], "hasFeatureFlags": false, "captureDeadClicks": false, "capturePerformance": {"network_timing": true, "web_vitals": false, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "autocaptureExceptions": false, "analytics": {"endpoint": "/i/v0/e/"}, "elementsChainAsString": true, "sessionRecording": {"endpoint": "/s/", "consoleLogRecordingEnabled": true, "recorderVersion": "v2", "sampleRate": null, "minimumDurationMilliseconds": null, "linkedFlag": null, "networkPayloadCapture": null, "urlTriggers": [], "urlBlocklist": [], "eventTriggers": [], "scriptConfig": null}, "heatmaps": false, "surveys": [], "defaultIdentifiedOnly": true}; + window._POSTHOG_JS_APPS = []; +})();\ +""" + ) + + def _assert_matches_config_array_js(self, data): + assert data == snapshot( + """\ +[MOCKED_ARRAY_JS_CONTENT] + +(function() { + window._POSTHOG_CONFIG = {"token": "phc_12345", "supportedCompression": ["gzip", "gzip-js"], "hasFeatureFlags": false, "captureDeadClicks": false, "capturePerformance": {"network_timing": true, "web_vitals": false, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "autocaptureExceptions": false, "analytics": {"endpoint": "/i/v0/e/"}, "elementsChainAsString": true, "sessionRecording": {"endpoint": "/s/", "consoleLogRecordingEnabled": true, "recorderVersion": "v2", "sampleRate": null, "minimumDurationMilliseconds": null, "linkedFlag": null, "networkPayloadCapture": null, "urlTriggers": [], "urlBlocklist": [], "eventTriggers": [], "scriptConfig": null}, "heatmaps": false, "surveys": [], "defaultIdentifiedOnly": true}; + window._POSTHOG_JS_APPS = []; +})();\ +""" + ) def test_syncs_if_changes(self): synced_at = self.remote_config.synced_at @@ -274,35 +345,42 @@ def test_persists_data_to_redis_on_sync(self): self.remote_config.config["surveys"] = True self.remote_config.sync() assert cache.get(cache_key_for_team_token(self.team.api_token, "config")) - assert cache.get(cache_key_for_team_token(self.team.api_token, "config.js")) def test_gets_via_redis_cache(self): - with self.assertNumQueries(3): + with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): data = RemoteConfig.get_config_via_token(self.team.api_token) - assert data == self.remote_config.config + self._assert_matches_config(data) with self.assertNumQueries(0): data = RemoteConfig.get_config_via_token(self.team.api_token) - assert data == self.remote_config.config + self._assert_matches_config(data) def test_gets_js_via_redis_cache(self): - with self.assertNumQueries(3): + with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): data = RemoteConfig.get_config_js_via_token(self.team.api_token) - - assert data == self.remote_config.build_js_config() + self._assert_matches_config_js(data) with self.assertNumQueries(0): data = RemoteConfig.get_config_js_via_token(self.team.api_token) + self._assert_matches_config_js(data) + + def test_gets_js_reuses_config_cache(self): + with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): + data = RemoteConfig.get_config_via_token(self.team.api_token) - assert data == self.remote_config.build_js_config() + with self.assertNumQueries(0): + data = RemoteConfig.get_config_js_via_token(self.team.api_token) + self._assert_matches_config_js(data) @patch("posthog.models.remote_config.get_array_js_content", return_value="[MOCKED_ARRAY_JS_CONTENT]") def test_gets_array_js_via_redis_cache(self, mock_get_array_js_content): - with self.assertNumQueries(3): - RemoteConfig.get_array_js_via_token(self.team.api_token) + with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): + data = RemoteConfig.get_array_js_via_token(self.team.api_token) + self._assert_matches_config_array_js(data) with self.assertNumQueries(0): - RemoteConfig.get_array_js_via_token(self.team.api_token) + data = RemoteConfig.get_array_js_via_token(self.team.api_token) + self._assert_matches_config_array_js(data) def test_caches_missing_response(self): with self.assertNumQueries(1): @@ -313,19 +391,62 @@ def test_caches_missing_response(self): with pytest.raises(RemoteConfig.DoesNotExist): RemoteConfig.get_array_js_via_token("missing-token") + def test_sanitizes_config_for_public_cdn(self): + config = self.remote_config.get_config_via_token(self.team.api_token) + # Ensure the domain and siteAppsJS are removed + assert config == snapshot( + { + "token": "phc_12345", + "supportedCompression": ["gzip", "gzip-js"], + "hasFeatureFlags": False, + "captureDeadClicks": False, + "capturePerformance": {"network_timing": True, "web_vitals": False, "web_vitals_allowed_metrics": None}, + "autocapture_opt_out": False, + "autocaptureExceptions": False, + "analytics": {"endpoint": "/i/v0/e/"}, + "elementsChainAsString": True, + "sessionRecording": { + "endpoint": "/s/", + "consoleLogRecordingEnabled": True, + "recorderVersion": "v2", + "sampleRate": None, + "minimumDurationMilliseconds": None, + "linkedFlag": None, + "networkPayloadCapture": None, + "urlTriggers": [], + "urlBlocklist": [], + "eventTriggers": [], + "scriptConfig": None, + }, + "heatmaps": False, + "surveys": [], + "defaultIdentifiedOnly": True, + "siteApps": [], + } + ) + + def test_only_includes_recording_for_approved_domains(self): + with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): + config = self.remote_config.get_config_via_token(self.team.api_token, domain="my.example.com") + assert config["sessionRecording"] + + # No additional queries should be needed to check the other domain + with self.assertNumQueries(0): + config = self.remote_config.get_config_via_token(self.team.api_token, domain="other.com") + assert not config["sessionRecording"] + class TestRemoteConfigJS(_RemoteConfigBase): def test_renders_js_including_config(self): # NOTE: This is a very basic test to check that the JS is rendered correctly # It doesn't check the actual contents of the JS, as that changes often but checks some general things - js = self.remote_config.build_config() - js = self.remote_config.build_js_config() + js = self.remote_config.get_config_js_via_token(self.team.api_token) # TODO: Come up with a good way of solidly testing this... assert js == snapshot( """\ (function() { - window._POSTHOG_CONFIG = {"token": "phc_12345", "surveys": [], "heatmaps": false, "siteApps": [], "analytics": {"endpoint": "/i/v0/e/"}, "hasFeatureFlags": false, "sessionRecording": false, "captureDeadClicks": false, "capturePerformance": {"web_vitals": false, "network_timing": true, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "supportedCompression": ["gzip", "gzip-js"], "autocaptureExceptions": false, "defaultIdentifiedOnly": true, "elementsChainAsString": true}; + window._POSTHOG_CONFIG = {"token": "phc_12345", "supportedCompression": ["gzip", "gzip-js"], "hasFeatureFlags": false, "captureDeadClicks": false, "capturePerformance": {"network_timing": true, "web_vitals": false, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "autocaptureExceptions": false, "analytics": {"endpoint": "/i/v0/e/"}, "elementsChainAsString": true, "sessionRecording": {"endpoint": "/s/", "consoleLogRecordingEnabled": true, "recorderVersion": "v2", "sampleRate": null, "minimumDurationMilliseconds": null, "linkedFlag": null, "networkPayloadCapture": null, "urlTriggers": [], "urlBlocklist": [], "eventTriggers": [], "scriptConfig": null}, "heatmaps": false, "surveys": [], "defaultIdentifiedOnly": true}; window._POSTHOG_JS_APPS = []; })();\ """ @@ -362,14 +483,13 @@ def test_renders_js_including_site_apps(self): plugin_configs[2].enabled = False - self.remote_config.build_config() - js = self.remote_config.build_js_config() + js = self.remote_config.get_config_js_via_token(self.team.api_token) # TODO: Come up with a good way of solidly testing this, ideally by running it in an actual browser environment assert js == snapshot( """\ (function() { - window._POSTHOG_CONFIG = {"token": "phc_12345", "surveys": [], "heatmaps": false, "siteApps": [], "analytics": {"endpoint": "/i/v0/e/"}, "hasFeatureFlags": false, "sessionRecording": false, "captureDeadClicks": false, "capturePerformance": {"web_vitals": false, "network_timing": true, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "supportedCompression": ["gzip", "gzip-js"], "autocaptureExceptions": false, "defaultIdentifiedOnly": true, "elementsChainAsString": true}; + window._POSTHOG_CONFIG = {"token": "phc_12345", "supportedCompression": ["gzip", "gzip-js"], "hasFeatureFlags": false, "captureDeadClicks": false, "capturePerformance": {"network_timing": true, "web_vitals": false, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "autocaptureExceptions": false, "analytics": {"endpoint": "/i/v0/e/"}, "elementsChainAsString": true, "sessionRecording": {"endpoint": "/s/", "consoleLogRecordingEnabled": true, "recorderVersion": "v2", "sampleRate": null, "minimumDurationMilliseconds": null, "linkedFlag": null, "networkPayloadCapture": null, "urlTriggers": [], "urlBlocklist": [], "eventTriggers": [], "scriptConfig": null}, "heatmaps": false, "surveys": [], "defaultIdentifiedOnly": true}; window._POSTHOG_JS_APPS = [ { id: 'tokentoken', @@ -426,8 +546,9 @@ def test_renders_js_including_site_functions(self): enabled=True, ) - self.remote_config.build_config() - js = self.remote_config.build_js_config() + print("about to get") + js = self.remote_config.get_config_js_via_token(self.team.api_token) + print(js) assert str(non_site_app.id) not in js assert str(site_destination.id) in js assert str(site_app.id) in js From b9d44d3e573d966a150fff8745ef93867f9e4f2a Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 12 Dec 2024 18:04:00 +0100 Subject: [PATCH 05/17] Fixes --- posthog/models/remote_config.py | 4 +--- posthog/models/test/test_remote_config.py | 12 +++++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/posthog/models/remote_config.py b/posthog/models/remote_config.py index cef2f98a105ef..66b0177de8d42 100644 --- a/posthog/models/remote_config.py +++ b/posthog/models/remote_config.py @@ -265,8 +265,6 @@ def _build_site_apps_js(self): site_functions_js = [] - print("found", site_functions) - for site_function in site_functions: try: source = get_transpiled_function(site_function) @@ -396,7 +394,7 @@ def site_app_saved(sender, instance: "PluginConfig", created, **kwargs): @receiver(post_save, sender=HogFunction) def site_function_saved(sender, instance: "HogFunction", created, **kwargs): - if instance.enabled and instance.type in ("site_destination", "site_app") and instance.transpiled: + if instance.enabled and instance.type in ("site_destination", "site_app"): _update_team_remote_config(instance.team_id) diff --git a/posthog/models/test/test_remote_config.py b/posthog/models/test/test_remote_config.py index 004ced96516e4..0009c4d5a0e8f 100644 --- a/posthog/models/test/test_remote_config.py +++ b/posthog/models/test/test_remote_config.py @@ -12,7 +12,7 @@ from posthog.test.base import BaseTest from django.core.cache import cache -CONFIG_REFRESH_QUERY_COUNT = 6 +CONFIG_REFRESH_QUERY_COUNT = 5 class _RemoteConfigBase(BaseTest): @@ -518,7 +518,7 @@ def test_renders_js_including_site_apps(self): def test_renders_js_including_site_functions(self): non_site_app = HogFunction.objects.create( - name="Test", + name="Non site app", type=HogFunctionType.DESTINATION, team=self.team, enabled=True, @@ -529,7 +529,7 @@ def test_renders_js_including_site_functions(self): ) site_destination = HogFunction.objects.create( - name="Test", + name="Site destination", type=HogFunctionType.SITE_DESTINATION, team=self.team, enabled=True, @@ -540,15 +540,13 @@ def test_renders_js_including_site_functions(self): ) site_app = HogFunction.objects.create( - name="Test", + name="Site app", type=HogFunctionType.SITE_APP, team=self.team, enabled=True, ) - print("about to get") js = self.remote_config.get_config_js_via_token(self.team.api_token) - print(js) assert str(non_site_app.id) not in js assert str(site_destination.id) in js assert str(site_app.id) in js @@ -561,7 +559,7 @@ def test_renders_js_including_site_functions(self): assert js == snapshot( """\ (function() { - window._POSTHOG_CONFIG = {"token": "phc_12345", "surveys": [], "heatmaps": false, "siteApps": [], "analytics": {"endpoint": "/i/v0/e/"}, "hasFeatureFlags": false, "sessionRecording": false, "captureDeadClicks": false, "capturePerformance": {"web_vitals": false, "network_timing": true, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "supportedCompression": ["gzip", "gzip-js"], "autocaptureExceptions": false, "defaultIdentifiedOnly": true, "elementsChainAsString": true}; + window._POSTHOG_CONFIG = {"token": "phc_12345", "supportedCompression": ["gzip", "gzip-js"], "hasFeatureFlags": false, "captureDeadClicks": false, "capturePerformance": {"network_timing": true, "web_vitals": false, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "autocaptureExceptions": false, "analytics": {"endpoint": "/i/v0/e/"}, "elementsChainAsString": true, "sessionRecording": {"endpoint": "/s/", "consoleLogRecordingEnabled": true, "recorderVersion": "v2", "sampleRate": null, "minimumDurationMilliseconds": null, "linkedFlag": null, "networkPayloadCapture": null, "urlTriggers": [], "urlBlocklist": [], "eventTriggers": [], "scriptConfig": null}, "heatmaps": false, "surveys": [], "defaultIdentifiedOnly": true}; window._POSTHOG_JS_APPS = [ { id: 'SITE_DESTINATION_ID', From 5ea5d15dced837f3f5213710dc67c3fa0a68c575 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:08:13 +0000 Subject: [PATCH 06/17] Update query snapshots --- .../api/test/__snapshots__/test_decide.ambr | 1796 +++++++++++------ .../test_early_access_feature.ambr | 306 ++- .../test_organization_feature_flag.ambr | 362 ++-- 3 files changed, 1593 insertions(+), 871 deletions(-) diff --git a/posthog/api/test/__snapshots__/test_decide.ambr b/posthog/api/test/__snapshots__/test_decide.ambr index a3d7eafe4ea90..77eda795b2644 100644 --- a/posthog/api/test/__snapshots__/test_decide.ambr +++ b/posthog/api/test/__snapshots__/test_decide.ambr @@ -644,9 +644,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.26 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.27 ''' SELECT 1 AS "a" FROM "posthog_grouptypemapping" @@ -654,7 +685,7 @@ LIMIT 1 ''' # --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.27 +# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.28 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -717,7 +748,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.28 +# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.29 ''' SELECT "posthog_productintent"."id", "posthog_productintent"."team_id", @@ -731,16 +762,6 @@ WHERE "posthog_productintent"."team_id" = 99999 ''' # --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.29 - ''' - SELECT "posthog_productintent"."product_type", - "posthog_productintent"."created_at", - "posthog_productintent"."onboarding_completed_at", - "posthog_productintent"."updated_at" - FROM "posthog_productintent" - WHERE "posthog_productintent"."team_id" = 99999 - ''' -# --- # name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.3 ''' SELECT "posthog_team"."id", @@ -812,6 +833,16 @@ ''' # --- # name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.30 + ''' + SELECT "posthog_productintent"."product_type", + "posthog_productintent"."created_at", + "posthog_productintent"."onboarding_completed_at", + "posthog_productintent"."updated_at" + FROM "posthog_productintent" + WHERE "posthog_productintent"."team_id" = 99999 + ''' +# --- +# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.31 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -843,7 +874,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.31 +# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.32 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -866,7 +897,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.32 +# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.33 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginconfig"."web_token", @@ -1228,6 +1259,76 @@ ''' # --- # name: TestDecide.test_flag_with_behavioural_cohorts.10 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecide.test_flag_with_behavioural_cohorts.11 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -1250,7 +1351,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.11 +# name: TestDecide.test_flag_with_behavioural_cohorts.12 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1313,7 +1414,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.12 +# name: TestDecide.test_flag_with_behavioural_cohorts.13 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -1325,7 +1426,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.13 +# name: TestDecide.test_flag_with_behavioural_cohorts.14 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1395,7 +1496,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.14 +# name: TestDecide.test_flag_with_behavioural_cohorts.15 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -1404,7 +1505,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.15 +# name: TestDecide.test_flag_with_behavioural_cohorts.16 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -1488,7 +1589,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.16 +# name: TestDecide.test_flag_with_behavioural_cohorts.17 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -1504,7 +1605,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.17 +# name: TestDecide.test_flag_with_behavioural_cohorts.18 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -1532,9 +1633,52 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.18 +# name: TestDecide.test_flag_with_behavioural_cohorts.19 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecide.test_flag_with_behavioural_cohorts.2 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecide.test_flag_with_behavioural_cohorts.20 ''' SELECT "posthog_cohort"."id", "posthog_cohort"."name", @@ -1559,7 +1703,7 @@ AND "posthog_cohort"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.19 +# name: TestDecide.test_flag_with_behavioural_cohorts.21 ''' SELECT "posthog_group"."id", "posthog_group"."team_id", @@ -1575,19 +1719,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.2 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecide.test_flag_with_behavioural_cohorts.20 +# name: TestDecide.test_flag_with_behavioural_cohorts.22 ''' SELECT "posthog_cohort"."id", "posthog_cohort"."name", @@ -1612,7 +1744,7 @@ AND "posthog_cohort"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.21 +# name: TestDecide.test_flag_with_behavioural_cohorts.23 ''' SELECT "posthog_group"."id", "posthog_group"."team_id", @@ -1835,9 +1967,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestDecide.test_flag_with_behavioural_cohorts.8 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecide.test_flag_with_behavioural_cohorts.9 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -1869,28 +2032,49 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.9 +# name: TestDecide.test_flag_with_regular_cohorts ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."project_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_web_vitals_opt_in", - "posthog_team"."autocapture_web_vitals_allowed_metrics", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."person_processing_opt_out", + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", "posthog_team"."session_recording_opt_in", "posthog_team"."session_recording_sample_rate", "posthog_team"."session_recording_minimum_duration_milliseconds", @@ -1934,35 +2118,15 @@ "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 + FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") + WHERE ("posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."filters" @> '{"filter_test_accounts": true}'::jsonb) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts +# name: TestDecide.test_flag_with_regular_cohorts.1 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id", - "posthog_team"."id", + SELECT "posthog_team"."id", "posthog_team"."uuid", "posthog_team"."organization_id", "posthog_team"."project_id", @@ -2016,22 +2180,14 @@ "posthog_team"."modifiers", "posthog_team"."correlation_config", "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_hogfunction" - INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."filters" @> '{"filter_test_accounts": true}'::jsonb) + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.1 +# name: TestDecide.test_flag_with_regular_cohorts.10 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2087,6 +2243,13 @@ "posthog_team"."modifiers", "posthog_team"."correlation_config", "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_team" @@ -2094,7 +2257,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.10 +# name: TestDecide.test_flag_with_regular_cohorts.11 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -2117,7 +2280,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.11 +# name: TestDecide.test_flag_with_regular_cohorts.12 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2180,7 +2343,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.12 +# name: TestDecide.test_flag_with_regular_cohorts.13 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -2192,7 +2355,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.13 +# name: TestDecide.test_flag_with_regular_cohorts.14 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2262,7 +2425,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.14 +# name: TestDecide.test_flag_with_regular_cohorts.15 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -2271,7 +2434,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.15 +# name: TestDecide.test_flag_with_regular_cohorts.16 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -2355,7 +2518,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.16 +# name: TestDecide.test_flag_with_regular_cohorts.17 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -2371,7 +2534,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.17 +# name: TestDecide.test_flag_with_regular_cohorts.18 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -2399,9 +2562,52 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.18 +# name: TestDecide.test_flag_with_regular_cohorts.19 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecide.test_flag_with_regular_cohorts.2 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecide.test_flag_with_regular_cohorts.20 ''' SELECT "posthog_cohort"."id", "posthog_cohort"."name", @@ -2426,7 +2632,7 @@ AND "posthog_cohort"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.19 +# name: TestDecide.test_flag_with_regular_cohorts.21 ''' SELECT (("posthog_person"."properties" -> '$some_prop_1') = '"something_1"'::jsonb AND "posthog_person"."properties" ? '$some_prop_1' @@ -2438,19 +2644,7 @@ AND "posthog_person"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.2 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecide.test_flag_with_regular_cohorts.20 +# name: TestDecide.test_flag_with_regular_cohorts.22 ''' SELECT "posthog_cohort"."id", "posthog_cohort"."name", @@ -2475,7 +2669,7 @@ AND "posthog_cohort"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.21 +# name: TestDecide.test_flag_with_regular_cohorts.23 ''' SELECT (("posthog_person"."properties" -> '$some_prop_1') = '"something_1"'::jsonb AND "posthog_person"."properties" ? '$some_prop_1' @@ -2694,9 +2888,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestDecide.test_flag_with_regular_cohorts.8 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecide.test_flag_with_regular_cohorts.9 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -2728,7 +2953,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.9 +# name: TestDecide.test_web_app_queries ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2784,84 +3009,14 @@ "posthog_team"."modifiers", "posthog_team"."correlation_config", "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 + WHERE "posthog_team"."api_token" = 'token123' LIMIT 21 ''' # --- -# name: TestDecide.test_web_app_queries - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."project_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_web_vitals_opt_in", - "posthog_team"."autocapture_web_vitals_allowed_metrics", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."person_processing_opt_out", - "posthog_team"."session_recording_opt_in", - "posthog_team"."session_recording_sample_rate", - "posthog_team"."session_recording_minimum_duration_milliseconds", - "posthog_team"."session_recording_linked_flag", - "posthog_team"."session_recording_network_payload_capture_config", - "posthog_team"."session_recording_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."api_token" = 'token123' - LIMIT 21 - ''' -# --- -# name: TestDecide.test_web_app_queries.1 +# name: TestDecide.test_web_app_queries.1 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -2928,9 +3083,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestDecide.test_web_app_queries.12 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecide.test_web_app_queries.13 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2993,7 +3179,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_web_app_queries.13 +# name: TestDecide.test_web_app_queries.14 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -3005,7 +3191,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_web_app_queries.14 +# name: TestDecide.test_web_app_queries.15 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3075,7 +3261,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_web_app_queries.15 +# name: TestDecide.test_web_app_queries.16 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -3084,7 +3270,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecide.test_web_app_queries.16 +# name: TestDecide.test_web_app_queries.17 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -3168,7 +3354,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecide.test_web_app_queries.17 +# name: TestDecide.test_web_app_queries.18 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginconfig"."web_token", @@ -3184,7 +3370,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecide.test_web_app_queries.18 +# name: TestDecide.test_web_app_queries.19 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -3200,7 +3386,23 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecide.test_web_app_queries.19 +# name: TestDecide.test_web_app_queries.2 + ''' + SELECT "posthog_pluginconfig"."id", + "posthog_pluginconfig"."web_token", + "posthog_pluginsourcefile"."updated_at", + "posthog_plugin"."updated_at", + "posthog_pluginconfig"."updated_at" + FROM "posthog_pluginconfig" + INNER JOIN "posthog_plugin" ON ("posthog_pluginconfig"."plugin_id" = "posthog_plugin"."id") + INNER JOIN "posthog_pluginsourcefile" ON ("posthog_plugin"."id" = "posthog_pluginsourcefile"."plugin_id") + WHERE ("posthog_pluginconfig"."enabled" + AND "posthog_pluginsourcefile"."filename" = 'site.ts' + AND "posthog_pluginsourcefile"."status" = 'TRANSPILED' + AND "posthog_pluginconfig"."team_id" = 99999) + ''' +# --- +# name: TestDecide.test_web_app_queries.20 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -3228,25 +3430,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestDecide.test_web_app_queries.2 +# name: TestDecide.test_web_app_queries.21 ''' - SELECT "posthog_pluginconfig"."id", - "posthog_pluginconfig"."web_token", - "posthog_pluginsourcefile"."updated_at", - "posthog_plugin"."updated_at", - "posthog_pluginconfig"."updated_at" - FROM "posthog_pluginconfig" - INNER JOIN "posthog_plugin" ON ("posthog_pluginconfig"."plugin_id" = "posthog_plugin"."id") - INNER JOIN "posthog_pluginsourcefile" ON ("posthog_plugin"."id" = "posthog_pluginsourcefile"."plugin_id") - WHERE ("posthog_pluginconfig"."enabled" - AND "posthog_pluginsourcefile"."filename" = 'site.ts' - AND "posthog_pluginsourcefile"."status" = 'TRANSPILED' - AND "posthog_pluginconfig"."team_id" = 99999) + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) ''' # --- -# name: TestDecide.test_web_app_queries.20 +# name: TestDecide.test_web_app_queries.22 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginconfig"."web_token", @@ -3262,7 +3479,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecide.test_web_app_queries.21 +# name: TestDecide.test_web_app_queries.23 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginconfig"."web_token", @@ -4269,9 +4486,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.26 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.27 ''' SELECT 1 AS "a" FROM "posthog_grouptypemapping" @@ -4279,7 +4527,7 @@ LIMIT 1 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.27 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.28 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -4342,7 +4590,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.28 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.29 ''' SELECT "posthog_productintent"."id", "posthog_productintent"."team_id", @@ -4356,16 +4604,6 @@ WHERE "posthog_productintent"."team_id" = 99999 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.29 - ''' - SELECT "posthog_productintent"."product_type", - "posthog_productintent"."created_at", - "posthog_productintent"."onboarding_completed_at", - "posthog_productintent"."updated_at" - FROM "posthog_productintent" - WHERE "posthog_productintent"."team_id" = 99999 - ''' -# --- # name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.3 ''' SELECT "posthog_team"."id", @@ -4437,6 +4675,16 @@ ''' # --- # name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.30 + ''' + SELECT "posthog_productintent"."product_type", + "posthog_productintent"."created_at", + "posthog_productintent"."onboarding_completed_at", + "posthog_productintent"."updated_at" + FROM "posthog_productintent" + WHERE "posthog_productintent"."team_id" = 99999 + ''' +# --- +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.31 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -4468,7 +4716,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.31 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.32 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -4480,7 +4728,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.32 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.33 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -4550,7 +4798,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.33 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.34 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -4559,7 +4807,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.34 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.35 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -4643,7 +4891,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.35 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.36 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginconfig"."web_token", @@ -4659,7 +4907,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.36 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.37 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -4675,7 +4923,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.37 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.38 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -4703,41 +4951,37 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - ''' -# --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.38 - ''' - SELECT "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_featureflag" - WHERE ("posthog_featureflag"."active" - AND NOT "posthog_featureflag"."deleted" - AND "posthog_featureflag"."team_id" = 99999) + LIMIT 21 ''' # --- # name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.39 ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) ''' # --- # name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.4 @@ -4776,7 +5020,42 @@ # --- # name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.40 ''' - SELECT "posthog_team"."id", + SELECT "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_featureflag" + WHERE ("posthog_featureflag"."active" + AND NOT "posthog_featureflag"."deleted" + AND "posthog_featureflag"."team_id" = 99999) + ''' +# --- +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.41 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.42 + ''' + SELECT "posthog_team"."id", "posthog_team"."uuid", "posthog_team"."organization_id", "posthog_team"."project_id", @@ -4844,7 +5123,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.41 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.43 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -4853,7 +5132,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.42 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.44 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -4937,7 +5216,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.43 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.45 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginconfig"."web_token", @@ -4953,7 +5232,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.44 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.46 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -4969,7 +5248,38 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.45 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.47 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.48 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -5311,6 +5621,76 @@ ''' # --- # name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.10 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.11 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -5333,7 +5713,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.11 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.12 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -5396,7 +5776,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.12 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.13 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -5408,7 +5788,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.13 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.14 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -5478,7 +5858,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.14 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.15 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -5487,7 +5867,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.15 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.16 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -5571,7 +5951,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.16 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.17 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -5587,7 +5967,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.17 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.18 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -5615,9 +5995,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.18 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.19 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.2 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -5629,7 +6040,19 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.19 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.20 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.21 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -5699,19 +6122,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.2 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.20 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.22 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -5720,7 +6131,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.21 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.23 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -5804,7 +6215,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.22 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.24 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -5820,7 +6231,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.23 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.25 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -5848,38 +6259,69 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.24 - ''' - SELECT "posthog_cohort"."id", - "posthog_cohort"."name", - "posthog_cohort"."description", - "posthog_cohort"."team_id", - "posthog_cohort"."deleted", - "posthog_cohort"."filters", - "posthog_cohort"."query", - "posthog_cohort"."version", - "posthog_cohort"."pending_version", - "posthog_cohort"."count", - "posthog_cohort"."created_by_id", - "posthog_cohort"."created_at", - "posthog_cohort"."is_calculating", - "posthog_cohort"."last_calculation", - "posthog_cohort"."errors_calculating", - "posthog_cohort"."last_error_at", - "posthog_cohort"."is_static", - "posthog_cohort"."groups" - FROM "posthog_cohort" - WHERE (NOT "posthog_cohort"."deleted" - AND "posthog_cohort"."team_id" = 99999) - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.25 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.26 ''' - SELECT "posthog_group"."id", - "posthog_group"."team_id", - "posthog_group"."group_key", + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.27 + ''' + SELECT "posthog_cohort"."id", + "posthog_cohort"."name", + "posthog_cohort"."description", + "posthog_cohort"."team_id", + "posthog_cohort"."deleted", + "posthog_cohort"."filters", + "posthog_cohort"."query", + "posthog_cohort"."version", + "posthog_cohort"."pending_version", + "posthog_cohort"."count", + "posthog_cohort"."created_by_id", + "posthog_cohort"."created_at", + "posthog_cohort"."is_calculating", + "posthog_cohort"."last_calculation", + "posthog_cohort"."errors_calculating", + "posthog_cohort"."last_error_at", + "posthog_cohort"."is_static", + "posthog_cohort"."groups" + FROM "posthog_cohort" + WHERE (NOT "posthog_cohort"."deleted" + AND "posthog_cohort"."team_id" = 99999) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.28 + ''' + SELECT "posthog_group"."id", + "posthog_group"."team_id", + "posthog_group"."group_key", "posthog_group"."group_type_index", "posthog_group"."group_properties", "posthog_group"."created_at", @@ -5891,7 +6333,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.26 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.29 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -5903,7 +6345,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.27 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.3 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -5973,7 +6415,77 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.28 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.30 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.31 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -5982,7 +6494,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.29 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.32 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -6066,77 +6578,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.3 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."project_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_web_vitals_opt_in", - "posthog_team"."autocapture_web_vitals_allowed_metrics", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."person_processing_opt_out", - "posthog_team"."session_recording_opt_in", - "posthog_team"."session_recording_sample_rate", - "posthog_team"."session_recording_minimum_duration_milliseconds", - "posthog_team"."session_recording_linked_flag", - "posthog_team"."session_recording_network_payload_capture_config", - "posthog_team"."session_recording_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.30 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.33 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -6152,7 +6594,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.31 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.34 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -6180,9 +6622,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.32 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.35 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.36 ''' SELECT "posthog_cohort"."id", "posthog_cohort"."name", @@ -6207,7 +6680,7 @@ AND "posthog_cohort"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.33 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.37 ''' SELECT "posthog_group"."id", "posthog_group"."team_id", @@ -6360,9 +6833,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.8 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.9 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -6394,9 +6898,30 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.9 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts ''' - SELECT "posthog_team"."id", + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id", + "posthog_team"."id", "posthog_team"."uuid", "posthog_team"."organization_id", "posthog_team"."project_id", @@ -6459,35 +6984,15 @@ "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 + FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") + WHERE ("posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."filters" @> '{"filter_test_accounts": true}'::jsonb) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.1 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id", - "posthog_team"."id", + SELECT "posthog_team"."id", "posthog_team"."uuid", "posthog_team"."organization_id", "posthog_team"."project_id", @@ -6541,22 +7046,14 @@ "posthog_team"."modifiers", "posthog_team"."correlation_config", "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_hogfunction" - INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."filters" @> '{"filter_test_accounts": true}'::jsonb) + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.1 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.10 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -6612,6 +7109,13 @@ "posthog_team"."modifiers", "posthog_team"."correlation_config", "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_team" @@ -6619,7 +7123,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.10 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.11 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -6642,7 +7146,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.11 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.12 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -6705,7 +7209,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.12 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.13 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -6717,7 +7221,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.13 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.14 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -6787,7 +7291,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.14 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.15 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -6796,7 +7300,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.15 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.16 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -6880,7 +7384,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.16 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.17 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -6896,7 +7400,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.17 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.18 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -6924,9 +7428,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.18 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.19 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.2 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -6938,7 +7473,19 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.19 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.20 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.21 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -7008,19 +7555,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.2 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.20 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.22 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -7029,7 +7564,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.21 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.23 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -7113,7 +7648,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.22 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.24 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -7129,7 +7664,38 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.23 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.25 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.26 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -7159,7 +7725,7 @@ 'site_app')) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.24 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.27 ''' SELECT "posthog_cohort"."id", "posthog_cohort"."name", @@ -7184,7 +7750,7 @@ AND "posthog_cohort"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.25 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.28 ''' SELECT (("posthog_person"."properties" -> '$some_prop_1') = '"something_1"'::jsonb AND "posthog_person"."properties" ? '$some_prop_1' @@ -7196,7 +7762,7 @@ AND "posthog_person"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.26 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.29 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -7208,7 +7774,77 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.27 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.3 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.30 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -7278,7 +7914,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.28 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.31 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -7287,7 +7923,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.29 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.32 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -7371,77 +8007,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.3 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."project_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_web_vitals_opt_in", - "posthog_team"."autocapture_web_vitals_allowed_metrics", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."person_processing_opt_out", - "posthog_team"."session_recording_opt_in", - "posthog_team"."session_recording_sample_rate", - "posthog_team"."session_recording_minimum_duration_milliseconds", - "posthog_team"."session_recording_linked_flag", - "posthog_team"."session_recording_network_payload_capture_config", - "posthog_team"."session_recording_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.30 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.33 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -7457,7 +8023,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.31 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.34 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -7485,9 +8051,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.32 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.35 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.36 ''' SELECT "posthog_cohort"."id", "posthog_cohort"."name", @@ -7512,7 +8109,7 @@ AND "posthog_cohort"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.33 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.37 ''' SELECT (("posthog_person"."properties" -> '$some_prop_1') = '"something_1"'::jsonb AND "posthog_person"."properties" ? '$some_prop_1' @@ -7661,9 +8258,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.8 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.9 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -7695,73 +8323,3 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.9 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."project_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_web_vitals_opt_in", - "posthog_team"."autocapture_web_vitals_allowed_metrics", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."person_processing_opt_out", - "posthog_team"."session_recording_opt_in", - "posthog_team"."session_recording_sample_rate", - "posthog_team"."session_recording_minimum_duration_milliseconds", - "posthog_team"."session_recording_linked_flag", - "posthog_team"."session_recording_network_payload_capture_config", - "posthog_team"."session_recording_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- diff --git a/posthog/api/test/__snapshots__/test_early_access_feature.ambr b/posthog/api/test/__snapshots__/test_early_access_feature.ambr index 20922177aa86c..723eb1f79311a 100644 --- a/posthog/api/test/__snapshots__/test_early_access_feature.ambr +++ b/posthog/api/test/__snapshots__/test_early_access_feature.ambr @@ -93,6 +93,29 @@ ''' # --- # name: TestPreviewList.test_early_access_features.10 + ''' + SELECT "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_featureflag" + WHERE ("posthog_featureflag"."active" + AND NOT "posthog_featureflag"."deleted" + AND "posthog_featureflag"."team_id" = 99999) + ''' +# --- +# name: TestPreviewList.test_early_access_features.11 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -155,7 +178,7 @@ LIMIT 21 ''' # --- -# name: TestPreviewList.test_early_access_features.11 +# name: TestPreviewList.test_early_access_features.12 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -167,7 +190,7 @@ LIMIT 21 ''' # --- -# name: TestPreviewList.test_early_access_features.12 +# name: TestPreviewList.test_early_access_features.13 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -237,7 +260,7 @@ LIMIT 21 ''' # --- -# name: TestPreviewList.test_early_access_features.13 +# name: TestPreviewList.test_early_access_features.14 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -246,7 +269,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestPreviewList.test_early_access_features.14 +# name: TestPreviewList.test_early_access_features.15 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -330,7 +353,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestPreviewList.test_early_access_features.15 +# name: TestPreviewList.test_early_access_features.16 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -346,7 +369,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestPreviewList.test_early_access_features.16 +# name: TestPreviewList.test_early_access_features.17 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -374,9 +397,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestPreviewList.test_early_access_features.17 +# name: TestPreviewList.test_early_access_features.18 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestPreviewList.test_early_access_features.19 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -408,7 +462,7 @@ LIMIT 21 ''' # --- -# name: TestPreviewList.test_early_access_features.18 +# name: TestPreviewList.test_early_access_features.2 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -467,43 +521,11 @@ "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_team" - WHERE "posthog_team"."api_token" = 'token123' + WHERE "posthog_team"."id" = 99999 LIMIT 21 ''' # --- -# name: TestPreviewList.test_early_access_features.19 - ''' - SELECT "posthog_earlyaccessfeature"."id", - "posthog_earlyaccessfeature"."team_id", - "posthog_earlyaccessfeature"."feature_flag_id", - "posthog_earlyaccessfeature"."name", - "posthog_earlyaccessfeature"."description", - "posthog_earlyaccessfeature"."stage", - "posthog_earlyaccessfeature"."documentation_url", - "posthog_earlyaccessfeature"."created_at", - "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_earlyaccessfeature" - INNER JOIN "posthog_team" ON ("posthog_earlyaccessfeature"."team_id" = "posthog_team"."id") - LEFT OUTER JOIN "posthog_featureflag" ON ("posthog_earlyaccessfeature"."feature_flag_id" = "posthog_featureflag"."id") - WHERE ("posthog_earlyaccessfeature"."stage" = 'beta' - AND "posthog_team"."project_id" = 99999) - ''' -# --- -# name: TestPreviewList.test_early_access_features.2 +# name: TestPreviewList.test_early_access_features.20 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -562,10 +584,42 @@ "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 + WHERE "posthog_team"."api_token" = 'token123' LIMIT 21 ''' # --- +# name: TestPreviewList.test_early_access_features.21 + ''' + SELECT "posthog_earlyaccessfeature"."id", + "posthog_earlyaccessfeature"."team_id", + "posthog_earlyaccessfeature"."feature_flag_id", + "posthog_earlyaccessfeature"."name", + "posthog_earlyaccessfeature"."description", + "posthog_earlyaccessfeature"."stage", + "posthog_earlyaccessfeature"."documentation_url", + "posthog_earlyaccessfeature"."created_at", + "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_earlyaccessfeature" + INNER JOIN "posthog_team" ON ("posthog_earlyaccessfeature"."team_id" = "posthog_team"."id") + LEFT OUTER JOIN "posthog_featureflag" ON ("posthog_earlyaccessfeature"."feature_flag_id" = "posthog_featureflag"."id") + WHERE ("posthog_earlyaccessfeature"."stage" = 'beta' + AND "posthog_team"."project_id" = 99999) + ''' +# --- # name: TestPreviewList.test_early_access_features.3 ''' SELECT "posthog_remoteconfig"."id", @@ -785,29 +839,37 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestPreviewList.test_early_access_features.9 ''' - SELECT "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_featureflag" - WHERE ("posthog_featureflag"."active" - AND NOT "posthog_featureflag"."deleted" - AND "posthog_featureflag"."team_id" = 99999) + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) ''' # --- # name: TestPreviewList.test_early_access_features_with_cached_team @@ -944,6 +1006,36 @@ ''' # --- # name: TestPreviewList.test_early_access_features_with_cached_team.10 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestPreviewList.test_early_access_features_with_cached_team.11 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -975,7 +1067,7 @@ LIMIT 21 ''' # --- -# name: TestPreviewList.test_early_access_features_with_cached_team.11 +# name: TestPreviewList.test_early_access_features_with_cached_team.12 ''' SELECT "posthog_earlyaccessfeature"."id", "posthog_earlyaccessfeature"."team_id", @@ -1312,6 +1404,7 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestPreviewList.test_early_access_features_with_pre_env_cached_team @@ -1408,6 +1501,38 @@ ''' # --- # name: TestPreviewList.test_early_access_features_with_pre_env_cached_team.10 + ''' + SELECT "posthog_user"."id", + "posthog_user"."password", + "posthog_user"."last_login", + "posthog_user"."first_name", + "posthog_user"."last_name", + "posthog_user"."is_staff", + "posthog_user"."date_joined", + "posthog_user"."uuid", + "posthog_user"."current_organization_id", + "posthog_user"."current_team_id", + "posthog_user"."email", + "posthog_user"."pending_email", + "posthog_user"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "posthog_user"."has_seen_product_intro_for", + "posthog_user"."strapi_id", + "posthog_user"."is_active", + "posthog_user"."theme_mode", + "posthog_user"."partial_notification_settings", + "posthog_user"."anonymize_data", + "posthog_user"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in" + FROM "posthog_user" + WHERE "posthog_user"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestPreviewList.test_early_access_features_with_pre_env_cached_team.11 ''' SELECT "posthog_earlyaccessfeature"."id", "posthog_earlyaccessfeature"."team_id", @@ -1721,37 +1846,36 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestPreviewList.test_early_access_features_with_pre_env_cached_team.9 ''' - SELECT "posthog_user"."id", - "posthog_user"."password", - "posthog_user"."last_login", - "posthog_user"."first_name", - "posthog_user"."last_name", - "posthog_user"."is_staff", - "posthog_user"."date_joined", - "posthog_user"."uuid", - "posthog_user"."current_organization_id", - "posthog_user"."current_team_id", - "posthog_user"."email", - "posthog_user"."pending_email", - "posthog_user"."temporary_token", - "posthog_user"."distinct_id", - "posthog_user"."is_email_verified", - "posthog_user"."has_seen_product_intro_for", - "posthog_user"."strapi_id", - "posthog_user"."is_active", - "posthog_user"."theme_mode", - "posthog_user"."partial_notification_settings", - "posthog_user"."anonymize_data", - "posthog_user"."toolbar_mode", - "posthog_user"."hedgehog_config", - "posthog_user"."events_column_config", - "posthog_user"."email_opt_in" - FROM "posthog_user" - WHERE "posthog_user"."id" = 99999 - LIMIT 21 + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) ''' # --- diff --git a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr index bd705cda0b1cd..9411bca7e53a2 100644 --- a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr +++ b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr @@ -362,9 +362,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.18 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.19 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -434,17 +465,6 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.19 - ''' - SELECT "posthog_dashboardtile"."id" - FROM "posthog_dashboardtile" - INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id") - WHERE (NOT ("posthog_dashboardtile"."deleted" - AND "posthog_dashboardtile"."deleted" IS NOT NULL) - AND NOT ("posthog_dashboard"."deleted") - AND "posthog_dashboardtile"."dashboard_id" = 99999) - ''' -# --- # name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.2 ''' SELECT 1 AS "a" @@ -455,6 +475,17 @@ ''' # --- # name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.20 + ''' + SELECT "posthog_dashboardtile"."id" + FROM "posthog_dashboardtile" + INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id") + WHERE (NOT ("posthog_dashboardtile"."deleted" + AND "posthog_dashboardtile"."deleted" IS NOT NULL) + AND NOT ("posthog_dashboard"."deleted") + AND "posthog_dashboardtile"."dashboard_id" = 99999) + ''' +# --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.21 ''' SELECT "posthog_organization"."id", "posthog_organization"."name", @@ -480,7 +511,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.21 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.22 ''' SELECT "posthog_dashboardtile"."id" FROM "posthog_dashboardtile" @@ -491,7 +522,7 @@ AND "posthog_dashboardtile"."dashboard_id" = 99999) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.22 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.23 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -554,7 +585,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.23 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.24 ''' SELECT "posthog_dashboarditem"."id", "posthog_dashboarditem"."name", @@ -589,7 +620,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.24 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.25 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -659,7 +690,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.25 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.26 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -722,7 +753,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.26 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.27 ''' SELECT "posthog_dashboardtile"."id", "posthog_dashboardtile"."dashboard_id", @@ -740,7 +771,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.27 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.28 ''' SELECT "posthog_dashboarditem"."id", "posthog_dashboarditem"."name", @@ -775,7 +806,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.28 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.29 ''' SELECT "posthog_dashboard"."id", "posthog_dashboard"."name", @@ -799,7 +830,31 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.29 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.3 + ''' + SELECT "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_featureflag" + INNER JOIN "posthog_team" ON ("posthog_featureflag"."team_id" = "posthog_team"."id") + WHERE ("posthog_featureflag"."key" = 'copied-flag-key' + AND "posthog_team"."project_id" = 99999) + LIMIT 21 + ''' +# --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.30 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -869,31 +924,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.3 - ''' - SELECT "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_featureflag" - INNER JOIN "posthog_team" ON ("posthog_featureflag"."team_id" = "posthog_team"."id") - WHERE ("posthog_featureflag"."key" = 'copied-flag-key' - AND "posthog_team"."project_id" = 99999) - LIMIT 21 - ''' -# --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.30 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.31 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -956,7 +987,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.31 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.32 ''' SELECT "posthog_dashboarditem"."id", "posthog_dashboarditem"."name", @@ -991,7 +1022,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.32 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.33 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1061,7 +1092,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.33 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.34 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1124,7 +1155,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.34 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.35 ''' SELECT "posthog_dashboardtile"."id", "posthog_dashboardtile"."dashboard_id", @@ -1142,7 +1173,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.35 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.36 ''' SELECT "posthog_dashboarditem"."id", "posthog_dashboarditem"."name", @@ -1177,7 +1208,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.36 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.37 ''' SELECT "posthog_dashboard"."id", "posthog_dashboard"."name", @@ -1201,7 +1232,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.37 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.38 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1271,7 +1302,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.38 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.39 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -1294,7 +1325,33 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.39 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.4 + ''' + SELECT "posthog_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."logo_media_id", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + FROM "posthog_organization" + WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid + LIMIT 21 + ''' +# --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.40 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1357,33 +1414,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.4 - ''' - SELECT "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organization" - WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid - LIMIT 21 - ''' -# --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.40 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.41 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -1395,7 +1426,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.41 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.42 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1465,7 +1496,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.42 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.43 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -1474,7 +1505,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.43 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.44 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -1558,7 +1589,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.44 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.45 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -1574,7 +1605,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.45 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.46 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -1602,9 +1633,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.46 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.47 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.48 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1674,7 +1736,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.47 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.49 ''' SELECT "posthog_experiment"."id", "posthog_experiment"."name", @@ -1700,55 +1762,6 @@ WHERE "posthog_experiment"."feature_flag_id" = 99999 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.48 - ''' - SELECT "posthog_survey"."id", - "posthog_survey"."team_id", - "posthog_survey"."name", - "posthog_survey"."description", - "posthog_survey"."linked_flag_id", - "posthog_survey"."targeting_flag_id", - "posthog_survey"."internal_targeting_flag_id", - "posthog_survey"."internal_response_sampling_flag_id", - "posthog_survey"."type", - "posthog_survey"."conditions", - "posthog_survey"."questions", - "posthog_survey"."appearance", - "posthog_survey"."created_at", - "posthog_survey"."created_by_id", - "posthog_survey"."start_date", - "posthog_survey"."end_date", - "posthog_survey"."updated_at", - "posthog_survey"."archived", - "posthog_survey"."responses_limit", - "posthog_survey"."response_sampling_start_date", - "posthog_survey"."response_sampling_interval_type", - "posthog_survey"."response_sampling_interval", - "posthog_survey"."response_sampling_limit", - "posthog_survey"."response_sampling_daily_limits", - "posthog_survey"."iteration_count", - "posthog_survey"."iteration_frequency_days", - "posthog_survey"."iteration_start_dates", - "posthog_survey"."current_iteration", - "posthog_survey"."current_iteration_start_date" - FROM "posthog_survey" - WHERE "posthog_survey"."linked_flag_id" = 99999 - ''' -# --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.49 - ''' - SELECT "posthog_earlyaccessfeature"."id", - "posthog_earlyaccessfeature"."team_id", - "posthog_earlyaccessfeature"."feature_flag_id", - "posthog_earlyaccessfeature"."name", - "posthog_earlyaccessfeature"."description", - "posthog_earlyaccessfeature"."stage", - "posthog_earlyaccessfeature"."documentation_url", - "posthog_earlyaccessfeature"."created_at" - FROM "posthog_earlyaccessfeature" - WHERE "posthog_earlyaccessfeature"."feature_flag_id" = 99999 - ''' -# --- # name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.5 ''' SELECT "posthog_team"."id", @@ -1814,6 +1827,55 @@ ''' # --- # name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.50 + ''' + SELECT "posthog_survey"."id", + "posthog_survey"."team_id", + "posthog_survey"."name", + "posthog_survey"."description", + "posthog_survey"."linked_flag_id", + "posthog_survey"."targeting_flag_id", + "posthog_survey"."internal_targeting_flag_id", + "posthog_survey"."internal_response_sampling_flag_id", + "posthog_survey"."type", + "posthog_survey"."conditions", + "posthog_survey"."questions", + "posthog_survey"."appearance", + "posthog_survey"."created_at", + "posthog_survey"."created_by_id", + "posthog_survey"."start_date", + "posthog_survey"."end_date", + "posthog_survey"."updated_at", + "posthog_survey"."archived", + "posthog_survey"."responses_limit", + "posthog_survey"."response_sampling_start_date", + "posthog_survey"."response_sampling_interval_type", + "posthog_survey"."response_sampling_interval", + "posthog_survey"."response_sampling_limit", + "posthog_survey"."response_sampling_daily_limits", + "posthog_survey"."iteration_count", + "posthog_survey"."iteration_frequency_days", + "posthog_survey"."iteration_start_dates", + "posthog_survey"."current_iteration", + "posthog_survey"."current_iteration_start_date" + FROM "posthog_survey" + WHERE "posthog_survey"."linked_flag_id" = 99999 + ''' +# --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.51 + ''' + SELECT "posthog_earlyaccessfeature"."id", + "posthog_earlyaccessfeature"."team_id", + "posthog_earlyaccessfeature"."feature_flag_id", + "posthog_earlyaccessfeature"."name", + "posthog_earlyaccessfeature"."description", + "posthog_earlyaccessfeature"."stage", + "posthog_earlyaccessfeature"."documentation_url", + "posthog_earlyaccessfeature"."created_at" + FROM "posthog_earlyaccessfeature" + WHERE "posthog_earlyaccessfeature"."feature_flag_id" = 99999 + ''' +# --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.52 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -1847,7 +1909,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.51 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.53 ''' SELECT "posthog_dashboard"."id", "posthog_dashboard"."name", @@ -1872,7 +1934,7 @@ AND "posthog_featureflagdashboards"."feature_flag_id" = 99999) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.52 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.54 ''' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -1906,28 +1968,6 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.53 - ''' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' - ORDER BY "posthog_instancesetting"."id" ASC - LIMIT 1 - ''' -# --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.54 - ''' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' - ORDER BY "posthog_instancesetting"."id" ASC - LIMIT 1 - ''' -# --- # name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.55 ''' SELECT "posthog_instancesetting"."id", From 9d27848110940ec5baeb93c5949b0b4b42b45230 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:12:18 +0000 Subject: [PATCH 07/17] Update query snapshots --- .../test_process_scheduled_changes.ambr | 377 +++++++++++------- .../test/__snapshots__/test_feature_flag.ambr | 331 +++++++++++---- 2 files changed, 478 insertions(+), 230 deletions(-) diff --git a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr index 3fc2e6d23976d..a270d8c0f291e 100644 --- a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr +++ b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr @@ -86,6 +86,28 @@ ''' # --- # name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.10 + ''' + SELECT "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_featureflag" + WHERE "posthog_featureflag"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.11 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -118,7 +140,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.11 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.12 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -141,7 +163,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.12 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.13 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -204,7 +226,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.13 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.14 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -216,7 +238,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.14 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.15 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -286,7 +308,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.15 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.16 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -295,7 +317,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.16 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.17 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -379,7 +401,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.17 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.18 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -395,7 +417,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.18 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.19 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -423,9 +445,52 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.19 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.2 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.20 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.21 ''' SELECT "posthog_organization"."id", "posthog_organization"."name", @@ -451,19 +516,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.2 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.20 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.22 ''' SELECT "posthog_experiment"."id", "posthog_experiment"."name", @@ -489,7 +542,7 @@ WHERE "posthog_experiment"."feature_flag_id" = 99999 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.21 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.23 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -559,7 +612,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.22 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.24 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -581,7 +634,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.23 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.25 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -614,7 +667,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.24 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.26 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -637,7 +690,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.25 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.27 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -700,7 +753,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.26 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.28 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -712,7 +765,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.27 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.29 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -782,7 +835,77 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.28 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.3 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.30 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -791,7 +914,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.29 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.31 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -875,77 +998,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.3 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."project_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_web_vitals_opt_in", - "posthog_team"."autocapture_web_vitals_allowed_metrics", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."person_processing_opt_out", - "posthog_team"."session_recording_opt_in", - "posthog_team"."session_recording_sample_rate", - "posthog_team"."session_recording_minimum_duration_milliseconds", - "posthog_team"."session_recording_linked_flag", - "posthog_team"."session_recording_network_payload_capture_config", - "posthog_team"."session_recording_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.30 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.32 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -961,7 +1014,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.31 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.33 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -989,9 +1042,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.32 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.34 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.35 ''' SELECT "posthog_organization"."id", "posthog_organization"."name", @@ -1017,7 +1101,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.33 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.36 ''' SELECT "posthog_experiment"."id", "posthog_experiment"."name", @@ -1043,7 +1127,7 @@ WHERE "posthog_experiment"."feature_flag_id" = 99999 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.34 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.37 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1113,7 +1197,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.35 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.38 ''' SELECT "posthog_scheduledchange"."id", "posthog_scheduledchange"."record_id", @@ -1131,7 +1215,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.36 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.39 ''' SELECT "posthog_scheduledchange"."id", "posthog_scheduledchange"."record_id", @@ -1149,7 +1233,16 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.37 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.4 + ''' + SELECT COUNT(*) AS "__count" + FROM "posthog_featureflag" + WHERE ("posthog_featureflag"."active" + AND NOT "posthog_featureflag"."deleted" + AND "posthog_featureflag"."team_id" = 99999) + ''' +# --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.40 ''' SELECT "posthog_scheduledchange"."id", "posthog_scheduledchange"."record_id", @@ -1167,7 +1260,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.38 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.41 ''' SELECT "posthog_scheduledchange"."id", "posthog_scheduledchange"."record_id", @@ -1185,7 +1278,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.39 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.42 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -1207,15 +1300,6 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.4 - ''' - SELECT COUNT(*) AS "__count" - FROM "posthog_featureflag" - WHERE ("posthog_featureflag"."active" - AND NOT "posthog_featureflag"."deleted" - AND "posthog_featureflag"."team_id" = 99999) - ''' -# --- # name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.5 ''' SELECT "posthog_survey"."id", @@ -1344,9 +1428,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.8 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.9 ''' SELECT "posthog_scheduledchange"."id", "posthog_scheduledchange"."record_id", @@ -1368,25 +1483,3 @@ UPDATE NOWAIT ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.9 - ''' - SELECT "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_featureflag" - WHERE "posthog_featureflag"."id" = 99999 - LIMIT 21 - ''' -# --- diff --git a/posthog/test/__snapshots__/test_feature_flag.ambr b/posthog/test/__snapshots__/test_feature_flag.ambr index 3a833b55c0c8a..db26f84b87453 100644 --- a/posthog/test/__snapshots__/test_feature_flag.ambr +++ b/posthog/test/__snapshots__/test_feature_flag.ambr @@ -217,6 +217,29 @@ ''' # --- # name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.10 + ''' + SELECT "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_featureflag" + WHERE ("posthog_featureflag"."active" + AND NOT "posthog_featureflag"."deleted" + AND "posthog_featureflag"."team_id" = 99999) + ''' +# --- +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.11 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -279,7 +302,7 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.11 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.12 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -291,7 +314,7 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.12 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.13 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -361,7 +384,7 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.13 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.14 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -370,7 +393,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.14 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.15 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -454,7 +477,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.15 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.16 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -470,7 +493,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.16 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.17 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -498,9 +521,40 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.17 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.18 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.19 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -523,7 +577,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.18 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.2 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -586,19 +640,7 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.19 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.2 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.20 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -661,7 +703,19 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.20 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.21 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.22 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -731,7 +785,7 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.21 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.23 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -740,7 +794,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.22 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.24 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -824,7 +878,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.23 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.25 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -840,7 +894,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.24 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.26 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -868,24 +922,43 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.25 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.27 ''' - SELECT ((("posthog_person"."properties" -> 'Distinct Id') IN ('"307"'::jsonb) - OR ("posthog_person"."properties" -> 'Distinct Id') IN ('307'::jsonb)) - AND "posthog_person"."properties" ? 'Distinct Id' - AND NOT (("posthog_person"."properties" -> 'Distinct Id') = 'null'::jsonb)) AS "flag_X_condition_0" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = '307' - AND "posthog_persondistinctid"."team_id" = 99999 - AND "posthog_person"."team_id" = 99999) + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.26 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.28 ''' - SELECT (("posthog_person"."properties" -> 'Distinct Id') IN ('307'::jsonb) + SELECT ((("posthog_person"."properties" -> 'Distinct Id') IN ('"307"'::jsonb) + OR ("posthog_person"."properties" -> 'Distinct Id') IN ('307'::jsonb)) AND "posthog_person"."properties" ? 'Distinct Id' AND NOT (("posthog_person"."properties" -> 'Distinct Id') = 'null'::jsonb)) AS "flag_X_condition_0" FROM "posthog_person" @@ -895,9 +968,9 @@ AND "posthog_person"."team_id" = 99999) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.27 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.29 ''' - SELECT (("posthog_person"."properties" -> 'Distinct Id') = '307'::jsonb + SELECT (("posthog_person"."properties" -> 'Distinct Id') IN ('307'::jsonb) AND "posthog_person"."properties" ? 'Distinct Id' AND NOT (("posthog_person"."properties" -> 'Distinct Id') = 'null'::jsonb)) AS "flag_X_condition_0" FROM "posthog_person" @@ -919,6 +992,18 @@ LIMIT 21 ''' # --- +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.30 + ''' + SELECT (("posthog_person"."properties" -> 'Distinct Id') = '307'::jsonb + AND "posthog_person"."properties" ? 'Distinct Id' + AND NOT (("posthog_person"."properties" -> 'Distinct Id') = 'null'::jsonb)) AS "flag_X_condition_0" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = '307' + AND "posthog_persondistinctid"."team_id" = 99999 + AND "posthog_person"."team_id" = 99999) + ''' +# --- # name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.4 ''' SELECT "posthog_team"."id", @@ -1126,29 +1211,37 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.9 ''' - SELECT "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_featureflag" - WHERE ("posthog_featureflag"."active" - AND NOT "posthog_featureflag"."deleted" - AND "posthog_featureflag"."team_id" = 99999) + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) ''' # --- # name: TestFeatureFlagMatcher.test_invalid_regex_match_flag @@ -1245,6 +1338,18 @@ ''' # --- # name: TestFeatureFlagMatcher.test_invalid_regex_match_flag.10 + ''' + SELECT (("posthog_person"."properties" ->> 'email')::text ~ '["neil@x.com"]' + AND "posthog_person"."properties" ? 'email' + AND NOT (("posthog_person"."properties" -> 'email') = 'null'::jsonb)) AS "flag_X_condition_0" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = '307' + AND "posthog_persondistinctid"."team_id" = 99999 + AND "posthog_person"."team_id" = 99999) + ''' +# --- +# name: TestFeatureFlagMatcher.test_invalid_regex_match_flag.11 ''' SELECT (("posthog_person"."properties" ->> 'email')::text ~ '["neil@x.com"]' AND "posthog_person"."properties" ? 'email' @@ -1538,18 +1643,37 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestFeatureFlagMatcher.test_invalid_regex_match_flag.9 ''' - SELECT (("posthog_person"."properties" ->> 'email')::text ~ '["neil@x.com"]' - AND "posthog_person"."properties" ? 'email' - AND NOT (("posthog_person"."properties" -> 'email') = 'null'::jsonb)) AS "flag_X_condition_0" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = '307' - AND "posthog_persondistinctid"."team_id" = 99999 - AND "posthog_person"."team_id" = 99999) + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) ''' # --- # name: TestFeatureFlagMatcher.test_multiple_flags @@ -1873,6 +1997,31 @@ ''' # --- # name: TestFeatureFlagMatcher.test_with_sql_injection_properties_and_other_aliases.10 + ''' + SELECT "posthog_cohort"."id", + "posthog_cohort"."name", + "posthog_cohort"."description", + "posthog_cohort"."team_id", + "posthog_cohort"."deleted", + "posthog_cohort"."filters", + "posthog_cohort"."query", + "posthog_cohort"."version", + "posthog_cohort"."pending_version", + "posthog_cohort"."count", + "posthog_cohort"."created_by_id", + "posthog_cohort"."created_at", + "posthog_cohort"."is_calculating", + "posthog_cohort"."last_calculation", + "posthog_cohort"."errors_calculating", + "posthog_cohort"."last_error_at", + "posthog_cohort"."is_static", + "posthog_cohort"."groups" + FROM "posthog_cohort" + WHERE (NOT "posthog_cohort"."deleted" + AND "posthog_cohort"."team_id" = 99999) + ''' +# --- +# name: TestFeatureFlagMatcher.test_with_sql_injection_properties_and_other_aliases.11 ''' SELECT (((("posthog_person"."properties" -> 'number space') > '"100"'::jsonb AND JSONB_TYPEOF(("posthog_person"."properties" -> 'number space')) = ('string')) @@ -2191,31 +2340,37 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) + LIMIT 21 ''' # --- # name: TestFeatureFlagMatcher.test_with_sql_injection_properties_and_other_aliases.9 ''' - SELECT "posthog_cohort"."id", - "posthog_cohort"."name", - "posthog_cohort"."description", - "posthog_cohort"."team_id", - "posthog_cohort"."deleted", - "posthog_cohort"."filters", - "posthog_cohort"."query", - "posthog_cohort"."version", - "posthog_cohort"."pending_version", - "posthog_cohort"."count", - "posthog_cohort"."created_by_id", - "posthog_cohort"."created_at", - "posthog_cohort"."is_calculating", - "posthog_cohort"."last_calculation", - "posthog_cohort"."errors_calculating", - "posthog_cohort"."last_error_at", - "posthog_cohort"."is_static", - "posthog_cohort"."groups" - FROM "posthog_cohort" - WHERE (NOT "posthog_cohort"."deleted" - AND "posthog_cohort"."team_id" = 99999) + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) ''' # --- # name: TestHashKeyOverridesRaceConditions.test_hash_key_overrides_with_simulated_error_race_conditions_on_person_merging From 86b2d9c0c583a6a5fcd5d7702210912a18e65a65 Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 12 Dec 2024 18:27:22 +0100 Subject: [PATCH 08/17] Fix up loaders --- posthog/api/remote_config.py | 16 ++------ posthog/api/test/test_remote_config.py | 54 ++++++++++++++++++++++---- posthog/models/remote_config.py | 10 ++--- 3 files changed, 54 insertions(+), 26 deletions(-) diff --git a/posthog/api/remote_config.py b/posthog/api/remote_config.py index 803a0871bbcad..51acb363ddb3b 100644 --- a/posthog/api/remote_config.py +++ b/posthog/api/remote_config.py @@ -19,21 +19,11 @@ def check_token(self, token: str): raise ValidationError("Invalid token") return token - def get_domain_param(self): - domain = self.request.GET.get("domain") - if not domain: - return None - - # Simple check that the domain is simple like a.b.com - if not re.match(r"^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$", domain): - raise ValidationError("Invalid domain") - return domain - class RemoteConfigAPIView(BaseRemoteConfigAPIView): def get(self, request, token: str, *args, **kwargs): try: - resource = RemoteConfig.get_config_via_token(self.check_token(token), domain=self.get_domain_param()) + resource = RemoteConfig.get_config_via_token(self.check_token(token), domain=self.request.GET.get("domain")) except RemoteConfig.DoesNotExist: raise Http404() @@ -44,7 +34,7 @@ class RemoteConfigJSAPIView(BaseRemoteConfigAPIView): def get(self, request, token: str, *args, **kwargs): try: script_content = RemoteConfig.get_config_js_via_token( - self.check_token(token), domain=self.get_domain_param() + self.check_token(token), domain=self.request.GET.get("domain") ) except RemoteConfig.DoesNotExist: raise Http404() @@ -56,7 +46,7 @@ class RemoteConfigArrayJSAPIView(BaseRemoteConfigAPIView): def get(self, request, token: str, *args, **kwargs): try: script_content = RemoteConfig.get_array_js_via_token( - self.check_token(token), domain=self.get_domain_param() + self.check_token(token), domain=self.request.GET.get("domain") ) except RemoteConfig.DoesNotExist: raise Http404() diff --git a/posthog/api/test/test_remote_config.py b/posthog/api/test/test_remote_config.py index 07f1606b6a9fa..ab2f130dfead8 100644 --- a/posthog/api/test/test_remote_config.py +++ b/posthog/api/test/test_remote_config.py @@ -3,13 +3,20 @@ from rest_framework import status from django.core.cache import cache -from posthog.test.base import APIBaseTest, QueryMatchingTest +from posthog.test.base import APIBaseTest, FuzzyInt, QueryMatchingTest + +# The remote config stuff plus plugin and hog function queries +CONFIG_REFRESH_QUERY_COUNT = 5 class TestRemoteConfig(APIBaseTest, QueryMatchingTest): def setUp(self): self.client.logout() + self.team.recording_domains = ["https://*.example.com"] + self.team.session_recording_opt_in = True + self.team.save() + cache.clear() def test_missing_tokens(self): @@ -30,7 +37,8 @@ def test_invalid_tokens(self): assert response.status_code == status.HTTP_404_NOT_FOUND def test_valid_config(self): - with self.assertNumQueries(3): + # Not sure why but there is sometimes one extra query here + with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): response = self.client.get(f"/array/{self.team.api_token}/config") with self.assertNumQueries(0): @@ -49,7 +57,19 @@ def test_valid_config(self): "autocaptureExceptions": False, "analytics": {"endpoint": "/i/v0/e/"}, "elementsChainAsString": True, - "sessionRecording": False, + "sessionRecording": { + "endpoint": "/s/", + "consoleLogRecordingEnabled": True, + "recorderVersion": "v2", + "sampleRate": None, + "minimumDurationMilliseconds": None, + "linkedFlag": None, + "networkPayloadCapture": None, + "urlTriggers": [], + "urlBlocklist": [], + "eventTriggers": [], + "scriptConfig": None, + }, "surveys": [], "heatmaps": False, "defaultIdentifiedOnly": True, @@ -57,8 +77,25 @@ def test_valid_config(self): } ) + def test_different_response_for_other_domains(self): + # Not sure why but there is sometimes one extra query here + with self.assertNumQueries(FuzzyInt(CONFIG_REFRESH_QUERY_COUNT, CONFIG_REFRESH_QUERY_COUNT + 1)): + response = self.client.get(f"/array/{self.team.api_token}/config") + assert response.status_code == status.HTTP_200_OK, response.json() + assert response.json()["sessionRecording"] + + with self.assertNumQueries(0): + response = self.client.get(f"/array/{self.team.api_token}/config?domain=foo.example.com") + assert response.status_code == status.HTTP_200_OK, response.json() + assert response.json()["sessionRecording"] + + with self.assertNumQueries(0): + response = self.client.get(f"/array/{self.team.api_token}/config?domain=bar.other.com") + assert response.status_code == status.HTTP_200_OK, response.json() + assert not response.json()["sessionRecording"] + def test_valid_config_js(self): - with self.assertNumQueries(3): + with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): response = self.client.get(f"/array/{self.team.api_token}/config.js") with self.assertNumQueries(0): @@ -66,13 +103,14 @@ def test_valid_config_js(self): assert response.status_code == status.HTTP_200_OK assert response.headers["Content-Type"] == "application/javascript" + assert response.content == snapshot( - b'(function() {\n window._POSTHOG_CONFIG = {"token": "token123", "surveys": [], "heatmaps": false, "siteApps": [], "analytics": {"endpoint": "/i/v0/e/"}, "hasFeatureFlags": false, "sessionRecording": false, "captureDeadClicks": false, "capturePerformance": {"web_vitals": false, "network_timing": true, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "supportedCompression": ["gzip", "gzip-js"], "autocaptureExceptions": false, "defaultIdentifiedOnly": true, "elementsChainAsString": true};\n window._POSTHOG_JS_APPS = [];\n})();' + b'(function() {\n window._POSTHOG_CONFIG = {"token": "token123", "supportedCompression": ["gzip", "gzip-js"], "hasFeatureFlags": false, "captureDeadClicks": false, "capturePerformance": {"network_timing": true, "web_vitals": false, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "autocaptureExceptions": false, "analytics": {"endpoint": "/i/v0/e/"}, "elementsChainAsString": true, "sessionRecording": {"endpoint": "/s/", "consoleLogRecordingEnabled": true, "recorderVersion": "v2", "sampleRate": null, "minimumDurationMilliseconds": null, "linkedFlag": null, "networkPayloadCapture": null, "urlTriggers": [], "urlBlocklist": [], "eventTriggers": [], "scriptConfig": null}, "heatmaps": false, "surveys": [], "defaultIdentifiedOnly": true};\n window._POSTHOG_JS_APPS = [];\n})();' ) @patch("posthog.models.remote_config.get_array_js_content", return_value="[MOCKED_ARRAY_JS_CONTENT]") def test_valid_array_js(self, mock_get_array_js_content): - with self.assertNumQueries(3): + with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): response = self.client.get(f"/array/{self.team.api_token}/array.js") with self.assertNumQueries(0): @@ -82,14 +120,14 @@ def test_valid_array_js(self, mock_get_array_js_content): assert response.content assert response.content == snapshot( - b'\n [MOCKED_ARRAY_JS_CONTENT]\n\n (function() {\n window._POSTHOG_CONFIG = {"token": "token123", "surveys": [], "heatmaps": false, "siteApps": [], "analytics": {"endpoint": "/i/v0/e/"}, "hasFeatureFlags": false, "sessionRecording": false, "captureDeadClicks": false, "capturePerformance": {"web_vitals": false, "network_timing": true, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "supportedCompression": ["gzip", "gzip-js"], "autocaptureExceptions": false, "defaultIdentifiedOnly": true, "elementsChainAsString": true};\n window._POSTHOG_JS_APPS = [];\n})();\n ' + b'[MOCKED_ARRAY_JS_CONTENT]\n\n(function() {\n window._POSTHOG_CONFIG = {"token": "token123", "supportedCompression": ["gzip", "gzip-js"], "hasFeatureFlags": false, "captureDeadClicks": false, "capturePerformance": {"network_timing": true, "web_vitals": false, "web_vitals_allowed_metrics": null}, "autocapture_opt_out": false, "autocaptureExceptions": false, "analytics": {"endpoint": "/i/v0/e/"}, "elementsChainAsString": true, "sessionRecording": {"endpoint": "/s/", "consoleLogRecordingEnabled": true, "recorderVersion": "v2", "sampleRate": null, "minimumDurationMilliseconds": null, "linkedFlag": null, "networkPayloadCapture": null, "urlTriggers": [], "urlBlocklist": [], "eventTriggers": [], "scriptConfig": null}, "heatmaps": false, "surveys": [], "defaultIdentifiedOnly": true};\n window._POSTHOG_JS_APPS = [];\n})();' ) # NOT actually testing the content here as it will change dynamically @patch("posthog.models.remote_config.get_array_js_content", return_value="[MOCKED_ARRAY_JS_CONTENT]") def test_valid_array_uses_config_js_cache(self, mock_get_array_js_content): - with self.assertNumQueries(3): + with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): response = self.client.get(f"/array/{self.team.api_token}/config.js") with self.assertNumQueries(0): diff --git a/posthog/models/remote_config.py b/posthog/models/remote_config.py index 66b0177de8d42..51443480841fd 100644 --- a/posthog/models/remote_config.py +++ b/posthog/models/remote_config.py @@ -1,4 +1,3 @@ -from base64 import b64encode import json import os from typing import Any, Optional @@ -259,9 +258,11 @@ def _build_site_apps_js(self): f"\n{{\n id: '{site_app.token}',\n init: function(config) {{\n {indent_js(site_app.source, indent=4)}().inject({{ config:{json.dumps(config)}, posthog:config.posthog }});\n config.callback();\n }}\n}}" ) ) - site_functions = HogFunction.objects.filter( - team=self.team, enabled=True, type__in=("site_destination", "site_app") - ).all() + site_functions = ( + HogFunction.objects.select_related("team") + .filter(team=self.team, enabled=True, type__in=("site_destination", "site_app")) + .all() + ) site_functions_js = [] @@ -300,7 +301,6 @@ def _get_via_cache( REMOTE_CONFIG_CACHE_COUNTER.labels(result="miss").inc() try: remote_config = cls.objects.select_related("team").get(team__api_token=token) - print("remote_config got fresh", remote_config) except cls.DoesNotExist: cache.set(key, "404", timeout=timeout) REMOTE_CONFIG_CACHE_COUNTER.labels(result="miss_but_missing").inc() From 8ed53a78fbf8c631ad68ec0b6bcd20688bf08a8e Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:32:58 +0000 Subject: [PATCH 09/17] Update query snapshots --- .../api/test/__snapshots__/test_decide.ambr | 1827 ++++++++--------- .../test_early_access_feature.ambr | 383 ++-- .../test_organization_feature_flag.ambr | 379 ++-- 3 files changed, 1233 insertions(+), 1356 deletions(-) diff --git a/posthog/api/test/__snapshots__/test_decide.ambr b/posthog/api/test/__snapshots__/test_decide.ambr index 77eda795b2644..e0e7a8bd21b32 100644 --- a/posthog/api/test/__snapshots__/test_decide.ambr +++ b/posthog/api/test/__snapshots__/test_decide.ambr @@ -644,40 +644,9 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.26 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - ''' -# --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.27 ''' SELECT 1 AS "a" FROM "posthog_grouptypemapping" @@ -685,7 +654,7 @@ LIMIT 1 ''' # --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.28 +# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.27 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -748,7 +717,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.29 +# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.28 ''' SELECT "posthog_productintent"."id", "posthog_productintent"."team_id", @@ -762,6 +731,16 @@ WHERE "posthog_productintent"."team_id" = 99999 ''' # --- +# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.29 + ''' + SELECT "posthog_productintent"."product_type", + "posthog_productintent"."created_at", + "posthog_productintent"."onboarding_completed_at", + "posthog_productintent"."updated_at" + FROM "posthog_productintent" + WHERE "posthog_productintent"."team_id" = 99999 + ''' +# --- # name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.3 ''' SELECT "posthog_team"."id", @@ -833,16 +812,6 @@ ''' # --- # name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.30 - ''' - SELECT "posthog_productintent"."product_type", - "posthog_productintent"."created_at", - "posthog_productintent"."onboarding_completed_at", - "posthog_productintent"."updated_at" - FROM "posthog_productintent" - WHERE "posthog_productintent"."team_id" = 99999 - ''' -# --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.31 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -874,7 +843,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.32 +# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.31 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -897,6 +866,22 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- +# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.32 + ''' + SELECT "posthog_pluginconfig"."id", + "posthog_pluginconfig"."web_token", + "posthog_pluginsourcefile"."updated_at", + "posthog_plugin"."updated_at", + "posthog_pluginconfig"."updated_at" + FROM "posthog_pluginconfig" + INNER JOIN "posthog_plugin" ON ("posthog_pluginconfig"."plugin_id" = "posthog_plugin"."id") + INNER JOIN "posthog_pluginsourcefile" ON ("posthog_plugin"."id" = "posthog_pluginsourcefile"."plugin_id") + WHERE ("posthog_pluginconfig"."enabled" + AND "posthog_pluginsourcefile"."filename" = 'site.ts' + AND "posthog_pluginsourcefile"."status" = 'TRANSPILED' + AND "posthog_pluginconfig"."team_id" = 99999) + ''' +# --- # name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.33 ''' SELECT "posthog_pluginconfig"."id", @@ -1259,76 +1244,6 @@ ''' # --- # name: TestDecide.test_flag_with_behavioural_cohorts.10 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."project_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_web_vitals_opt_in", - "posthog_team"."autocapture_web_vitals_allowed_metrics", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."person_processing_opt_out", - "posthog_team"."session_recording_opt_in", - "posthog_team"."session_recording_sample_rate", - "posthog_team"."session_recording_minimum_duration_milliseconds", - "posthog_team"."session_recording_linked_flag", - "posthog_team"."session_recording_network_payload_capture_config", - "posthog_team"."session_recording_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecide.test_flag_with_behavioural_cohorts.11 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -1351,7 +1266,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.12 +# name: TestDecide.test_flag_with_behavioural_cohorts.11 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1414,7 +1329,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.13 +# name: TestDecide.test_flag_with_behavioural_cohorts.12 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -1426,7 +1341,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.14 +# name: TestDecide.test_flag_with_behavioural_cohorts.13 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1496,7 +1411,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.15 +# name: TestDecide.test_flag_with_behavioural_cohorts.14 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -1505,7 +1420,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.16 +# name: TestDecide.test_flag_with_behavioural_cohorts.15 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -1589,7 +1504,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.17 +# name: TestDecide.test_flag_with_behavioural_cohorts.16 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -1605,7 +1520,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_behavioural_cohorts.18 +# name: TestDecide.test_flag_with_behavioural_cohorts.17 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -1633,37 +1548,47 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 + ''' +# --- +# name: TestDecide.test_flag_with_behavioural_cohorts.18 + ''' + SELECT "posthog_cohort"."id", + "posthog_cohort"."name", + "posthog_cohort"."description", + "posthog_cohort"."team_id", + "posthog_cohort"."deleted", + "posthog_cohort"."filters", + "posthog_cohort"."query", + "posthog_cohort"."version", + "posthog_cohort"."pending_version", + "posthog_cohort"."count", + "posthog_cohort"."created_by_id", + "posthog_cohort"."created_at", + "posthog_cohort"."is_calculating", + "posthog_cohort"."last_calculation", + "posthog_cohort"."errors_calculating", + "posthog_cohort"."last_error_at", + "posthog_cohort"."is_static", + "posthog_cohort"."groups" + FROM "posthog_cohort" + WHERE (NOT "posthog_cohort"."deleted" + AND "posthog_cohort"."team_id" = 99999) ''' # --- # name: TestDecide.test_flag_with_behavioural_cohorts.19 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) + SELECT "posthog_group"."id", + "posthog_group"."team_id", + "posthog_group"."group_key", + "posthog_group"."group_type_index", + "posthog_group"."group_properties", + "posthog_group"."created_at", + "posthog_group"."properties_last_updated_at", + "posthog_group"."properties_last_operation", + "posthog_group"."version" + FROM "posthog_group" + WHERE "posthog_group"."team_id" = 99999 + LIMIT 21 ''' # --- # name: TestDecide.test_flag_with_behavioural_cohorts.2 @@ -1967,40 +1892,9 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestDecide.test_flag_with_behavioural_cohorts.8 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - ''' -# --- -# name: TestDecide.test_flag_with_behavioural_cohorts.9 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -2032,30 +1926,9 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts +# name: TestDecide.test_flag_with_behavioural_cohorts.9 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id", - "posthog_team"."id", + SELECT "posthog_team"."id", "posthog_team"."uuid", "posthog_team"."organization_id", "posthog_team"."project_id", @@ -2118,15 +1991,35 @@ "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_hogfunction" - INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."filters" @> '{"filter_test_accounts": true}'::jsonb) + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.1 +# name: TestDecide.test_flag_with_regular_cohorts ''' - SELECT "posthog_team"."id", + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id", + "posthog_team"."id", "posthog_team"."uuid", "posthog_team"."organization_id", "posthog_team"."project_id", @@ -2180,14 +2073,22 @@ "posthog_team"."modifiers", "posthog_team"."correlation_config", "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 + FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") + WHERE ("posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."filters" @> '{"filter_test_accounts": true}'::jsonb) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.10 +# name: TestDecide.test_flag_with_regular_cohorts.1 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2243,13 +2144,6 @@ "posthog_team"."modifiers", "posthog_team"."correlation_config", "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_team" @@ -2257,7 +2151,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.11 +# name: TestDecide.test_flag_with_regular_cohorts.10 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -2280,7 +2174,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.12 +# name: TestDecide.test_flag_with_regular_cohorts.11 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2343,7 +2237,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.13 +# name: TestDecide.test_flag_with_regular_cohorts.12 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -2355,7 +2249,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.14 +# name: TestDecide.test_flag_with_regular_cohorts.13 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2425,7 +2319,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.15 +# name: TestDecide.test_flag_with_regular_cohorts.14 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -2434,7 +2328,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.16 +# name: TestDecide.test_flag_with_regular_cohorts.15 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -2518,7 +2412,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.17 +# name: TestDecide.test_flag_with_regular_cohorts.16 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -2534,7 +2428,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecide.test_flag_with_regular_cohorts.18 +# name: TestDecide.test_flag_with_regular_cohorts.17 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -2562,37 +2456,43 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 + ''' +# --- +# name: TestDecide.test_flag_with_regular_cohorts.18 + ''' + SELECT "posthog_cohort"."id", + "posthog_cohort"."name", + "posthog_cohort"."description", + "posthog_cohort"."team_id", + "posthog_cohort"."deleted", + "posthog_cohort"."filters", + "posthog_cohort"."query", + "posthog_cohort"."version", + "posthog_cohort"."pending_version", + "posthog_cohort"."count", + "posthog_cohort"."created_by_id", + "posthog_cohort"."created_at", + "posthog_cohort"."is_calculating", + "posthog_cohort"."last_calculation", + "posthog_cohort"."errors_calculating", + "posthog_cohort"."last_error_at", + "posthog_cohort"."is_static", + "posthog_cohort"."groups" + FROM "posthog_cohort" + WHERE (NOT "posthog_cohort"."deleted" + AND "posthog_cohort"."team_id" = 99999) ''' # --- # name: TestDecide.test_flag_with_regular_cohorts.19 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) + SELECT (("posthog_person"."properties" -> '$some_prop_1') = '"something_1"'::jsonb + AND "posthog_person"."properties" ? '$some_prop_1' + AND NOT (("posthog_person"."properties" -> '$some_prop_1') = 'null'::jsonb)) AS "flag_X_condition_0" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = 'example_id_1' + AND "posthog_persondistinctid"."team_id" = 99999 + AND "posthog_person"."team_id" = 99999) ''' # --- # name: TestDecide.test_flag_with_regular_cohorts.2 @@ -2639,7 +2539,7 @@ AND NOT (("posthog_person"."properties" -> '$some_prop_1') = 'null'::jsonb)) AS "flag_X_condition_0" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'example_id_1' + WHERE ("posthog_persondistinctid"."distinct_id" = 'another_id' AND "posthog_persondistinctid"."team_id" = 99999 AND "posthog_person"."team_id" = 99999) ''' @@ -2888,40 +2788,9 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestDecide.test_flag_with_regular_cohorts.8 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - ''' -# --- -# name: TestDecide.test_flag_with_regular_cohorts.9 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -2953,6 +2822,76 @@ LIMIT 21 ''' # --- +# name: TestDecide.test_flag_with_regular_cohorts.9 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 + ''' +# --- # name: TestDecide.test_web_app_queries ''' SELECT "posthog_team"."id", @@ -3083,40 +3022,9 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestDecide.test_web_app_queries.12 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - ''' -# --- -# name: TestDecide.test_web_app_queries.13 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3179,7 +3087,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_web_app_queries.14 +# name: TestDecide.test_web_app_queries.13 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -3191,7 +3099,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_web_app_queries.15 +# name: TestDecide.test_web_app_queries.14 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3261,7 +3169,7 @@ LIMIT 21 ''' # --- -# name: TestDecide.test_web_app_queries.16 +# name: TestDecide.test_web_app_queries.15 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -3270,7 +3178,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecide.test_web_app_queries.17 +# name: TestDecide.test_web_app_queries.16 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -3354,7 +3262,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecide.test_web_app_queries.18 +# name: TestDecide.test_web_app_queries.17 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginconfig"."web_token", @@ -3370,7 +3278,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecide.test_web_app_queries.19 +# name: TestDecide.test_web_app_queries.18 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -3386,23 +3294,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecide.test_web_app_queries.2 - ''' - SELECT "posthog_pluginconfig"."id", - "posthog_pluginconfig"."web_token", - "posthog_pluginsourcefile"."updated_at", - "posthog_plugin"."updated_at", - "posthog_pluginconfig"."updated_at" - FROM "posthog_pluginconfig" - INNER JOIN "posthog_plugin" ON ("posthog_pluginconfig"."plugin_id" = "posthog_plugin"."id") - INNER JOIN "posthog_pluginsourcefile" ON ("posthog_plugin"."id" = "posthog_pluginsourcefile"."plugin_id") - WHERE ("posthog_pluginconfig"."enabled" - AND "posthog_pluginsourcefile"."filename" = 'site.ts' - AND "posthog_pluginsourcefile"."status" = 'TRANSPILED' - AND "posthog_pluginconfig"."team_id" = 99999) - ''' -# --- -# name: TestDecide.test_web_app_queries.20 +# name: TestDecide.test_web_app_queries.19 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -3430,37 +3322,54 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 + ''' +# --- +# name: TestDecide.test_web_app_queries.2 + ''' + SELECT "posthog_pluginconfig"."id", + "posthog_pluginconfig"."web_token", + "posthog_pluginsourcefile"."updated_at", + "posthog_plugin"."updated_at", + "posthog_pluginconfig"."updated_at" + FROM "posthog_pluginconfig" + INNER JOIN "posthog_plugin" ON ("posthog_pluginconfig"."plugin_id" = "posthog_plugin"."id") + INNER JOIN "posthog_pluginsourcefile" ON ("posthog_plugin"."id" = "posthog_pluginsourcefile"."plugin_id") + WHERE ("posthog_pluginconfig"."enabled" + AND "posthog_pluginsourcefile"."filename" = 'site.ts' + AND "posthog_pluginsourcefile"."status" = 'TRANSPILED' + AND "posthog_pluginconfig"."team_id" = 99999) + ''' +# --- +# name: TestDecide.test_web_app_queries.20 + ''' + SELECT "posthog_pluginconfig"."id", + "posthog_pluginconfig"."web_token", + "posthog_pluginsourcefile"."updated_at", + "posthog_plugin"."updated_at", + "posthog_pluginconfig"."updated_at" + FROM "posthog_pluginconfig" + INNER JOIN "posthog_plugin" ON ("posthog_pluginconfig"."plugin_id" = "posthog_plugin"."id") + INNER JOIN "posthog_pluginsourcefile" ON ("posthog_plugin"."id" = "posthog_pluginsourcefile"."plugin_id") + WHERE ("posthog_pluginconfig"."enabled" + AND "posthog_pluginsourcefile"."filename" = 'site.ts' + AND "posthog_pluginsourcefile"."status" = 'TRANSPILED' + AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- # name: TestDecide.test_web_app_queries.21 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) + SELECT "posthog_pluginconfig"."id", + "posthog_pluginconfig"."web_token", + "posthog_pluginsourcefile"."updated_at", + "posthog_plugin"."updated_at", + "posthog_pluginconfig"."updated_at" + FROM "posthog_pluginconfig" + INNER JOIN "posthog_plugin" ON ("posthog_pluginconfig"."plugin_id" = "posthog_plugin"."id") + INNER JOIN "posthog_pluginsourcefile" ON ("posthog_plugin"."id" = "posthog_pluginsourcefile"."plugin_id") + WHERE ("posthog_pluginconfig"."enabled" + AND "posthog_pluginsourcefile"."filename" = 'site.ts' + AND "posthog_pluginsourcefile"."status" = 'TRANSPILED' + AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- # name: TestDecide.test_web_app_queries.22 @@ -4486,40 +4395,9 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.26 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - ''' -# --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.27 ''' SELECT 1 AS "a" FROM "posthog_grouptypemapping" @@ -4527,7 +4405,7 @@ LIMIT 1 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.28 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.27 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -4590,7 +4468,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.29 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.28 ''' SELECT "posthog_productintent"."id", "posthog_productintent"."team_id", @@ -4604,6 +4482,16 @@ WHERE "posthog_productintent"."team_id" = 99999 ''' # --- +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.29 + ''' + SELECT "posthog_productintent"."product_type", + "posthog_productintent"."created_at", + "posthog_productintent"."onboarding_completed_at", + "posthog_productintent"."updated_at" + FROM "posthog_productintent" + WHERE "posthog_productintent"."team_id" = 99999 + ''' +# --- # name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.3 ''' SELECT "posthog_team"."id", @@ -4675,16 +4563,6 @@ ''' # --- # name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.30 - ''' - SELECT "posthog_productintent"."product_type", - "posthog_productintent"."created_at", - "posthog_productintent"."onboarding_completed_at", - "posthog_productintent"."updated_at" - FROM "posthog_productintent" - WHERE "posthog_productintent"."team_id" = 99999 - ''' -# --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.31 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -4716,7 +4594,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.32 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.31 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -4728,7 +4606,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.33 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.32 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -4798,7 +4676,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.34 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.33 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -4807,7 +4685,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.35 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.34 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -4891,7 +4769,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.36 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.35 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginconfig"."web_token", @@ -4907,7 +4785,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.37 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.36 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -4923,7 +4801,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.38 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.37 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -4951,47 +4829,51 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.39 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.38 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) + SELECT "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_featureflag" + WHERE ("posthog_featureflag"."active" + AND NOT "posthog_featureflag"."deleted" + AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.4 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.39 ''' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.4 + ''' + SELECT "posthog_organizationmembership"."id", + "posthog_organizationmembership"."organization_id", + "posthog_organizationmembership"."user_id", + "posthog_organizationmembership"."level", + "posthog_organizationmembership"."joined_at", + "posthog_organizationmembership"."updated_at", "posthog_organization"."id", "posthog_organization"."name", "posthog_organization"."slug", @@ -5019,41 +4901,6 @@ ''' # --- # name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.40 - ''' - SELECT "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_featureflag" - WHERE ("posthog_featureflag"."active" - AND NOT "posthog_featureflag"."deleted" - AND "posthog_featureflag"."team_id" = 99999) - ''' -# --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.41 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.42 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -5123,7 +4970,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.43 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.41 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -5132,7 +4979,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.44 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.42 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -5216,7 +5063,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.45 +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.43 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginconfig"."web_token", @@ -5232,6 +5079,52 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.44 + ''' + SELECT "posthog_pluginconfig"."id", + "posthog_pluginsourcefile"."transpiled", + "posthog_pluginconfig"."web_token", + "posthog_plugin"."config_schema", + "posthog_pluginconfig"."config" + FROM "posthog_pluginconfig" + INNER JOIN "posthog_plugin" ON ("posthog_pluginconfig"."plugin_id" = "posthog_plugin"."id") + INNER JOIN "posthog_pluginsourcefile" ON ("posthog_plugin"."id" = "posthog_pluginsourcefile"."plugin_id") + WHERE ("posthog_pluginconfig"."enabled" + AND "posthog_pluginsourcefile"."filename" = 'site.ts' + AND "posthog_pluginsourcefile"."status" = 'TRANSPILED' + AND "posthog_pluginconfig"."team_id" = 99999) + ''' +# --- +# name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.45 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- # name: TestDecideRemoteConfig.test_decide_doesnt_error_out_when_database_is_down.46 ''' SELECT "posthog_pluginconfig"."id", @@ -5621,76 +5514,6 @@ ''' # --- # name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.10 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."project_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_web_vitals_opt_in", - "posthog_team"."autocapture_web_vitals_allowed_metrics", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."person_processing_opt_out", - "posthog_team"."session_recording_opt_in", - "posthog_team"."session_recording_sample_rate", - "posthog_team"."session_recording_minimum_duration_milliseconds", - "posthog_team"."session_recording_linked_flag", - "posthog_team"."session_recording_network_payload_capture_config", - "posthog_team"."session_recording_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.11 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -5713,7 +5536,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.12 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.11 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -5776,7 +5599,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.13 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.12 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -5788,7 +5611,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.14 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.13 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -5858,7 +5681,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.15 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.14 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -5867,7 +5690,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.16 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.15 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -5951,7 +5774,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.17 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.16 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -5967,38 +5790,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.18 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.19 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.17 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -6028,19 +5820,7 @@ 'site_app')) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.2 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.20 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.18 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -6052,7 +5832,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.21 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.19 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -6122,7 +5902,19 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.22 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.2 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.20 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -6131,7 +5923,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.23 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.21 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -6215,7 +6007,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.24 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.22 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -6231,38 +6023,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.25 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.26 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.23 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -6292,7 +6053,7 @@ 'site_app')) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.27 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.24 ''' SELECT "posthog_cohort"."id", "posthog_cohort"."name", @@ -6317,7 +6078,7 @@ AND "posthog_cohort"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.28 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.25 ''' SELECT "posthog_group"."id", "posthog_group"."team_id", @@ -6333,7 +6094,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.29 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.26 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -6345,77 +6106,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.3 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."project_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_web_vitals_opt_in", - "posthog_team"."autocapture_web_vitals_allowed_metrics", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."person_processing_opt_out", - "posthog_team"."session_recording_opt_in", - "posthog_team"."session_recording_sample_rate", - "posthog_team"."session_recording_minimum_duration_milliseconds", - "posthog_team"."session_recording_linked_flag", - "posthog_team"."session_recording_network_payload_capture_config", - "posthog_team"."session_recording_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.30 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.27 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -6485,7 +6176,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.31 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.28 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -6494,7 +6185,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.32 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.29 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -6578,7 +6269,77 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.33 +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.3 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.30 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -6594,6 +6355,77 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.31 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.32 + ''' + SELECT "posthog_cohort"."id", + "posthog_cohort"."name", + "posthog_cohort"."description", + "posthog_cohort"."team_id", + "posthog_cohort"."deleted", + "posthog_cohort"."filters", + "posthog_cohort"."query", + "posthog_cohort"."version", + "posthog_cohort"."pending_version", + "posthog_cohort"."count", + "posthog_cohort"."created_by_id", + "posthog_cohort"."created_at", + "posthog_cohort"."is_calculating", + "posthog_cohort"."last_calculation", + "posthog_cohort"."errors_calculating", + "posthog_cohort"."last_error_at", + "posthog_cohort"."is_static", + "posthog_cohort"."groups" + FROM "posthog_cohort" + WHERE (NOT "posthog_cohort"."deleted" + AND "posthog_cohort"."team_id" = 99999) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.33 + ''' + SELECT "posthog_group"."id", + "posthog_group"."team_id", + "posthog_group"."group_key", + "posthog_group"."group_type_index", + "posthog_group"."group_properties", + "posthog_group"."created_at", + "posthog_group"."properties_last_updated_at", + "posthog_group"."properties_last_operation", + "posthog_group"."version" + FROM "posthog_group" + WHERE "posthog_group"."team_id" = 99999 + LIMIT 21 + ''' +# --- # name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.34 ''' SELECT "posthog_hogfunction"."id", @@ -6833,40 +6665,9 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.8 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.9 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -6898,30 +6699,9 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts +# name: TestDecideRemoteConfig.test_flag_with_behavioural_cohorts.9 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id", - "posthog_team"."id", + SELECT "posthog_team"."id", "posthog_team"."uuid", "posthog_team"."organization_id", "posthog_team"."project_id", @@ -6984,15 +6764,35 @@ "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_hogfunction" - INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."filters" @> '{"filter_test_accounts": true}'::jsonb) + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.1 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts ''' - SELECT "posthog_team"."id", + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id", + "posthog_team"."id", "posthog_team"."uuid", "posthog_team"."organization_id", "posthog_team"."project_id", @@ -7046,14 +6846,22 @@ "posthog_team"."modifiers", "posthog_team"."correlation_config", "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 + FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") + WHERE ("posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."filters" @> '{"filter_test_accounts": true}'::jsonb) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.10 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.1 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -7109,13 +6917,6 @@ "posthog_team"."modifiers", "posthog_team"."correlation_config", "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", "posthog_team"."external_data_workspace_id", "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_team" @@ -7123,7 +6924,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.11 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.10 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -7146,7 +6947,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.12 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.11 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -7209,7 +7010,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.13 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.12 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -7221,7 +7022,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.14 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.13 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -7291,7 +7092,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.15 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.14 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -7300,7 +7101,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.16 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.15 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -7384,7 +7185,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.17 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.16 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -7400,38 +7201,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.18 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.19 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.17 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -7461,19 +7231,7 @@ 'site_app')) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.2 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.20 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.18 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -7485,7 +7243,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.21 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.19 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -7555,7 +7313,19 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.22 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.2 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.20 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -7564,7 +7334,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.23 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.21 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -7648,7 +7418,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.24 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.22 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -7664,38 +7434,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.25 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.26 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.23 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -7725,7 +7464,7 @@ 'site_app')) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.27 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.24 ''' SELECT "posthog_cohort"."id", "posthog_cohort"."name", @@ -7750,7 +7489,7 @@ AND "posthog_cohort"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.28 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.25 ''' SELECT (("posthog_person"."properties" -> '$some_prop_1') = '"something_1"'::jsonb AND "posthog_person"."properties" ? '$some_prop_1' @@ -7762,7 +7501,7 @@ AND "posthog_person"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.29 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.26 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -7774,7 +7513,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.3 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.27 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -7844,77 +7583,7 @@ LIMIT 21 ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.30 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."project_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_web_vitals_opt_in", - "posthog_team"."autocapture_web_vitals_allowed_metrics", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."person_processing_opt_out", - "posthog_team"."session_recording_opt_in", - "posthog_team"."session_recording_sample_rate", - "posthog_team"."session_recording_minimum_duration_milliseconds", - "posthog_team"."session_recording_linked_flag", - "posthog_team"."session_recording_network_payload_capture_config", - "posthog_team"."session_recording_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.31 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.28 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -7923,7 +7592,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.32 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.29 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -8007,7 +7676,77 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.33 +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.3 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.30 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -8023,6 +7762,73 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.31 + ''' + SELECT "posthog_hogfunction"."id", + "posthog_hogfunction"."team_id", + "posthog_hogfunction"."name", + "posthog_hogfunction"."description", + "posthog_hogfunction"."created_at", + "posthog_hogfunction"."created_by_id", + "posthog_hogfunction"."deleted", + "posthog_hogfunction"."updated_at", + "posthog_hogfunction"."enabled", + "posthog_hogfunction"."type", + "posthog_hogfunction"."icon_url", + "posthog_hogfunction"."hog", + "posthog_hogfunction"."bytecode", + "posthog_hogfunction"."transpiled", + "posthog_hogfunction"."inputs_schema", + "posthog_hogfunction"."inputs", + "posthog_hogfunction"."encrypted_inputs", + "posthog_hogfunction"."filters", + "posthog_hogfunction"."mappings", + "posthog_hogfunction"."masking", + "posthog_hogfunction"."template_id" + FROM "posthog_hogfunction" + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.32 + ''' + SELECT "posthog_cohort"."id", + "posthog_cohort"."name", + "posthog_cohort"."description", + "posthog_cohort"."team_id", + "posthog_cohort"."deleted", + "posthog_cohort"."filters", + "posthog_cohort"."query", + "posthog_cohort"."version", + "posthog_cohort"."pending_version", + "posthog_cohort"."count", + "posthog_cohort"."created_by_id", + "posthog_cohort"."created_at", + "posthog_cohort"."is_calculating", + "posthog_cohort"."last_calculation", + "posthog_cohort"."errors_calculating", + "posthog_cohort"."last_error_at", + "posthog_cohort"."is_static", + "posthog_cohort"."groups" + FROM "posthog_cohort" + WHERE (NOT "posthog_cohort"."deleted" + AND "posthog_cohort"."team_id" = 99999) + ''' +# --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.33 + ''' + SELECT (("posthog_person"."properties" -> '$some_prop_1') = '"something_1"'::jsonb + AND "posthog_person"."properties" ? '$some_prop_1' + AND NOT (("posthog_person"."properties" -> '$some_prop_1') = 'null'::jsonb)) AS "flag_X_condition_0" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = 'another_id' + AND "posthog_persondistinctid"."team_id" = 99999 + AND "posthog_person"."team_id" = 99999) + ''' +# --- # name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.34 ''' SELECT "posthog_hogfunction"."id", @@ -8258,40 +8064,9 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.8 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - ''' -# --- -# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.9 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -8323,3 +8098,73 @@ LIMIT 21 ''' # --- +# name: TestDecideRemoteConfig.test_flag_with_regular_cohorts.9 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 + ''' +# --- diff --git a/posthog/api/test/__snapshots__/test_early_access_feature.ambr b/posthog/api/test/__snapshots__/test_early_access_feature.ambr index 723eb1f79311a..cbd767538cbc5 100644 --- a/posthog/api/test/__snapshots__/test_early_access_feature.ambr +++ b/posthog/api/test/__snapshots__/test_early_access_feature.ambr @@ -93,29 +93,6 @@ ''' # --- # name: TestPreviewList.test_early_access_features.10 - ''' - SELECT "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_featureflag" - WHERE ("posthog_featureflag"."active" - AND NOT "posthog_featureflag"."deleted" - AND "posthog_featureflag"."team_id" = 99999) - ''' -# --- -# name: TestPreviewList.test_early_access_features.11 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -178,7 +155,7 @@ LIMIT 21 ''' # --- -# name: TestPreviewList.test_early_access_features.12 +# name: TestPreviewList.test_early_access_features.11 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -190,7 +167,7 @@ LIMIT 21 ''' # --- -# name: TestPreviewList.test_early_access_features.13 +# name: TestPreviewList.test_early_access_features.12 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -260,7 +237,7 @@ LIMIT 21 ''' # --- -# name: TestPreviewList.test_early_access_features.14 +# name: TestPreviewList.test_early_access_features.13 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -269,7 +246,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestPreviewList.test_early_access_features.15 +# name: TestPreviewList.test_early_access_features.14 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -353,7 +330,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestPreviewList.test_early_access_features.16 +# name: TestPreviewList.test_early_access_features.15 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -369,38 +346,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestPreviewList.test_early_access_features.17 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - LIMIT 21 - ''' -# --- -# name: TestPreviewList.test_early_access_features.18 +# name: TestPreviewList.test_early_access_features.16 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -430,7 +376,7 @@ 'site_app')) ''' # --- -# name: TestPreviewList.test_early_access_features.19 +# name: TestPreviewList.test_early_access_features.17 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -462,6 +408,101 @@ LIMIT 21 ''' # --- +# name: TestPreviewList.test_early_access_features.18 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."api_token" = 'token123' + LIMIT 21 + ''' +# --- +# name: TestPreviewList.test_early_access_features.19 + ''' + SELECT "posthog_earlyaccessfeature"."id", + "posthog_earlyaccessfeature"."team_id", + "posthog_earlyaccessfeature"."feature_flag_id", + "posthog_earlyaccessfeature"."name", + "posthog_earlyaccessfeature"."description", + "posthog_earlyaccessfeature"."stage", + "posthog_earlyaccessfeature"."documentation_url", + "posthog_earlyaccessfeature"."created_at", + "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_earlyaccessfeature" + INNER JOIN "posthog_team" ON ("posthog_earlyaccessfeature"."team_id" = "posthog_team"."id") + LEFT OUTER JOIN "posthog_featureflag" ON ("posthog_earlyaccessfeature"."feature_flag_id" = "posthog_featureflag"."id") + WHERE ("posthog_earlyaccessfeature"."stage" = 'beta' + AND "posthog_team"."project_id" = 99999) + ''' +# --- # name: TestPreviewList.test_early_access_features.2 ''' SELECT "posthog_team"."id", @@ -839,37 +880,29 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestPreviewList.test_early_access_features.9 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) + SELECT "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_featureflag" + WHERE ("posthog_featureflag"."active" + AND NOT "posthog_featureflag"."deleted" + AND "posthog_featureflag"."team_id" = 99999) ''' # --- # name: TestPreviewList.test_early_access_features_with_cached_team @@ -1006,36 +1039,6 @@ ''' # --- # name: TestPreviewList.test_early_access_features_with_cached_team.10 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - ''' -# --- -# name: TestPreviewList.test_early_access_features_with_cached_team.11 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -1067,6 +1070,38 @@ LIMIT 21 ''' # --- +# name: TestPreviewList.test_early_access_features_with_cached_team.11 + ''' + SELECT "posthog_earlyaccessfeature"."id", + "posthog_earlyaccessfeature"."team_id", + "posthog_earlyaccessfeature"."feature_flag_id", + "posthog_earlyaccessfeature"."name", + "posthog_earlyaccessfeature"."description", + "posthog_earlyaccessfeature"."stage", + "posthog_earlyaccessfeature"."documentation_url", + "posthog_earlyaccessfeature"."created_at", + "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_earlyaccessfeature" + INNER JOIN "posthog_team" ON ("posthog_earlyaccessfeature"."team_id" = "posthog_team"."id") + LEFT OUTER JOIN "posthog_featureflag" ON ("posthog_earlyaccessfeature"."feature_flag_id" = "posthog_featureflag"."id") + WHERE ("posthog_earlyaccessfeature"."stage" = 'beta' + AND "posthog_team"."project_id" = 99999) + ''' +# --- # name: TestPreviewList.test_early_access_features_with_cached_team.12 ''' SELECT "posthog_earlyaccessfeature"."id", @@ -1404,7 +1439,6 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestPreviewList.test_early_access_features_with_pre_env_cached_team @@ -1502,34 +1536,34 @@ # --- # name: TestPreviewList.test_early_access_features_with_pre_env_cached_team.10 ''' - SELECT "posthog_user"."id", - "posthog_user"."password", - "posthog_user"."last_login", - "posthog_user"."first_name", - "posthog_user"."last_name", - "posthog_user"."is_staff", - "posthog_user"."date_joined", - "posthog_user"."uuid", - "posthog_user"."current_organization_id", - "posthog_user"."current_team_id", - "posthog_user"."email", - "posthog_user"."pending_email", - "posthog_user"."temporary_token", - "posthog_user"."distinct_id", - "posthog_user"."is_email_verified", - "posthog_user"."has_seen_product_intro_for", - "posthog_user"."strapi_id", - "posthog_user"."is_active", - "posthog_user"."theme_mode", - "posthog_user"."partial_notification_settings", - "posthog_user"."anonymize_data", - "posthog_user"."toolbar_mode", - "posthog_user"."hedgehog_config", - "posthog_user"."events_column_config", - "posthog_user"."email_opt_in" - FROM "posthog_user" - WHERE "posthog_user"."id" = 99999 - LIMIT 21 + SELECT "posthog_earlyaccessfeature"."id", + "posthog_earlyaccessfeature"."team_id", + "posthog_earlyaccessfeature"."feature_flag_id", + "posthog_earlyaccessfeature"."name", + "posthog_earlyaccessfeature"."description", + "posthog_earlyaccessfeature"."stage", + "posthog_earlyaccessfeature"."documentation_url", + "posthog_earlyaccessfeature"."created_at", + "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_earlyaccessfeature" + INNER JOIN "posthog_team" ON ("posthog_earlyaccessfeature"."team_id" = "posthog_team"."id") + LEFT OUTER JOIN "posthog_featureflag" ON ("posthog_earlyaccessfeature"."feature_flag_id" = "posthog_featureflag"."id") + WHERE ("posthog_earlyaccessfeature"."stage" = 'beta' + AND "posthog_team"."project_id" = 99999) ''' # --- # name: TestPreviewList.test_early_access_features_with_pre_env_cached_team.11 @@ -1846,36 +1880,37 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestPreviewList.test_early_access_features_with_pre_env_cached_team.9 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) + SELECT "posthog_user"."id", + "posthog_user"."password", + "posthog_user"."last_login", + "posthog_user"."first_name", + "posthog_user"."last_name", + "posthog_user"."is_staff", + "posthog_user"."date_joined", + "posthog_user"."uuid", + "posthog_user"."current_organization_id", + "posthog_user"."current_team_id", + "posthog_user"."email", + "posthog_user"."pending_email", + "posthog_user"."temporary_token", + "posthog_user"."distinct_id", + "posthog_user"."is_email_verified", + "posthog_user"."has_seen_product_intro_for", + "posthog_user"."strapi_id", + "posthog_user"."is_active", + "posthog_user"."theme_mode", + "posthog_user"."partial_notification_settings", + "posthog_user"."anonymize_data", + "posthog_user"."toolbar_mode", + "posthog_user"."hedgehog_config", + "posthog_user"."events_column_config", + "posthog_user"."email_opt_in" + FROM "posthog_user" + WHERE "posthog_user"."id" = 99999 + LIMIT 21 ''' # --- diff --git a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr index 9411bca7e53a2..573656301bd39 100644 --- a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr +++ b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr @@ -362,40 +362,9 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.18 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - ''' -# --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.19 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -465,16 +434,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.2 - ''' - SELECT 1 AS "a" - FROM "posthog_organizationmembership" - WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid - AND "posthog_organizationmembership"."user_id" = 99999) - LIMIT 1 - ''' -# --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.20 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.19 ''' SELECT "posthog_dashboardtile"."id" FROM "posthog_dashboardtile" @@ -485,7 +445,16 @@ AND "posthog_dashboardtile"."dashboard_id" = 99999) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.21 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.2 + ''' + SELECT 1 AS "a" + FROM "posthog_organizationmembership" + WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid + AND "posthog_organizationmembership"."user_id" = 99999) + LIMIT 1 + ''' +# --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.20 ''' SELECT "posthog_organization"."id", "posthog_organization"."name", @@ -511,7 +480,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.22 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.21 ''' SELECT "posthog_dashboardtile"."id" FROM "posthog_dashboardtile" @@ -522,7 +491,7 @@ AND "posthog_dashboardtile"."dashboard_id" = 99999) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.23 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.22 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -585,7 +554,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.24 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.23 ''' SELECT "posthog_dashboarditem"."id", "posthog_dashboarditem"."name", @@ -620,7 +589,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.25 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.24 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -690,7 +659,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.26 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.25 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -753,7 +722,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.27 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.26 ''' SELECT "posthog_dashboardtile"."id", "posthog_dashboardtile"."dashboard_id", @@ -771,7 +740,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.28 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.27 ''' SELECT "posthog_dashboarditem"."id", "posthog_dashboarditem"."name", @@ -806,7 +775,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.29 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.28 ''' SELECT "posthog_dashboard"."id", "posthog_dashboard"."name", @@ -830,31 +799,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.3 - ''' - SELECT "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_featureflag" - INNER JOIN "posthog_team" ON ("posthog_featureflag"."team_id" = "posthog_team"."id") - WHERE ("posthog_featureflag"."key" = 'copied-flag-key' - AND "posthog_team"."project_id" = 99999) - LIMIT 21 - ''' -# --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.30 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.29 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -924,7 +869,31 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.31 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.3 + ''' + SELECT "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_featureflag" + INNER JOIN "posthog_team" ON ("posthog_featureflag"."team_id" = "posthog_team"."id") + WHERE ("posthog_featureflag"."key" = 'copied-flag-key' + AND "posthog_team"."project_id" = 99999) + LIMIT 21 + ''' +# --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.30 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -987,7 +956,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.32 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.31 ''' SELECT "posthog_dashboarditem"."id", "posthog_dashboarditem"."name", @@ -1022,7 +991,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.33 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.32 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1092,7 +1061,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.34 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.33 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1155,7 +1124,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.35 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.34 ''' SELECT "posthog_dashboardtile"."id", "posthog_dashboardtile"."dashboard_id", @@ -1173,7 +1142,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.36 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.35 ''' SELECT "posthog_dashboarditem"."id", "posthog_dashboarditem"."name", @@ -1208,7 +1177,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.37 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.36 ''' SELECT "posthog_dashboard"."id", "posthog_dashboard"."name", @@ -1232,7 +1201,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.38 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.37 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1302,7 +1271,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.39 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.38 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -1325,33 +1294,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.4 - ''' - SELECT "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."logo_media_id", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."is_hipaa", - "posthog_organization"."customer_id", - "posthog_organization"."available_product_features", - "posthog_organization"."usage", - "posthog_organization"."never_drop_data", - "posthog_organization"."customer_trust_scores", - "posthog_organization"."setup_section_2_completed", - "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organization" - WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid - LIMIT 21 - ''' -# --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.40 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.39 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1414,7 +1357,33 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.41 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.4 + ''' + SELECT "posthog_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."logo_media_id", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + FROM "posthog_organization" + WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid + LIMIT 21 + ''' +# --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.40 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -1426,7 +1395,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.42 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.41 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1496,7 +1465,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.43 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.42 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -1505,7 +1474,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.44 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.43 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -1589,7 +1558,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.45 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.44 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -1605,38 +1574,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.46 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - LIMIT 21 - ''' -# --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.47 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.45 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -1666,7 +1604,7 @@ 'site_app')) ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.48 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.46 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1736,7 +1674,7 @@ LIMIT 21 ''' # --- -# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.49 +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.47 ''' SELECT "posthog_experiment"."id", "posthog_experiment"."name", @@ -1762,6 +1700,55 @@ WHERE "posthog_experiment"."feature_flag_id" = 99999 ''' # --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.48 + ''' + SELECT "posthog_survey"."id", + "posthog_survey"."team_id", + "posthog_survey"."name", + "posthog_survey"."description", + "posthog_survey"."linked_flag_id", + "posthog_survey"."targeting_flag_id", + "posthog_survey"."internal_targeting_flag_id", + "posthog_survey"."internal_response_sampling_flag_id", + "posthog_survey"."type", + "posthog_survey"."conditions", + "posthog_survey"."questions", + "posthog_survey"."appearance", + "posthog_survey"."created_at", + "posthog_survey"."created_by_id", + "posthog_survey"."start_date", + "posthog_survey"."end_date", + "posthog_survey"."updated_at", + "posthog_survey"."archived", + "posthog_survey"."responses_limit", + "posthog_survey"."response_sampling_start_date", + "posthog_survey"."response_sampling_interval_type", + "posthog_survey"."response_sampling_interval", + "posthog_survey"."response_sampling_limit", + "posthog_survey"."response_sampling_daily_limits", + "posthog_survey"."iteration_count", + "posthog_survey"."iteration_frequency_days", + "posthog_survey"."iteration_start_dates", + "posthog_survey"."current_iteration", + "posthog_survey"."current_iteration_start_date" + FROM "posthog_survey" + WHERE "posthog_survey"."linked_flag_id" = 99999 + ''' +# --- +# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.49 + ''' + SELECT "posthog_earlyaccessfeature"."id", + "posthog_earlyaccessfeature"."team_id", + "posthog_earlyaccessfeature"."feature_flag_id", + "posthog_earlyaccessfeature"."name", + "posthog_earlyaccessfeature"."description", + "posthog_earlyaccessfeature"."stage", + "posthog_earlyaccessfeature"."documentation_url", + "posthog_earlyaccessfeature"."created_at" + FROM "posthog_earlyaccessfeature" + WHERE "posthog_earlyaccessfeature"."feature_flag_id" = 99999 + ''' +# --- # name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.5 ''' SELECT "posthog_team"."id", @@ -1828,51 +1815,61 @@ # --- # name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.50 ''' - SELECT "posthog_survey"."id", - "posthog_survey"."team_id", - "posthog_survey"."name", - "posthog_survey"."description", - "posthog_survey"."linked_flag_id", - "posthog_survey"."targeting_flag_id", - "posthog_survey"."internal_targeting_flag_id", - "posthog_survey"."internal_response_sampling_flag_id", - "posthog_survey"."type", - "posthog_survey"."conditions", - "posthog_survey"."questions", - "posthog_survey"."appearance", - "posthog_survey"."created_at", - "posthog_survey"."created_by_id", - "posthog_survey"."start_date", - "posthog_survey"."end_date", - "posthog_survey"."updated_at", - "posthog_survey"."archived", - "posthog_survey"."responses_limit", - "posthog_survey"."response_sampling_start_date", - "posthog_survey"."response_sampling_interval_type", - "posthog_survey"."response_sampling_interval", - "posthog_survey"."response_sampling_limit", - "posthog_survey"."response_sampling_daily_limits", - "posthog_survey"."iteration_count", - "posthog_survey"."iteration_frequency_days", - "posthog_survey"."iteration_start_dates", - "posthog_survey"."current_iteration", - "posthog_survey"."current_iteration_start_date" - FROM "posthog_survey" - WHERE "posthog_survey"."linked_flag_id" = 99999 + SELECT "posthog_organizationmembership"."id", + "posthog_organizationmembership"."organization_id", + "posthog_organizationmembership"."user_id", + "posthog_organizationmembership"."level", + "posthog_organizationmembership"."joined_at", + "posthog_organizationmembership"."updated_at", + "posthog_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."logo_media_id", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."is_hipaa", + "posthog_organization"."customer_id", + "posthog_organization"."available_product_features", + "posthog_organization"."usage", + "posthog_organization"."never_drop_data", + "posthog_organization"."customer_trust_scores", + "posthog_organization"."setup_section_2_completed", + "posthog_organization"."personalization", + "posthog_organization"."domain_whitelist" + FROM "posthog_organizationmembership" + INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id") + WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid + AND "posthog_organizationmembership"."user_id" = 99999) + LIMIT 21 ''' # --- # name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.51 ''' - SELECT "posthog_earlyaccessfeature"."id", - "posthog_earlyaccessfeature"."team_id", - "posthog_earlyaccessfeature"."feature_flag_id", - "posthog_earlyaccessfeature"."name", - "posthog_earlyaccessfeature"."description", - "posthog_earlyaccessfeature"."stage", - "posthog_earlyaccessfeature"."documentation_url", - "posthog_earlyaccessfeature"."created_at" - FROM "posthog_earlyaccessfeature" - WHERE "posthog_earlyaccessfeature"."feature_flag_id" = 99999 + SELECT "posthog_dashboard"."id", + "posthog_dashboard"."name", + "posthog_dashboard"."description", + "posthog_dashboard"."team_id", + "posthog_dashboard"."pinned", + "posthog_dashboard"."created_at", + "posthog_dashboard"."created_by_id", + "posthog_dashboard"."deleted", + "posthog_dashboard"."last_accessed_at", + "posthog_dashboard"."filters", + "posthog_dashboard"."variables", + "posthog_dashboard"."creation_mode", + "posthog_dashboard"."restriction_level", + "posthog_dashboard"."deprecated_tags", + "posthog_dashboard"."tags", + "posthog_dashboard"."share_token", + "posthog_dashboard"."is_shared" + FROM "posthog_dashboard" + INNER JOIN "posthog_featureflagdashboards" ON ("posthog_dashboard"."id" = "posthog_featureflagdashboards"."dashboard_id") + WHERE (NOT ("posthog_dashboard"."deleted") + AND "posthog_featureflagdashboards"."feature_flag_id" = 99999) ''' # --- # name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.52 From 2c951c1e20006312f943f259584629b667e4d44d Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:36:25 +0000 Subject: [PATCH 10/17] Update query snapshots --- .../test_process_scheduled_changes.ambr | 411 ++++++++---------- .../test/__snapshots__/test_feature_flag.ambr | 351 ++++++--------- 2 files changed, 329 insertions(+), 433 deletions(-) diff --git a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr index a270d8c0f291e..8da455c771a5b 100644 --- a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr +++ b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr @@ -86,28 +86,6 @@ ''' # --- # name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.10 - ''' - SELECT "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_featureflag" - WHERE "posthog_featureflag"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.11 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -140,7 +118,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.12 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.11 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -163,7 +141,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.13 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.12 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -226,7 +204,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.14 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.13 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -238,7 +216,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.15 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.14 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -308,7 +286,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.16 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.15 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -317,7 +295,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.17 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.16 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -401,7 +379,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.18 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.17 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -417,50 +395,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.19 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - LIMIT 21 - ''' -# --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.2 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.20 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.18 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -490,7 +425,7 @@ 'site_app')) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.21 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.19 ''' SELECT "posthog_organization"."id", "posthog_organization"."name", @@ -516,7 +451,19 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.22 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.2 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.20 ''' SELECT "posthog_experiment"."id", "posthog_experiment"."name", @@ -542,7 +489,7 @@ WHERE "posthog_experiment"."feature_flag_id" = 99999 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.23 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.21 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -612,7 +559,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.24 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.22 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -634,7 +581,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.25 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.23 ''' SELECT "posthog_user"."id", "posthog_user"."password", @@ -667,7 +614,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.26 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.24 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -690,7 +637,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.27 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.25 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -753,7 +700,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.28 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.26 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -765,77 +712,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.29 - ''' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."project_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_web_vitals_opt_in", - "posthog_team"."autocapture_web_vitals_allowed_metrics", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."person_processing_opt_out", - "posthog_team"."session_recording_opt_in", - "posthog_team"."session_recording_sample_rate", - "posthog_team"."session_recording_minimum_duration_milliseconds", - "posthog_team"."session_recording_linked_flag", - "posthog_team"."session_recording_network_payload_capture_config", - "posthog_team"."session_recording_url_trigger_config", - "posthog_team"."session_recording_url_blocklist_config", - "posthog_team"."session_recording_event_trigger_config", - "posthog_team"."session_replay_config", - "posthog_team"."survey_config", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."capture_dead_clicks", - "posthog_team"."surveys_opt_in", - "posthog_team"."heatmaps_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."modifiers", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical", - "posthog_team"."external_data_workspace_id", - "posthog_team"."external_data_workspace_last_synced_at" - FROM "posthog_team" - WHERE "posthog_team"."id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.3 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.27 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -905,7 +782,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.30 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.28 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -914,7 +791,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.31 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.29 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -998,7 +875,77 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.32 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.3 + ''' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_team" + WHERE "posthog_team"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.30 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -1014,38 +961,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.33 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - LIMIT 21 - ''' -# --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.34 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.31 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -1075,7 +991,7 @@ 'site_app')) ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.35 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.32 ''' SELECT "posthog_organization"."id", "posthog_organization"."name", @@ -1101,7 +1017,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.36 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.33 ''' SELECT "posthog_experiment"."id", "posthog_experiment"."name", @@ -1127,7 +1043,7 @@ WHERE "posthog_experiment"."feature_flag_id" = 99999 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.37 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.34 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1197,7 +1113,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.38 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.35 ''' SELECT "posthog_scheduledchange"."id", "posthog_scheduledchange"."record_id", @@ -1215,7 +1131,7 @@ LIMIT 21 ''' # --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.39 +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.36 ''' SELECT "posthog_scheduledchange"."id", "posthog_scheduledchange"."record_id", @@ -1233,6 +1149,64 @@ LIMIT 21 ''' # --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.37 + ''' + SELECT "posthog_scheduledchange"."id", + "posthog_scheduledchange"."record_id", + "posthog_scheduledchange"."model_name", + "posthog_scheduledchange"."payload", + "posthog_scheduledchange"."scheduled_at", + "posthog_scheduledchange"."executed_at", + "posthog_scheduledchange"."failure_reason", + "posthog_scheduledchange"."team_id", + "posthog_scheduledchange"."created_at", + "posthog_scheduledchange"."created_by_id", + "posthog_scheduledchange"."updated_at" + FROM "posthog_scheduledchange" + WHERE "posthog_scheduledchange"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.38 + ''' + SELECT "posthog_scheduledchange"."id", + "posthog_scheduledchange"."record_id", + "posthog_scheduledchange"."model_name", + "posthog_scheduledchange"."payload", + "posthog_scheduledchange"."scheduled_at", + "posthog_scheduledchange"."executed_at", + "posthog_scheduledchange"."failure_reason", + "posthog_scheduledchange"."team_id", + "posthog_scheduledchange"."created_at", + "posthog_scheduledchange"."created_by_id", + "posthog_scheduledchange"."updated_at" + FROM "posthog_scheduledchange" + WHERE "posthog_scheduledchange"."id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.39 + ''' + SELECT "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_featureflag" + WHERE "posthog_featureflag"."key" = 'flag-1' + LIMIT 21 + ''' +# --- # name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.4 ''' SELECT COUNT(*) AS "__count" @@ -1428,40 +1402,9 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.8 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - ''' -# --- -# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.9 ''' SELECT "posthog_scheduledchange"."id", "posthog_scheduledchange"."record_id", @@ -1483,3 +1426,25 @@ UPDATE NOWAIT ''' # --- +# name: TestProcessScheduledChanges.test_schedule_feature_flag_multiple_changes.9 + ''' + SELECT "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_featureflag" + WHERE "posthog_featureflag"."id" = 99999 + LIMIT 21 + ''' +# --- diff --git a/posthog/test/__snapshots__/test_feature_flag.ambr b/posthog/test/__snapshots__/test_feature_flag.ambr index db26f84b87453..582291cea75b6 100644 --- a/posthog/test/__snapshots__/test_feature_flag.ambr +++ b/posthog/test/__snapshots__/test_feature_flag.ambr @@ -217,29 +217,6 @@ ''' # --- # name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.10 - ''' - SELECT "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_featureflag" - WHERE ("posthog_featureflag"."active" - AND NOT "posthog_featureflag"."deleted" - AND "posthog_featureflag"."team_id" = 99999) - ''' -# --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.11 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -302,7 +279,7 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.12 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.11 ''' SELECT "posthog_remoteconfig"."id", "posthog_remoteconfig"."team_id", @@ -314,7 +291,7 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.13 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.12 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -384,7 +361,7 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.14 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.13 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -393,7 +370,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.15 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.14 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -477,7 +454,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.16 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.15 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -493,38 +470,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.17 - ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - LIMIT 21 - ''' -# --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.18 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.16 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -554,7 +500,7 @@ 'site_app')) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.19 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.17 ''' SELECT "posthog_featureflag"."id", "posthog_featureflag"."key", @@ -577,7 +523,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.2 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.18 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -640,7 +586,19 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.20 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.19 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.2 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -703,19 +661,7 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.21 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.22 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.20 ''' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -785,7 +731,7 @@ LIMIT 21 ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.23 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.21 ''' SELECT COUNT(*) AS "__count" FROM "posthog_featureflag" @@ -794,7 +740,7 @@ AND "posthog_featureflag"."team_id" = 99999) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.24 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.22 ''' SELECT "posthog_survey"."id", "posthog_survey"."team_id", @@ -878,7 +824,7 @@ AND NOT ("posthog_survey"."archived")) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.25 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.23 ''' SELECT "posthog_pluginconfig"."id", "posthog_pluginsourcefile"."transpiled", @@ -894,7 +840,7 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.26 +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.24 ''' SELECT "posthog_hogfunction"."id", "posthog_hogfunction"."team_id", @@ -922,37 +868,43 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 + ''' +# --- +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.25 + ''' + SELECT ((("posthog_person"."properties" -> 'Distinct Id') IN ('"307"'::jsonb) + OR ("posthog_person"."properties" -> 'Distinct Id') IN ('307'::jsonb)) + AND "posthog_person"."properties" ? 'Distinct Id' + AND NOT (("posthog_person"."properties" -> 'Distinct Id') = 'null'::jsonb)) AS "flag_X_condition_0" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = '307' + AND "posthog_persondistinctid"."team_id" = 99999 + AND "posthog_person"."team_id" = 99999) + ''' +# --- +# name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.26 + ''' + SELECT (("posthog_person"."properties" -> 'Distinct Id') IN ('307'::jsonb) + AND "posthog_person"."properties" ? 'Distinct Id' + AND NOT (("posthog_person"."properties" -> 'Distinct Id') = 'null'::jsonb)) AS "flag_X_condition_0" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = '307' + AND "posthog_persondistinctid"."team_id" = 99999 + AND "posthog_person"."team_id" = 99999) ''' # --- # name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.27 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) + SELECT (("posthog_person"."properties" -> 'Distinct Id') = '307'::jsonb + AND "posthog_person"."properties" ? 'Distinct Id' + AND NOT (("posthog_person"."properties" -> 'Distinct Id') = 'null'::jsonb)) AS "flag_X_condition_0" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = '307' + AND "posthog_persondistinctid"."team_id" = 99999 + AND "posthog_person"."team_id" = 99999) ''' # --- # name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.28 @@ -1211,37 +1163,29 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestFeatureFlagMatcher.test_db_matches_independent_of_string_or_number_type.9 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) + SELECT "posthog_featureflag"."id", + "posthog_featureflag"."key", + "posthog_featureflag"."name", + "posthog_featureflag"."filters", + "posthog_featureflag"."rollout_percentage", + "posthog_featureflag"."team_id", + "posthog_featureflag"."created_by_id", + "posthog_featureflag"."created_at", + "posthog_featureflag"."deleted", + "posthog_featureflag"."active", + "posthog_featureflag"."rollback_conditions", + "posthog_featureflag"."performed_rollback", + "posthog_featureflag"."ensure_experience_continuity", + "posthog_featureflag"."usage_dashboard_id", + "posthog_featureflag"."has_enriched_analytics" + FROM "posthog_featureflag" + WHERE ("posthog_featureflag"."active" + AND NOT "posthog_featureflag"."deleted" + AND "posthog_featureflag"."team_id" = 99999) ''' # --- # name: TestFeatureFlagMatcher.test_invalid_regex_match_flag @@ -1344,7 +1288,7 @@ AND NOT (("posthog_person"."properties" -> 'email') = 'null'::jsonb)) AS "flag_X_condition_0" FROM "posthog_person" INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = '307' + WHERE ("posthog_persondistinctid"."distinct_id" = 'another_id' AND "posthog_persondistinctid"."team_id" = 99999 AND "posthog_person"."team_id" = 99999) ''' @@ -1643,37 +1587,18 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestFeatureFlagMatcher.test_invalid_regex_match_flag.9 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) + SELECT (("posthog_person"."properties" ->> 'email')::text ~ '["neil@x.com"]' + AND "posthog_person"."properties" ? 'email' + AND NOT (("posthog_person"."properties" -> 'email') = 'null'::jsonb)) AS "flag_X_condition_0" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = '307' + AND "posthog_persondistinctid"."team_id" = 99999 + AND "posthog_person"."team_id" = 99999) ''' # --- # name: TestFeatureFlagMatcher.test_multiple_flags @@ -1998,27 +1923,39 @@ # --- # name: TestFeatureFlagMatcher.test_with_sql_injection_properties_and_other_aliases.10 ''' - SELECT "posthog_cohort"."id", - "posthog_cohort"."name", - "posthog_cohort"."description", - "posthog_cohort"."team_id", - "posthog_cohort"."deleted", - "posthog_cohort"."filters", - "posthog_cohort"."query", - "posthog_cohort"."version", - "posthog_cohort"."pending_version", - "posthog_cohort"."count", - "posthog_cohort"."created_by_id", - "posthog_cohort"."created_at", - "posthog_cohort"."is_calculating", - "posthog_cohort"."last_calculation", - "posthog_cohort"."errors_calculating", - "posthog_cohort"."last_error_at", - "posthog_cohort"."is_static", - "posthog_cohort"."groups" - FROM "posthog_cohort" - WHERE (NOT "posthog_cohort"."deleted" - AND "posthog_cohort"."team_id" = 99999) + SELECT (((("posthog_person"."properties" -> 'number space') > '"100"'::jsonb + AND JSONB_TYPEOF(("posthog_person"."properties" -> 'number space')) = ('string')) + OR (("posthog_person"."properties" -> 'number space') > '100.0'::jsonb + AND JSONB_TYPEOF(("posthog_person"."properties" -> 'number space')) = ('number'))) + AND "posthog_person"."properties" ? 'number space' + AND NOT (("posthog_person"."properties" -> 'number space') = 'null'::jsonb) + AND ((JSONB_TYPEOF(("posthog_person"."properties" -> ';''" SELECT 1; DROP TABLE posthog_featureflag;')) = ('string') + AND ("posthog_person"."properties" -> ';''" SELECT 1; DROP TABLE posthog_featureflag;') > '"100"'::jsonb) + OR (JSONB_TYPEOF(("posthog_person"."properties" -> ';''" SELECT 1; DROP TABLE posthog_featureflag;')) = ('number') + AND ("posthog_person"."properties" -> ';''" SELECT 1; DROP TABLE posthog_featureflag;') > '100.0'::jsonb)) + AND "posthog_person"."properties" ? ';''" SELECT 1; DROP TABLE posthog_featureflag;' + AND NOT (("posthog_person"."properties" -> ';''" SELECT 1; DROP TABLE posthog_featureflag;') = 'null'::jsonb)) AS "flag_X_condition_0", + (((JSONB_TYPEOF(("posthog_person"."properties" -> ';''" SELECT 1; DROP TABLE posthog_featureflag;')) = ('string') + AND ("posthog_person"."properties" -> ';''" SELECT 1; DROP TABLE posthog_featureflag;') > '"100"'::jsonb) + OR (JSONB_TYPEOF(("posthog_person"."properties" -> ';''" SELECT 1; DROP TABLE posthog_featureflag;')) = ('number') + AND ("posthog_person"."properties" -> ';''" SELECT 1; DROP TABLE posthog_featureflag;') > '100.0'::jsonb)) + AND "posthog_person"."properties" ? ';''" SELECT 1; DROP TABLE posthog_featureflag;' + AND NOT (("posthog_person"."properties" -> ';''" SELECT 1; DROP TABLE posthog_featureflag;') = 'null'::jsonb)) AS "flag_X_condition_1", + (((("posthog_person"."properties" -> 'version!!!') > '"1.05"'::jsonb + AND JSONB_TYPEOF(("posthog_person"."properties" -> 'version!!!')) = ('string')) + OR (("posthog_person"."properties" -> 'version!!!') > '1.05'::jsonb + AND JSONB_TYPEOF(("posthog_person"."properties" -> 'version!!!')) = ('number'))) + AND "posthog_person"."properties" ? 'version!!!' + AND NOT (("posthog_person"."properties" -> 'version!!!') = 'null'::jsonb)) AS "flag_X_condition_2", + ((("posthog_person"."properties" -> 'nested_prop --random #comment //test') = '"21"'::jsonb + OR ("posthog_person"."properties" -> 'nested_prop --random #comment //test') = '21'::jsonb) + AND "posthog_person"."properties" ? 'nested_prop --random #comment //test' + AND NOT (("posthog_person"."properties" -> 'nested_prop --random #comment //test') = 'null'::jsonb)) AS "flag_X_condition_3" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = '307' + AND "posthog_persondistinctid"."team_id" = 99999 + AND "posthog_person"."team_id" = 99999) ''' # --- # name: TestFeatureFlagMatcher.test_with_sql_injection_properties_and_other_aliases.11 @@ -2340,37 +2277,31 @@ AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) - LIMIT 21 ''' # --- # name: TestFeatureFlagMatcher.test_with_sql_injection_properties_and_other_aliases.9 ''' - SELECT "posthog_hogfunction"."id", - "posthog_hogfunction"."team_id", - "posthog_hogfunction"."name", - "posthog_hogfunction"."description", - "posthog_hogfunction"."created_at", - "posthog_hogfunction"."created_by_id", - "posthog_hogfunction"."deleted", - "posthog_hogfunction"."updated_at", - "posthog_hogfunction"."enabled", - "posthog_hogfunction"."type", - "posthog_hogfunction"."icon_url", - "posthog_hogfunction"."hog", - "posthog_hogfunction"."bytecode", - "posthog_hogfunction"."transpiled", - "posthog_hogfunction"."inputs_schema", - "posthog_hogfunction"."inputs", - "posthog_hogfunction"."encrypted_inputs", - "posthog_hogfunction"."filters", - "posthog_hogfunction"."mappings", - "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) + SELECT "posthog_cohort"."id", + "posthog_cohort"."name", + "posthog_cohort"."description", + "posthog_cohort"."team_id", + "posthog_cohort"."deleted", + "posthog_cohort"."filters", + "posthog_cohort"."query", + "posthog_cohort"."version", + "posthog_cohort"."pending_version", + "posthog_cohort"."count", + "posthog_cohort"."created_by_id", + "posthog_cohort"."created_at", + "posthog_cohort"."is_calculating", + "posthog_cohort"."last_calculation", + "posthog_cohort"."errors_calculating", + "posthog_cohort"."last_error_at", + "posthog_cohort"."is_static", + "posthog_cohort"."groups" + FROM "posthog_cohort" + WHERE (NOT "posthog_cohort"."deleted" + AND "posthog_cohort"."team_id" = 99999) ''' # --- # name: TestHashKeyOverridesRaceConditions.test_hash_key_overrides_with_simulated_error_race_conditions_on_person_merging From 60832a8e9bd162b1ed085456a24bc16bebf2821d Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:57:12 +0000 Subject: [PATCH 11/17] Update query snapshots --- .../api/test/__snapshots__/test_survey.ambr | 330 +++++++++++++++++- 1 file changed, 325 insertions(+), 5 deletions(-) diff --git a/posthog/api/test/__snapshots__/test_survey.ambr b/posthog/api/test/__snapshots__/test_survey.ambr index 08a02cbc601d2..f4e08a30e1622 100644 --- a/posthog/api/test/__snapshots__/test_survey.ambr +++ b/posthog/api/test/__snapshots__/test_survey.ambr @@ -399,8 +399,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -743,8 +807,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -1145,8 +1273,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -1475,8 +1667,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -1834,8 +2090,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', From 92fbee129109dff78969470532d69072b12ca71a Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:59:17 +0000 Subject: [PATCH 12/17] Update query snapshots --- .../api/test/__snapshots__/test_decide.ambr | 1302 ++++++++++++++++- .../test_early_access_feature.ambr | 264 +++- .../test_organization_feature_flag.ambr | 132 +- 3 files changed, 1617 insertions(+), 81 deletions(-) diff --git a/posthog/api/test/__snapshots__/test_decide.ambr b/posthog/api/test/__snapshots__/test_decide.ambr index e0e7a8bd21b32..049ef77b360b5 100644 --- a/posthog/api/test/__snapshots__/test_decide.ambr +++ b/posthog/api/test/__snapshots__/test_decide.ambr @@ -638,8 +638,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -1542,8 +1606,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -1886,8 +2014,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -2450,64 +2642,128 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" - FROM "posthog_hogfunction" - WHERE ("posthog_hogfunction"."enabled" - AND "posthog_hogfunction"."team_id" = 99999 - AND "posthog_hogfunction"."type" IN ('site_destination', - 'site_app')) - ''' -# --- -# name: TestDecide.test_flag_with_regular_cohorts.18 - ''' - SELECT "posthog_cohort"."id", - "posthog_cohort"."name", - "posthog_cohort"."description", - "posthog_cohort"."team_id", - "posthog_cohort"."deleted", - "posthog_cohort"."filters", - "posthog_cohort"."query", - "posthog_cohort"."version", - "posthog_cohort"."pending_version", - "posthog_cohort"."count", - "posthog_cohort"."created_by_id", - "posthog_cohort"."created_at", - "posthog_cohort"."is_calculating", - "posthog_cohort"."last_calculation", - "posthog_cohort"."errors_calculating", - "posthog_cohort"."last_error_at", - "posthog_cohort"."is_static", - "posthog_cohort"."groups" - FROM "posthog_cohort" - WHERE (NOT "posthog_cohort"."deleted" - AND "posthog_cohort"."team_id" = 99999) - ''' -# --- -# name: TestDecide.test_flag_with_regular_cohorts.19 - ''' - SELECT (("posthog_person"."properties" -> '$some_prop_1') = '"something_1"'::jsonb - AND "posthog_person"."properties" ? '$some_prop_1' - AND NOT (("posthog_person"."properties" -> '$some_prop_1') = 'null'::jsonb)) AS "flag_X_condition_0" - FROM "posthog_person" - INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") - WHERE ("posthog_persondistinctid"."distinct_id" = 'example_id_1' - AND "posthog_persondistinctid"."team_id" = 99999 - AND "posthog_person"."team_id" = 99999) - ''' -# --- -# name: TestDecide.test_flag_with_regular_cohorts.2 - ''' - SELECT "posthog_remoteconfig"."id", - "posthog_remoteconfig"."team_id", - "posthog_remoteconfig"."config", - "posthog_remoteconfig"."updated_at", - "posthog_remoteconfig"."synced_at" - FROM "posthog_remoteconfig" - WHERE "posthog_remoteconfig"."team_id" = 99999 - LIMIT 21 - ''' -# --- -# name: TestDecide.test_flag_with_regular_cohorts.20 + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" + FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") + WHERE ("posthog_hogfunction"."enabled" + AND "posthog_hogfunction"."team_id" = 99999 + AND "posthog_hogfunction"."type" IN ('site_destination', + 'site_app')) + ''' +# --- +# name: TestDecide.test_flag_with_regular_cohorts.18 + ''' + SELECT "posthog_cohort"."id", + "posthog_cohort"."name", + "posthog_cohort"."description", + "posthog_cohort"."team_id", + "posthog_cohort"."deleted", + "posthog_cohort"."filters", + "posthog_cohort"."query", + "posthog_cohort"."version", + "posthog_cohort"."pending_version", + "posthog_cohort"."count", + "posthog_cohort"."created_by_id", + "posthog_cohort"."created_at", + "posthog_cohort"."is_calculating", + "posthog_cohort"."last_calculation", + "posthog_cohort"."errors_calculating", + "posthog_cohort"."last_error_at", + "posthog_cohort"."is_static", + "posthog_cohort"."groups" + FROM "posthog_cohort" + WHERE (NOT "posthog_cohort"."deleted" + AND "posthog_cohort"."team_id" = 99999) + ''' +# --- +# name: TestDecide.test_flag_with_regular_cohorts.19 + ''' + SELECT (("posthog_person"."properties" -> '$some_prop_1') = '"something_1"'::jsonb + AND "posthog_person"."properties" ? '$some_prop_1' + AND NOT (("posthog_person"."properties" -> '$some_prop_1') = 'null'::jsonb)) AS "flag_X_condition_0" + FROM "posthog_person" + INNER JOIN "posthog_persondistinctid" ON ("posthog_person"."id" = "posthog_persondistinctid"."person_id") + WHERE ("posthog_persondistinctid"."distinct_id" = 'example_id_1' + AND "posthog_persondistinctid"."team_id" = 99999 + AND "posthog_person"."team_id" = 99999) + ''' +# --- +# name: TestDecide.test_flag_with_regular_cohorts.2 + ''' + SELECT "posthog_remoteconfig"."id", + "posthog_remoteconfig"."team_id", + "posthog_remoteconfig"."config", + "posthog_remoteconfig"."updated_at", + "posthog_remoteconfig"."synced_at" + FROM "posthog_remoteconfig" + WHERE "posthog_remoteconfig"."team_id" = 99999 + LIMIT 21 + ''' +# --- +# name: TestDecide.test_flag_with_regular_cohorts.20 ''' SELECT "posthog_cohort"."id", "posthog_cohort"."name", @@ -2782,8 +3038,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -3016,8 +3336,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -3316,8 +3700,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -4389,8 +4837,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -4823,8 +5335,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -5117,8 +5693,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -5812,8 +6452,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -6045,8 +6749,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -6377,8 +7145,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -6659,8 +7491,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -7223,8 +8119,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -7456,8 +8416,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -7784,8 +8808,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -8058,8 +9146,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', diff --git a/posthog/api/test/__snapshots__/test_early_access_feature.ambr b/posthog/api/test/__snapshots__/test_early_access_feature.ambr index cbd767538cbc5..c7820616d0cfd 100644 --- a/posthog/api/test/__snapshots__/test_early_access_feature.ambr +++ b/posthog/api/test/__snapshots__/test_early_access_feature.ambr @@ -368,8 +368,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -874,8 +938,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -1433,8 +1561,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -1874,8 +2066,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', diff --git a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr index 573656301bd39..5b8721a2cd48f 100644 --- a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr +++ b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr @@ -356,8 +356,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -1596,8 +1660,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', From 2784650b8ac85b28e76331081b53a2fb5f84d2a5 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:02:49 +0000 Subject: [PATCH 13/17] Update query snapshots --- .../test_process_scheduled_changes.ambr | 198 ++++++++++- .../test/__snapshots__/test_feature_flag.ambr | 330 +++++++++++++++++- 2 files changed, 520 insertions(+), 8 deletions(-) diff --git a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr index 8da455c771a5b..563d97146fefe 100644 --- a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr +++ b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr @@ -417,8 +417,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -983,8 +1047,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -1396,8 +1524,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', diff --git a/posthog/test/__snapshots__/test_feature_flag.ambr b/posthog/test/__snapshots__/test_feature_flag.ambr index 582291cea75b6..26e3b9acfa02a 100644 --- a/posthog/test/__snapshots__/test_feature_flag.ambr +++ b/posthog/test/__snapshots__/test_feature_flag.ambr @@ -492,8 +492,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -862,8 +926,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -1157,8 +1285,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -1581,8 +1773,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', @@ -2271,8 +2527,72 @@ "posthog_hogfunction"."filters", "posthog_hogfunction"."mappings", "posthog_hogfunction"."masking", - "posthog_hogfunction"."template_id" + "posthog_hogfunction"."template_id", + "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."project_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_web_vitals_opt_in", + "posthog_team"."autocapture_web_vitals_allowed_metrics", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."person_processing_opt_out", + "posthog_team"."session_recording_opt_in", + "posthog_team"."session_recording_sample_rate", + "posthog_team"."session_recording_minimum_duration_milliseconds", + "posthog_team"."session_recording_linked_flag", + "posthog_team"."session_recording_network_payload_capture_config", + "posthog_team"."session_recording_url_trigger_config", + "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", + "posthog_team"."session_replay_config", + "posthog_team"."survey_config", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."capture_dead_clicks", + "posthog_team"."surveys_opt_in", + "posthog_team"."heatmaps_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."modifiers", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical", + "posthog_team"."external_data_workspace_id", + "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" + INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") WHERE ("posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', From 3ba699c71ac4d18299277ec4f12a892ac442304c Mon Sep 17 00:00:00 2001 From: Ben White Date: Fri, 13 Dec 2024 09:20:40 +0100 Subject: [PATCH 14/17] Fix --- posthog/models/test/test_remote_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posthog/models/test/test_remote_config.py b/posthog/models/test/test_remote_config.py index 0009c4d5a0e8f..e1291d680d3d9 100644 --- a/posthog/models/test/test_remote_config.py +++ b/posthog/models/test/test_remote_config.py @@ -366,7 +366,7 @@ def test_gets_js_via_redis_cache(self): def test_gets_js_reuses_config_cache(self): with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): - data = RemoteConfig.get_config_via_token(self.team.api_token) + RemoteConfig.get_config_via_token(self.team.api_token) with self.assertNumQueries(0): data = RemoteConfig.get_config_js_via_token(self.team.api_token) From f135d175436e4bf8848e5e1060a512d0331a7189 Mon Sep 17 00:00:00 2001 From: Ben White Date: Fri, 13 Dec 2024 13:52:06 +0100 Subject: [PATCH 15/17] Fixes --- posthog/api/decide.py | 21 +-------------------- posthog/api/remote_config.py | 10 +++------- posthog/api/test/test_remote_config.py | 22 +++++++++++----------- posthog/api/utils.py | 20 ++++++++++++++++++++ posthog/models/remote_config.py | 23 +++++++++++------------ posthog/models/test/test_remote_config.py | 9 +++++++-- 6 files changed, 53 insertions(+), 52 deletions(-) diff --git a/posthog/api/decide.py b/posthog/api/decide.py index b8efffeba555b..971dce3a472dd 100644 --- a/posthog/api/decide.py +++ b/posthog/api/decide.py @@ -14,8 +14,7 @@ from posthog.api.utils import ( get_project_id, get_token, - hostname_in_allowed_url_list, - parse_domain, + on_permitted_recording_domain, ) from posthog.database_healthcheck import DATABASE_FOR_FLAG_MATCHING from posthog.exceptions import ( @@ -47,24 +46,6 @@ ) -def on_permitted_recording_domain(team: Team, request: HttpRequest) -> bool: - origin = parse_domain(request.headers.get("Origin")) - referer = parse_domain(request.headers.get("Referer")) - user_agent = request.META.get("HTTP_USER_AGENT") - - is_authorized_web_client: bool = hostname_in_allowed_url_list( - team.recording_domains, origin - ) or hostname_in_allowed_url_list(team.recording_domains, referer) - # TODO this is a short term fix for beta testers - # TODO we will match on the app identifier in the origin instead and allow users to auth those - is_authorized_mobile_client: bool = user_agent is not None and any( - keyword in user_agent - for keyword in ["posthog-android", "posthog-ios", "posthog-react-native", "posthog-flutter"] - ) - - return is_authorized_web_client or is_authorized_mobile_client - - def get_base_config(token: str, team: Team, request: HttpRequest, skip_db: bool = False) -> dict: # Check for query param "use_remote_config" use_remote_config = request.GET.get("use_remote_config") == "true" or token in ( diff --git a/posthog/api/remote_config.py b/posthog/api/remote_config.py index 51acb363ddb3b..0dd530874199f 100644 --- a/posthog/api/remote_config.py +++ b/posthog/api/remote_config.py @@ -23,7 +23,7 @@ def check_token(self, token: str): class RemoteConfigAPIView(BaseRemoteConfigAPIView): def get(self, request, token: str, *args, **kwargs): try: - resource = RemoteConfig.get_config_via_token(self.check_token(token), domain=self.request.GET.get("domain")) + resource = RemoteConfig.get_config_via_token(self.check_token(token), request=request) except RemoteConfig.DoesNotExist: raise Http404() @@ -33,9 +33,7 @@ def get(self, request, token: str, *args, **kwargs): class RemoteConfigJSAPIView(BaseRemoteConfigAPIView): def get(self, request, token: str, *args, **kwargs): try: - script_content = RemoteConfig.get_config_js_via_token( - self.check_token(token), domain=self.request.GET.get("domain") - ) + script_content = RemoteConfig.get_config_js_via_token(self.check_token(token), request=request) except RemoteConfig.DoesNotExist: raise Http404() @@ -45,9 +43,7 @@ def get(self, request, token: str, *args, **kwargs): class RemoteConfigArrayJSAPIView(BaseRemoteConfigAPIView): def get(self, request, token: str, *args, **kwargs): try: - script_content = RemoteConfig.get_array_js_via_token( - self.check_token(token), domain=self.request.GET.get("domain") - ) + script_content = RemoteConfig.get_array_js_via_token(self.check_token(token), request=request) except RemoteConfig.DoesNotExist: raise Http404() diff --git a/posthog/api/test/test_remote_config.py b/posthog/api/test/test_remote_config.py index ab2f130dfead8..b66449f111434 100644 --- a/posthog/api/test/test_remote_config.py +++ b/posthog/api/test/test_remote_config.py @@ -39,10 +39,10 @@ def test_invalid_tokens(self): def test_valid_config(self): # Not sure why but there is sometimes one extra query here with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): - response = self.client.get(f"/array/{self.team.api_token}/config") + response = self.client.get(f"/array/{self.team.api_token}/config", HTTP_ORIGIN="https://foo.example.com") with self.assertNumQueries(0): - response = self.client.get(f"/array/{self.team.api_token}/config") + response = self.client.get(f"/array/{self.team.api_token}/config", HTTP_ORIGIN="https://foo.example.com") assert response.status_code == status.HTTP_200_OK assert response.headers["Content-Type"] == "application/json" @@ -80,26 +80,26 @@ def test_valid_config(self): def test_different_response_for_other_domains(self): # Not sure why but there is sometimes one extra query here with self.assertNumQueries(FuzzyInt(CONFIG_REFRESH_QUERY_COUNT, CONFIG_REFRESH_QUERY_COUNT + 1)): - response = self.client.get(f"/array/{self.team.api_token}/config") + response = self.client.get(f"/array/{self.team.api_token}/config", HTTP_ORIGIN="https://foo.example.com") assert response.status_code == status.HTTP_200_OK, response.json() assert response.json()["sessionRecording"] with self.assertNumQueries(0): - response = self.client.get(f"/array/{self.team.api_token}/config?domain=foo.example.com") + response = self.client.get(f"/array/{self.team.api_token}/config", HTTP_ORIGIN="https://foo.example.com") assert response.status_code == status.HTTP_200_OK, response.json() assert response.json()["sessionRecording"] with self.assertNumQueries(0): - response = self.client.get(f"/array/{self.team.api_token}/config?domain=bar.other.com") + response = self.client.get(f"/array/{self.team.api_token}/config", HTTP_ORIGIN="https://bar.other.com") assert response.status_code == status.HTTP_200_OK, response.json() assert not response.json()["sessionRecording"] def test_valid_config_js(self): with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): - response = self.client.get(f"/array/{self.team.api_token}/config.js") + response = self.client.get(f"/array/{self.team.api_token}/config.js", HTTP_ORIGIN="https://foo.example.com") with self.assertNumQueries(0): - response = self.client.get(f"/array/{self.team.api_token}/config.js") + response = self.client.get(f"/array/{self.team.api_token}/config.js", HTTP_ORIGIN="https://foo.example.com") assert response.status_code == status.HTTP_200_OK assert response.headers["Content-Type"] == "application/javascript" @@ -111,10 +111,10 @@ def test_valid_config_js(self): @patch("posthog.models.remote_config.get_array_js_content", return_value="[MOCKED_ARRAY_JS_CONTENT]") def test_valid_array_js(self, mock_get_array_js_content): with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): - response = self.client.get(f"/array/{self.team.api_token}/array.js") + response = self.client.get(f"/array/{self.team.api_token}/array.js", HTTP_ORIGIN="https://foo.example.com") with self.assertNumQueries(0): - response = self.client.get(f"/array/{self.team.api_token}/array.js") + response = self.client.get(f"/array/{self.team.api_token}/array.js", HTTP_ORIGIN="https://foo.example.com") assert response.status_code == status.HTTP_200_OK assert response.headers["Content-Type"] == "application/javascript" assert response.content @@ -128,8 +128,8 @@ def test_valid_array_js(self, mock_get_array_js_content): @patch("posthog.models.remote_config.get_array_js_content", return_value="[MOCKED_ARRAY_JS_CONTENT]") def test_valid_array_uses_config_js_cache(self, mock_get_array_js_content): with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): - response = self.client.get(f"/array/{self.team.api_token}/config.js") + response = self.client.get(f"/array/{self.team.api_token}/config.js", HTTP_ORIGIN="https://foo.example.com") with self.assertNumQueries(0): - response = self.client.get(f"/array/{self.team.api_token}/array.js") + response = self.client.get(f"/array/{self.team.api_token}/array.js", HTTP_ORIGIN="https://foo.example.com") assert response.status_code == status.HTTP_200_OK diff --git a/posthog/api/utils.py b/posthog/api/utils.py index 514534990a8f0..79c4c1028d1d2 100644 --- a/posthog/api/utils.py +++ b/posthog/api/utils.py @@ -1,4 +1,5 @@ import json +from django.http import HttpRequest from rest_framework.decorators import action as drf_action from functools import wraps from posthog.api.documentation import extend_schema @@ -427,6 +428,25 @@ def parse_domain(url: Any) -> Optional[str]: return urlparse(url).hostname +def on_permitted_recording_domain(permitted_domains: list[str], request: HttpRequest) -> bool: + origin = parse_domain(request.headers.get("Origin")) + referer = parse_domain(request.headers.get("Referer")) + + user_agent = request.META.get("HTTP_USER_AGENT") + + is_authorized_web_client: bool = hostname_in_allowed_url_list( + permitted_domains, origin + ) or hostname_in_allowed_url_list(permitted_domains, referer) + # TODO this is a short term fix for beta testers + # TODO we will match on the app identifier in the origin instead and allow users to auth those + is_authorized_mobile_client: bool = user_agent is not None and any( + keyword in user_agent + for keyword in ["posthog-android", "posthog-ios", "posthog-react-native", "posthog-flutter"] + ) + + return is_authorized_web_client or is_authorized_mobile_client + + # By default, DRF spectacular uses the serializer of the view as the response format for actions. However, most actions don't return a version of the model, but something custom. This function removes the response from all actions in the documentation. def action(methods=None, detail=None, url_path=None, url_name=None, responses=None, **kwargs): """ diff --git a/posthog/models/remote_config.py b/posthog/models/remote_config.py index 51443480841fd..3f127a710c3e4 100644 --- a/posthog/models/remote_config.py +++ b/posthog/models/remote_config.py @@ -4,6 +4,7 @@ from collections.abc import Callable from django.conf import settings from django.db import models +from django.http import HttpRequest from django.utils import timezone from prometheus_client import Counter from sentry_sdk import capture_exception @@ -65,18 +66,16 @@ def cache_key_for_team_token(team_token: str, suffix: str) -> str: return f"remote_config/{team_token}/{suffix}" -def sanitize_config_for_public_cdn(config: dict, domain: Optional[str] = None) -> dict: - from posthog.api.utils import hostname_in_allowed_url_list +def sanitize_config_for_public_cdn(config: dict, request: Optional[HttpRequest] = None) -> dict: + from posthog.api.utils import on_permitted_recording_domain # Remove domains from session recording if config.get("sessionRecording"): if "domains" in config["sessionRecording"]: domains = config["sessionRecording"].pop("domains") - if domain: - is_recording_allowed = hostname_in_allowed_url_list(domains, domain) - - if not is_recording_allowed: + if request: + if not on_permitted_recording_domain(domains, request=request): config["sessionRecording"] = False # Remove site apps JS @@ -312,20 +311,20 @@ def _get_via_cache( return data @classmethod - def get_config_via_token(cls, token: str, domain: Optional[str] = None) -> dict: + def get_config_via_token(cls, token: str, request: Optional[HttpRequest] = None) -> dict: config = cls._get_via_cache(token, "config", lambda remote_config: remote_config.build_config()) - config = sanitize_config_for_public_cdn(config, domain) + config = sanitize_config_for_public_cdn(config, request=request) return config @classmethod - def get_config_js_via_token(cls, token: str, domain: Optional[str] = None) -> str: + def get_config_js_via_token(cls, token: str, request: Optional[HttpRequest] = None) -> str: config = cls._get_via_cache(token, "config", lambda remote_config: remote_config.build_config()) # Get the site apps JS so we can render it in the JS site_apps_js = config.pop("siteAppsJS", None) # We don't want to include the minimal site apps content as we have the JS now config.pop("siteApps", None) - config = sanitize_config_for_public_cdn(config, domain) + config = sanitize_config_for_public_cdn(config, request=request) js_content = f"""(function() {{ window._POSTHOG_CONFIG = {json.dumps(config)}; @@ -336,9 +335,9 @@ def get_config_js_via_token(cls, token: str, domain: Optional[str] = None) -> st return js_content @classmethod - def get_array_js_via_token(cls, token: str, domain: Optional[str] = None) -> str: + def get_array_js_via_token(cls, token: str, request: Optional[HttpRequest] = None) -> str: # NOTE: Unlike the other methods we dont store this in the cache as it is cheap to build at runtime - js_content = cls.get_config_js_via_token(token, domain) + js_content = cls.get_config_js_via_token(token, request=request) return f"""{get_array_js_content()}\n\n{js_content}""" diff --git a/posthog/models/test/test_remote_config.py b/posthog/models/test/test_remote_config.py index e1291d680d3d9..fa03badeca141 100644 --- a/posthog/models/test/test_remote_config.py +++ b/posthog/models/test/test_remote_config.py @@ -1,5 +1,6 @@ from decimal import Decimal from unittest.mock import patch +from django.test import RequestFactory from inline_snapshot import snapshot import pytest from posthog.models.action.action import Action @@ -427,12 +428,16 @@ def test_sanitizes_config_for_public_cdn(self): def test_only_includes_recording_for_approved_domains(self): with self.assertNumQueries(CONFIG_REFRESH_QUERY_COUNT): - config = self.remote_config.get_config_via_token(self.team.api_token, domain="my.example.com") + mock_request = RequestFactory().get("/") + mock_request.META["HTTP_ORIGIN"] = "https://my.example.com" + config = self.remote_config.get_config_via_token(self.team.api_token, request=mock_request) assert config["sessionRecording"] # No additional queries should be needed to check the other domain with self.assertNumQueries(0): - config = self.remote_config.get_config_via_token(self.team.api_token, domain="other.com") + mock_request = RequestFactory().get("/") + mock_request.META["HTTP_ORIGIN"] = "https://other.com" + config = self.remote_config.get_config_via_token(self.team.api_token, request=mock_request) assert not config["sessionRecording"] From 17bc8bdead91b57f948d40f30f4090807fa39ec7 Mon Sep 17 00:00:00 2001 From: Ben White Date: Fri, 13 Dec 2024 13:57:50 +0100 Subject: [PATCH 16/17] Added vary headers --- posthog/api/remote_config.py | 14 +++++++++++--- posthog/api/test/test_remote_config.py | 6 ++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/posthog/api/remote_config.py b/posthog/api/remote_config.py index 0dd530874199f..ba62347c8a77c 100644 --- a/posthog/api/remote_config.py +++ b/posthog/api/remote_config.py @@ -5,6 +5,14 @@ from posthog.models.remote_config import RemoteConfig +def add_vary_headers(response): + """ + Add Vary headers for Origin and Referer to responses. + """ + response["Vary"] = "Origin, Referer" + return response + + class BaseRemoteConfigAPIView(APIView): """ Base class for RemoteConfig API views. @@ -27,7 +35,7 @@ def get(self, request, token: str, *args, **kwargs): except RemoteConfig.DoesNotExist: raise Http404() - return JsonResponse(resource) + return add_vary_headers(JsonResponse(resource)) class RemoteConfigJSAPIView(BaseRemoteConfigAPIView): @@ -37,7 +45,7 @@ def get(self, request, token: str, *args, **kwargs): except RemoteConfig.DoesNotExist: raise Http404() - return HttpResponse(script_content, content_type="application/javascript") + return add_vary_headers(HttpResponse(script_content, content_type="application/javascript")) class RemoteConfigArrayJSAPIView(BaseRemoteConfigAPIView): @@ -47,4 +55,4 @@ def get(self, request, token: str, *args, **kwargs): except RemoteConfig.DoesNotExist: raise Http404() - return HttpResponse(script_content, content_type="application/javascript") + return add_vary_headers(HttpResponse(script_content, content_type="application/javascript")) diff --git a/posthog/api/test/test_remote_config.py b/posthog/api/test/test_remote_config.py index b66449f111434..c5fb3a53a1173 100644 --- a/posthog/api/test/test_remote_config.py +++ b/posthog/api/test/test_remote_config.py @@ -77,6 +77,12 @@ def test_valid_config(self): } ) + def test_vary_header_response(self): + response = self.client.get(f"/array/{self.team.api_token}/config", HTTP_ORIGIN="https://foo.example.com") + assert response.status_code == status.HTTP_200_OK, response.json() + assert "Origin" in response.headers["Vary"] + assert "Referer" in response.headers["Vary"] + def test_different_response_for_other_domains(self): # Not sure why but there is sometimes one extra query here with self.assertNumQueries(FuzzyInt(CONFIG_REFRESH_QUERY_COUNT, CONFIG_REFRESH_QUERY_COUNT + 1)): From 61d33e628c392595295d557474bfda8bf9c92a6b Mon Sep 17 00:00:00 2001 From: Ben White Date: Fri, 13 Dec 2024 14:13:30 +0100 Subject: [PATCH 17/17] fixes --- posthog/api/decide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posthog/api/decide.py b/posthog/api/decide.py index 971dce3a472dd..bd2e363dfa435 100644 --- a/posthog/api/decide.py +++ b/posthog/api/decide.py @@ -342,7 +342,7 @@ def get_decide(request: HttpRequest): def _session_recording_domain_not_allowed(team: Team, request: HttpRequest) -> bool: - return team.recording_domains and not on_permitted_recording_domain(team, request) + return team.recording_domains and not on_permitted_recording_domain(team.recording_domains, request) def _session_recording_config_response(request: HttpRequest, team: Team) -> bool | dict: