:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(slack-app): remove the insight unfurl charts flag (#117654)
Vojta Bartoš721ab5eab5b6
diff --git a/products/slack_app/backend/feature_flags.py b/products/slack_app/backend/feature_flags.pyindex d9224b17caf7..c11b6caef31b 100644--- a/products/slack_app/backend/feature_flags.py+++ b/products/slack_app/backend/feature_flags.py@@ -48,7 +48,6 @@ logger = structlog.get_logger(__name__)SLACK_APP_AGENT_DESIGN_FLAG = "slack-app-agent-design"SLACK_APP_FORKING_FLAG = "slack-app-forking"SLACK_APP_PROJECT_PICKER_FLAG = "slack-app-project-picker"-SLACK_APP_INSIGHT_UNFURL_CHARTS_FLAG = "slack-app-insight-unfurl-charts"SLACK_APP_REPLY_SUGGESTIONS_FLAG = "slack-app-reply-suggestions"@@ -139,19 +138,6 @@ def is_slack_app_project_picker_enabled(integration: Integration, distinct_id: s)-def is_slack_app_insight_unfurl_charts_enabled(integration: Integration, distinct_id: str | None = None) -> bool:- """Gate for the chart image in an insight link unfurl. The image block refers to a- PostHog-hosted url, so it needs no scope beyond the ones the text unfurl already uses.-- ``distinct_id`` identifies the PostHog user who shared the link."""- return _workspace_flag_enabled(- SLACK_APP_INSIGHT_UNFURL_CHARTS_FLAG,- integration,- failure_log_key="slack_app_insight_unfurl_charts_feature_flag_check_failed",- distinct_id=distinct_id,- )--def is_slack_app_reply_suggestions_enabled(integration: Integration) -> bool:return _workspace_flag_enabled(SLACK_APP_REPLY_SUGGESTIONS_FLAG,diff --git a/products/slack_app/backend/slack_link_unfurl.py b/products/slack_app/backend/slack_link_unfurl.pyindex d4f53a862139..d31a689f0289 100644--- a/products/slack_app/backend/slack_link_unfurl.py+++ b/products/slack_app/backend/slack_link_unfurl.py@@ -59,7 +59,6 @@ from products.product_analytics.backend.facade.models import Insightfrom products.signals.backend.models import SignalReportfrom products.signals.backend.report_access import may_read_reportsfrom products.slack_app.backend.analytics import capture_slack_event-from products.slack_app.backend.feature_flags import is_slack_app_insight_unfurl_charts_enabledfrom products.slack_app.backend.logic.link_unfurl_charts import chat_unfurl_kwargsfrom products.slack_app.backend.services.followup_invite import build_followup_invitefrom products.slack_app.backend.services.slack_messages import UNFURL_OPT_OUT_PARAM@@ -1029,8 +1028,6 @@ def start_unfurl_charts("""if not integration.team.organization.allow_publicly_shared_resources:return- if not is_slack_app_insight_unfurl_charts_enabled(integration, distinct_id=str(user.distinct_id)):- returnchannel = event["channel"]message_ts = event["message_ts"]inputs = SlackAppUnfurlChartsWorkflowInputs(diff --git a/products/slack_app/backend/tests/test_link_unfurl.py b/products/slack_app/backend/tests/test_link_unfurl.pyindex 6ab04ac6f3b9..9f4d9bbf1f50 100644--- a/products/slack_app/backend/tests/test_link_unfurl.py+++ b/products/slack_app/backend/tests/test_link_unfurl.py@@ -278,25 +278,21 @@ class TestHandlePosthogLinkUnfurl(APIBaseTest):@parameterized.expand([- ("allowed", True, True, True),- ("flag_off", False, True, False),- ("public_sharing_off", True, False, False),+ ("allowed", True, True),+ ("public_sharing_off", False, False),])@patch("products.slack_app.backend.tasks.start_slack_unfurl_charts.delay")@patch("products.slack_app.backend.slack_link_unfurl.sync_connect")- @patch("products.slack_app.backend.slack_link_unfurl.is_slack_app_insight_unfurl_charts_enabled")@patch("products.slack_app.backend.api.resolve_slack_user")@patch("products.slack_app.backend.slack_link_unfurl.SlackIntegration")def test_insight_unfurl_starts_the_chart_workflow_only_when_allowed(self,_name: str,- flag_on: bool,public_sharing: bool,expect_started: bool,mock_slack_integration_class: MagicMock,mock_resolve: MagicMock,- mock_flag: MagicMock,mock_sync_connect: MagicMock,mock_delay: MagicMock,) -> None:@@ -305,7 +301,6 @@ class TestHandlePosthogLinkUnfurl(APIBaseTest):self.organization.allow_publicly_shared_resources = public_sharingself.organization.save()mock_resolve.return_value = MagicMock(user=self.user)- mock_flag.return_value = flag_onmock_sync_connect.return_value.start_workflow = AsyncMock()url = f"http://testserver/project/{self.team.pk}/insights/{self.insight.short_id}"@@ -327,7 +322,6 @@ class TestHandlePosthogLinkUnfurl(APIBaseTest):@parameterized.expand([("query_access", True), ("no_query_access", False)])@patch("products.slack_app.backend.tasks.start_slack_unfurl_charts.delay")@patch("products.slack_app.backend.slack_link_unfurl.sync_connect")- @patch("products.slack_app.backend.slack_link_unfurl.is_slack_app_insight_unfurl_charts_enabled", return_value=True)@patch("products.slack_app.backend.api.resolve_slack_user")@patch("products.slack_app.backend.slack_link_unfurl.SlackIntegration")def test_adhoc_insight_link_posts_no_card_and_queues_its_chart(@@ -336,7 +330,6 @@ class TestHandlePosthogLinkUnfurl(APIBaseTest):query_access: bool,mock_slack_integration_class: MagicMock,mock_resolve: MagicMock,- _mock_flag: MagicMock,mock_sync_connect: MagicMock,mock_delay: MagicMock,) -> None:@@ -370,14 +363,12 @@ class TestHandlePosthogLinkUnfurl(APIBaseTest):@patch("products.slack_app.backend.tasks.start_slack_unfurl_charts.delay")@patch("products.slack_app.backend.slack_link_unfurl.sync_connect")- @patch("products.slack_app.backend.slack_link_unfurl.is_slack_app_insight_unfurl_charts_enabled", return_value=True)@patch("products.slack_app.backend.api.resolve_slack_user")@patch("products.slack_app.backend.slack_link_unfurl.SlackIntegration")def test_adhoc_link_beside_another_link_is_not_unfurled(self,mock_slack_integration_class: MagicMock,mock_resolve: MagicMock,- _mock_flag: MagicMock,mock_sync_connect: MagicMock,mock_delay: MagicMock,) -> None: