Skip to content

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

chore(data-warehouse): remove the object storage sources flag (#130021)

Tom Owers5c3db245d6b4
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 94e7a09dfe9a..e2aa69b72be5 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -14107,9 +14107,9 @@ snapshots:
scenes-app-marketing-analytics-source-onboarding--manual-selection-with-search-console--light:
hash: v1.k794b7964.8c92db15f2a02f8a857e5415c8ede1df694b03e125117a87ff812481917fb2a8.B-oCrelZD1d7dV0sGePsUpciJbe19tYS8BrDPOcRM4U
scenes-app-marketing-analytics-source-onboarding--skip-during-scan--dark:
- hash: v1.k794b7964.5b71002d90f449cbb3fd7c8eccb81ff9bdd75133e8574c5a8e91b4ba7557c68c.Ah9BOEl8MFTkgQW1HlejuA4rSkyWh4zB26W75DcV62U
+ hash: v1.k794b7964.47edb4acaf6be15f5f0f8bd40f30c834c5bc2ff7e47f357a72ec35fa332b159c.EZdlP9uCfGNLBeZX3R8gQtu6FtkHW8sHd0WY0b6fslM
scenes-app-marketing-analytics-source-onboarding--skip-during-scan--light:
- hash: v1.k794b7964.75afc69fb6fa2eda4a15a9a9f69e51a4243846c95855d0455dc57ba53bb6a271.TmNXBByELHoDXLuO7JgP84EDijdkBMa_bvmX18PEqrc
+ hash: v1.k794b7964.a2d2c7e59c2ced8ef00221ae207eea27dabc4a81645cf14d1b6cb226baa24d2b.29rsM3fbhIfYk4EAExPUWRlURHw4YAiPt5U6WuoFh98
scenes-app-marketing-analytics-source-setup-panel--checking--dark:
hash: v1.k794b7964.6358b05db40c09854e171d16bfa8a28a3d52b255697b0b4df3bdcdb3e02e763a.N04cbrr5sudNaAkggpjroLP3WbPnUg9eSGAbB6sXVTw
scenes-app-marketing-analytics-source-setup-panel--checking--light:
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 66fa20c83703..47faeae9b3e3 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -306,7 +306,6 @@ export const FEATURE_FLAGS = {
DATA_MODELING_USAGE: 'data-modeling-usage', // owner: #team-data-modeling, gates the Models usage tab
DATA_WAREHOUSE_CUSTOM_SOURCE_AI_BUILDER: 'dwh-custom-source-ai-builder', // owner: #team-warehouse-sources
DATA_WAREHOUSE_CUSTOM_SOURCE_OAUTH2: 'dwh-custom-source-oauth2', // owner: #team-warehouse-sources
- DATA_WAREHOUSE_OBJECT_STORAGE_SOURCES: 'dwh-object-storage-sources', // owner: #team-warehouse-sources
DATA_WAREHOUSE_RENAME_SAVED_VIEW: 'data-warehouse-rename-saved-view', // owner: #team-data-modeling
DATA_WAREHOUSE_SCENE: 'data-warehouse-scene', // owner: #team-data-modeling
DISCUSSIONS_SLACK_SYNC: 'discussions-slack-sync', // owner: #team-platform-features
diff --git a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsx b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsx
index 6f718013ca5f..a0dcf0381a7e 100644
--- a/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsx
+++ b/frontend/src/scenes/data-pipelines/utils/nonHogFunctionTemplatesLogic.tsx
@@ -10,11 +10,10 @@ import { userLogic } from 'scenes/userLogic'
import { BATCH_EXPORT_SERVICE_NAMES, HogFunctionTemplateStatus, HogFunctionTemplateType } from '~/types'
import { sourceWizardLogic } from 'products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic'
-import { DATA_WAREHOUSE_SOURCE_ICON_MAP } from 'products/data_warehouse/frontend/shared/components/SourceIcon'
import { SourceConfigResponseApi } from 'products/warehouse_sources/frontend/generated/api.schemas'
import type { FeatureFlagsSet } from '../../../lib/logic/featureFlagLogic'
-import type { ManualLinkSourceType, UserType } from '../../../types'
+import type { UserType } from '../../../types'
import { BATCH_EXPORT_ICON_MAP } from '../batch-exports/BatchExportIcon'
export interface NonHogFunctionTemplatesLogicProps {
@@ -59,10 +58,6 @@ export function getSourceDisplayStatus(unreleased: boolean, featureFlag: boolean
export interface nonHogFunctionTemplatesLogicValues {
featureFlags: FeatureFlagsSet // featureFlagLogic
connectors: SourceConfigResponseApi[] // sourceWizardLogic
- manualConnectors: {
- name: string
- type: ManualLinkSourceType
- }[] // sourceWizardLogic
user: UserType | null // userLogic
hogFunctionTemplatesBatchExports: HogFunctionTemplateType[]
hogFunctionTemplatesDataWarehouseSources: HogFunctionTemplateType[]
@@ -73,10 +68,6 @@ export interface nonHogFunctionTemplatesLogicMeta {
__keaTypeGenInternalSelectorTypes: {
hogFunctionTemplatesDataWarehouseSources: (
connectors: SourceConfigResponseApi[],
- manualConnectors: {
- name: string
- type: ManualLinkSourceType
- }[],
featureFlags: FeatureFlagsSet
) => HogFunctionTemplateType[]
hogFunctionTemplatesBatchExports: (
@@ -100,7 +91,7 @@ export const nonHogFunctionTemplatesLogic = kea<nonHogFunctionTemplatesLogicType
connect(({ availableSources }: NonHogFunctionTemplatesLogicProps) => ({
values: [
sourceWizardLogic({ availableSources }),
- ['connectors', 'manualConnectors'],
+ ['connectors'],
featureFlagLogic,
['featureFlags'],
userLogic,
@@ -110,16 +101,12 @@ export const nonHogFunctionTemplatesLogic = kea<nonHogFunctionTemplatesLogicType
selectors({
hogFunctionTemplatesDataWarehouseSources: [
- (s) => [s.connectors, s.manualConnectors, s.featureFlags],
+ (s) => [s.connectors, s.featureFlags],
(
connectors: SourceConfigResponseApi[],
- manualConnectors: {
- name: string
- type: import('~/types').ManualLinkSourceType
- }[],
featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet
): HogFunctionTemplateType[] => {
- const managed = connectors.map((connector: SourceConfigResponseApi): HogFunctionTemplateType => {
+ return connectors.map((connector: SourceConfigResponseApi): HogFunctionTemplateType => {
const featureFlagDefined = !!connector.featureFlag
const featureFlagRaw = featureFlags[connector.featureFlag as FeatureFlagKey]
// Treat "flag declared but absent in featureFlags" as off — non-cloud
@@ -155,29 +142,6 @@ export const nonHogFunctionTemplatesLogic = kea<nonHogFunctionTemplatesLogicType
releaseStatus,
}
})
- const selfManaged = manualConnectors.map(
- (source): HogFunctionTemplateType => ({
- id: `self-managed-${source.type}`,
- type: 'source',
- name: source.name,
- icon_url: DATA_WAREHOUSE_SOURCE_ICON_MAP[source.type],
- status: 'stable',
- description: (
- <>
- Data will be queried directly from your data source that you manage.{' '}
- <Link to="https://posthog.com/docs/cdp/sources">Learn more</Link>
- </>
- ),
- code: '',
- code_language: 'hog',
- inputs_schema: [],
- filters: null,
- masking: null,
- free: true,
- })
- )
-
- return [...managed, ...selfManaged]
},
],
diff --git a/products/data_warehouse/backend/presentation/views/table.py b/products/data_warehouse/backend/presentation/views/table.py
index 856782676b9d..2ca36f02d1c9 100644
--- a/products/data_warehouse/backend/presentation/views/table.py
+++ b/products/data_warehouse/backend/presentation/views/table.py
@@ -65,7 +65,6 @@ from products.warehouse_sources.backend.facade.file_upload_sources import (
can_replace_file,
create_file_upload_source,
discard_unused_upload,
- file_upload_sources_enabled,
has_file_upload_source,
hosted_upload_in_use,
is_legacy_upload_url,
@@ -979,9 +978,8 @@ class TableViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, viewsets.M
table.save()
log_table_activity(table, "created")
- if file_upload_sources_enabled(self.team_id):
- # The table reads the file in place until the source's first sync imports it.
- create_file_upload_source(self.team_id, table.pk, upload, read_settings)
+ # The table reads the file in place until the source's first sync imports it.
+ create_file_upload_source(self.team_id, table.pk, upload, read_settings)
validate_data_warehouse_table_columns.delay(self.team_id, str(table.id))
diff --git a/products/data_warehouse/backend/tests/api/test_warehouse_table_file_upload.py b/products/data_warehouse/backend/tests/api/test_warehouse_table_file_upload.py
index bd9c2e24ff64..7d92b5d12a52 100644
--- a/products/data_warehouse/backend/tests/api/test_warehouse_table_file_upload.py
+++ b/products/data_warehouse/backend/tests/api/test_warehouse_table_file_upload.py
@@ -26,6 +26,8 @@ from products.warehouse_sources.backend.models.table import DataWarehouseTable
VIEW_MODULE = "products.data_warehouse.backend.presentation.views.table"
MODEL_MODULE = "products.warehouse_sources.backend.models.table"
+SERVICE_MODULE = "products.warehouse_sources.backend.file_upload_sources"
+STORAGE_MODULE = "products.warehouse_sources.backend.temporal.data_imports.sources.file_upload.storage"
UPLOAD_ID = "11111111-2222-4333-8444-555555555555"
NEW_UPLOAD_ID = "22222222-2222-4333-8444-555555555555"
@@ -198,6 +200,16 @@ class TestCreateTableFromUpload(APIBaseTest):
super().setUp()
self.upload_url = f"/api/environments/{self.team.pk}/warehouse_tables/upload_file/"
self.create_url = f"/api/environments/{self.team.pk}/warehouse_tables/create_from_upload/"
+ # Each create also makes a file upload source and starts its first sync.
+ patches = [
+ patch(f"{STORAGE_MODULE}.get_s3_client", return_value=_FakeS3()),
+ patch(f"{SERVICE_MODULE}.sync_connect"),
+ patch(f"{SERVICE_MODULE}.sync_external_data_job_workflow"),
+ patch(f"{SERVICE_MODULE}.trigger_ad_hoc_sync"),
+ ]
+ for p in patches:
+ p.start()
+ self.addCleanup(p.stop)
def _upload(self, filename: str = "orders.csv", file_format: str = "csv") -> str:
with patch(f"{VIEW_MODULE}.get_s3_client", return_value=_FakeS3()):
@@ -225,10 +237,10 @@ class TestCreateTableFromUpload(APIBaseTest):
):
return self.client.post(f"{self.create_url}?include_columns=false", data=payload, format="json")
- def test_an_uploaded_file_becomes_a_self_managed_table(self) -> None:
+ def test_an_uploaded_file_becomes_a_table_that_reads_it_in_place(self) -> None:
# The wiring guard for the two-step contract: the upload endpoint's `upload_id` has to be
- # accepted by create_from_upload, and the result has to be a self-managed table (no source,
- # queried in place from our own bucket) rather than a pipeline ExternalDataSource.
+ # accepted by create_from_upload, and the table has to read the file in place from our own
+ # bucket until its file upload source syncs.
upload_id = self._upload()
response = self._create(upload_id=upload_id, filename="orders.csv", file_format="csv", table_name="orders")
@@ -246,8 +258,6 @@ class TestCreateTableFromUpload(APIBaseTest):
)
assert table.columns == FAKE_COLUMNS
assert table.created_via == DataWarehouseTable.CreatedVia.WEB
- # No pipeline source is created — this is the whole point of the self-managed shape.
- assert ExternalDataSource.objects.count() == 0
def test_an_uploaded_table_cannot_be_repointed_at_another_location(self) -> None:
# An uploaded table carries no credential, so it is read with the ClickHouse node's own role
@@ -462,18 +472,15 @@ class TestWarehouseTableDeleteRemovesHostedFile(APIBaseTest):
assert removed == [f"test-bucket/file_uploads/team_{self.team.pk}/{upload_id}/orders.csv"]
-SERVICE_MODULE = "products.warehouse_sources.backend.file_upload_sources"
-STORAGE_MODULE = "products.warehouse_sources.backend.temporal.data_imports.sources.file_upload.storage"
SOURCE_VIEWS = "products.warehouse_sources.backend.presentation.views.external_data_source.base"
-OBJECT_STORAGE_FLAG = "dwh-object-storage-sources"
REPLACEMENT_COLUMNS = {
"id": {"hogql": "IntegerDatabaseField", "clickhouse": "Nullable(Int64)"},
"placed_at": {"hogql": "DateTimeDatabaseField", "clickhouse": "Nullable(DateTime64(6))"},
}
-def _flag(enabled: bool):
- return lambda key, *args, **kwargs: enabled and key == OBJECT_STORAGE_FLAG
+def _warehouse_api_flag(flag_key: str, *args: object, **kwargs: object) -> bool:
+ return flag_key == "warehouse-api"
@override_settings(DATAWAREHOUSE_BUCKET="test-bucket", DATAWAREHOUSE_BUCKET_DOMAIN="warehouse.posthog.test")
@@ -484,7 +491,7 @@ class TestFileUploadSources(APIBaseTest):
self.s3 = _FakeS3()
self.trigger_count = 0
patches = [
- patch("posthoganalytics.feature_enabled", side_effect=_flag(True)),
+ patch("posthoganalytics.feature_enabled", return_value=False),
patch(f"{VIEW_MODULE}.get_s3_client", return_value=self.s3),
patch(f"{STORAGE_MODULE}.get_s3_client", return_value=self.s3),
patch(f"{VIEW_MODULE}.validate_data_warehouse_table_columns.delay"),
@@ -527,12 +534,12 @@ class TestFileUploadSources(APIBaseTest):
format="json",
)
- def test_with_the_flag_an_upload_becomes_a_file_upload_source_and_one_billable_sync(self) -> None:
+ def test_an_upload_becomes_a_file_upload_source_and_one_billable_sync(self) -> None:
response = self._create()
assert response.status_code == status.HTTP_201_CREATED, response.json()
table = DataWarehouseTable.objects.get(id=response.json()["id"])
- # Until the first sync imports it, the table reads the file in place, as without the flag.
+ # Until the first sync imports it, the table reads the file in place.
assert (table.name, table.external_data_source_id, table.credential_id) == ("orders", None, None)
assert (
table.url_pattern
@@ -562,15 +569,6 @@ class TestFileUploadSources(APIBaseTest):
"workflow_id_prefix": "file-upload",
}
- def test_without_the_flag_an_upload_stays_a_self_managed_table(self) -> None:
- self.flag.side_effect = _flag(False)
-
- response = self._create()
-
- assert response.status_code == status.HTTP_201_CREATED, response.json()
- assert not ExternalDataSource.objects.filter(team=self.team).exists()
- self.trigger.assert_not_called()
-
def test_a_sync_that_fails_to_start_still_leaves_a_working_table(self) -> None:
self.trigger.side_effect = RuntimeError("temporal is down")
@@ -775,7 +773,7 @@ class TestFileUploadSources(APIBaseTest):
def test_a_new_file_for_a_migrated_table_starts_the_sync_that_adopts_it(
self, _name: str, key: str, path: str
) -> None:
- self.flag.side_effect = lambda flag_key, *args, **kwargs: flag_key in (OBJECT_STORAGE_FLAG, "warehouse-api")
+ self.flag.side_effect = _warehouse_api_flag
table, schema = self._migrated_table(key)
old_url = table.url_pattern
self.get_columns.return_value = dict(REPLACEMENT_COLUMNS)
@@ -852,7 +850,7 @@ class TestFileUploadSources(APIBaseTest):
assert (schema.source.job_inputs["upload_id"], schema.source.job_inputs["filename"]) == ("", "")
def test_a_refused_legacy_file_action_deletes_the_file_it_stored(self) -> None:
- self.flag.side_effect = lambda flag_key, *args, **kwargs: flag_key in (OBJECT_STORAGE_FLAG, "warehouse-api")
+ self.flag.side_effect = _warehouse_api_flag
_, schema = self._migrated_table("managed/team_{team}/orders.csv")
ExternalDataJob.objects.create(
team=self.team, pipeline=schema.source, schema=schema, status=ExternalDataJob.Status.RUNNING
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/components/FileUploadSourceForm.tsx b/products/data_warehouse/frontend/scenes/NewSourceScene/components/FileUploadSourceForm.tsx
index 824618ecca2e..ae03698eadc6 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/components/FileUploadSourceForm.tsx
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/components/FileUploadSourceForm.tsx
@@ -3,7 +3,6 @@ import { Form } from 'kea-forms'
import { LemonButton, LemonInput, LemonSelect, Spinner } from '@posthog/lemon-ui'
-import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonFileInput } from 'lib/lemon-ui/LemonFileInput/LemonFileInput'
import { LemonProgress } from 'lib/lemon-ui/LemonProgress'
@@ -14,7 +13,6 @@ import { FILE_UPLOAD_ACCEPT, fileUploadSourceLogic } from '../fileUploadSourceLo
export function FileUploadSourceForm(): JSX.Element {
const { fileUpload, isFileUploadSubmitting, uploadStage, uploadPercent } = useValues(fileUploadSourceLogic)
const { selectFiles, setTableName, setFileFormat } = useActions(fileUploadSourceLogic)
- const objectStorageSourcesEnabled = useFeatureFlag('DATA_WAREHOUSE_OBJECT_STORAGE_SOURCES')
const busyReason = !isFileUploadSubmitting
? undefined
@@ -60,11 +58,9 @@ export function FileUploadSourceForm(): JSX.Element {
</LemonField>
<div className="mb-4 flex flex-col gap-1 text-xs text-secondary">
<span>Files can be up to 50MB.</span>
- {objectStorageSourcesEnabled && (
- <span data-attr="file-upload-billing-note">
- Rows imported from this file count toward your data warehouse rows synced.
- </span>
- )}
+ <span data-attr="file-upload-billing-note">
+ Rows imported from this file count toward your data warehouse rows synced.
+ </span>
</div>
<LemonField name="table_name" label="Table name">
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSource.ts b/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSource.ts
index 102848982877..abd13da65e93 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSource.ts
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSource.ts
@@ -4,13 +4,11 @@ import type { ExternalDataSourceType } from '~/types'
import { SourceConfigResponseApi } from 'products/warehouse_sources/frontend/generated/api.schemas'
-// File upload is a client-only catalog entry — it has no backend SourceConfig because an uploaded
-// file becomes a DataWarehouseTable (self-managed, or a managed FileUpload source when managed object
-// storage sources are on), not a synced source of its own. `FileUpload` is deliberately not a real
-// source type (there is no backend source of that type), but a source key is a plain string, so it reuses the shared
-// source-config shape and the wizard's connector-selection plumbing. This synthetic config drives the wizard's second step and
-// the tile icon; the three tiles below (one per format) all point back at it, since users look for
-// "CSV", not "File upload".
+// File upload is a client-only catalog entry. The backend FileUpload source isn't listed in the
+// catalog, because PostHog creates it after the uploaded file becomes a table. This synthetic config
+// reuses the shared source-config shape and the wizard's connector-selection plumbing. It drives the
+// wizard's second step and the tile icon; the three tiles below (one per format) all point back at
+// it, since users look for "CSV", not "File upload".
export const FILE_UPLOAD_SOURCE_NAME: ExternalDataSourceType = 'FileUpload'
export type FileUploadFormat = 'csv' | 'json' | 'parquet'
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSourceLogic.test.ts b/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSourceLogic.test.ts
index cde513f1cca0..8b205e64b147 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSourceLogic.test.ts
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSourceLogic.test.ts
@@ -35,18 +35,11 @@ describe('file upload format validation', () => {
})
describe('oversized file message', () => {
- it.each([
- { enabled: false, expected: 'as a self-managed source instead', unexpected: 'Amazon S3' },
- {
- enabled: true,
- expected: 'Amazon S3, Google Cloud Storage, Azure Blob Storage or Cloudflare R2',
- unexpected: 'self-managed',
- },
- ])('points to the right bucket source when managed object storage sources enabled=$enabled', (c) => {
+ it('points to the bucket sources instead of self-managed tables', () => {
const file = new File(['a'], 'big.csv')
Object.defineProperty(file, 'size', { value: MAX_FILE_UPLOAD_SIZE_BYTES + 1 })
- const errors = fileUploadFormErrors({ files: [file], table_name: 'my_table', file_format: 'csv' }, c.enabled)
- expect(errors.files).toContain(c.expected)
- expect(errors.files).not.toContain(c.unexpected)
+ const errors = fileUploadFormErrors({ files: [file], table_name: 'my_table', file_format: 'csv' })
+ expect(errors.files).toContain('Amazon S3, Google Cloud Storage, Azure Blob Storage or Cloudflare R2')
+ expect(errors.files).not.toContain('self-managed')
})
})
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSourceLogic.tsx b/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSourceLogic.tsx
index 598ed3991d0f..8d1036bc5093 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSourceLogic.tsx
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/fileUploadSourceLogic.tsx
@@ -7,8 +7,6 @@ import posthog from 'posthog-js'
import { lemonToast } from '@posthog/lemon-ui'
import api from 'lib/api'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { FeatureFlagsSet, featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { databaseTableListLogic } from 'scenes/data-management/database/databaseTableListLogic'
import { urls } from 'scenes/urls'
@@ -105,18 +103,17 @@ export function parseFileUploadFormat(value: string | undefined): FileUploadForm
return normalized === 'csv' || normalized === 'json' || normalized === 'parquet' ? normalized : null
}
-export function fileUploadFormErrors(
- { files, table_name, file_format }: Partial<FileUploadForm>,
- objectStorageSourcesEnabled: boolean = false
-): Record<string, unknown> {
+export function fileUploadFormErrors({
+ files,
+ table_name,
+ file_format,
+}: Partial<FileUploadForm>): Record<string, unknown> {
const file = files?.[0]
return {
files: !file
? 'Please choose a file to upload.'
: file.size > MAX_FILE_UPLOAD_SIZE_BYTES
- ? objectStorageSourcesEnabled
- ? 'This file is larger than 50MB. For bigger files, connect the bucket they live in with the Amazon S3, Google Cloud Storage, Azure Blob Storage or Cloudflare R2 source instead.'
- : 'This file is larger than 50MB. For bigger files, connect the bucket they live in as a self-managed source instead.'
+ ? 'This file is larger than 50MB. For bigger files, connect the bucket they live in with the Amazon S3, Google Cloud Storage, Azure Blob Storage or Cloudflare R2 source instead.'
: file_format
? fileFormatMismatchError(file.name, file_format)
: undefined,
@@ -130,7 +127,6 @@ export function fileUploadFormErrors(
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface fileUploadSourceLogicValues {
- featureFlags: FeatureFlagsSet // featureFlagLogic
fileUpload: FileUploadForm
fileUploadAllErrors: Record<string, any>
fileUploadChanged: boolean
@@ -232,7 +228,6 @@ export const fileUploadSourceLogic = kea<fileUploadSourceLogicType>([
path(['products', 'dataWarehouse', 'fileUploadSourceLogic']),
connect(() => ({
actions: [databaseTableListLogic, ['loadDatabase']],
- values: [featureFlagLogic, ['featureFlags']],
})),
actions({
selectFiles: (files: File[]) => ({ files }),
@@ -261,15 +256,14 @@ export const fileUploadSourceLogic = kea<fileUploadSourceLogicType>([
},
],
}),
- forms(({ actions, values }) => ({
+ forms(({ actions }) => ({
fileUpload: {
defaults: {
files: [] as File[],
table_name: '',
file_format: parseFileUploadFormat(router.values.searchParams.format) ?? 'csv',
} as FileUploadForm,
- errors: (form) =>
- fileUploadFormErrors(form, !!values.featureFlags[FEATURE_FLAGS.DATA_WAREHOUSE_OBJECT_STORAGE_SOURCES]),
+ errors: (form) => fileUploadFormErrors(form),
submit: async ({ files, table_name, file_format }) => {
const file = files[0]
// The form's `errors` already block submission, but a stale/oversized file can only
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/sourceCatalogLogic.ts b/products/data_warehouse/frontend/scenes/NewSourceScene/sourceCatalogLogic.ts
index 00fb885dd7f7..11f9e9f279f3 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/sourceCatalogLogic.ts
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/sourceCatalogLogic.ts
@@ -22,7 +22,7 @@ import {
import type { PaginatedResponse } from '../../../../../frontend/src/lib/api'
import type { FeatureFlagsSet } from '../../../../../frontend/src/lib/logic/featureFlagLogic'
-import type { ExternalDataSource, ManualLinkSourceType, UserType } from '../../../../../frontend/src/types'
+import type { ExternalDataSource, UserType } from '../../../../../frontend/src/types'
import { sourcesDataLogic } from '../../shared/logics/sourcesDataLogic'
import { availableSourcesLogic } from './availableSourcesLogic'
import {
@@ -39,55 +39,24 @@ import {
SourceCategoryFilter,
isSourceCategoryFilter,
} from './sourceCategories'
-import { sourceWizardLogic } from './sourceWizardLogic'
// Helps kea-typegen reference the Fuse type without a bad `import { Fuse } from 'fuse.js'`.
export interface Fuse extends FuseClass<CatalogItem> {}
-// Self-managed (S3/GCS/Azure/R2) connectors don't flow through SourceConfigResponseApi, so place
-// them in a sensible catalog bucket explicitly.
+// File upload doesn't flow through SourceConfigResponseApi, so place it in a sensible catalog
+// bucket explicitly.
const MANUAL_SOURCE_CATEGORY: DataWarehouseSourceCategoryApi = 'File storage'
-// Self-managed connectors carry no SourceConfigResponseApi keywords, and their labels alone ("S3",
-// "Google Cloud Storage") miss the terms users actually search ("amazon", "aws", "gcs").
-// Keys match ManualLinkSourceType.
-const MANUAL_SOURCE_KEYWORDS: Record<string, string[]> = {
- aws: ['amazon', 'aws', 's3', 'amazon web services', 'amazon s3'],
- 'google-cloud': ['gcs', 'gcp', 'google cloud', 'google cloud storage'],
- 'cloudflare-r2': ['cloudflare', 'r2', 'object storage'],
- azure: ['azure', 'microsoft azure', 'azure blob', 'blob storage'],
-}
-
// The catalog matches a source against its label, name, keywords and category. That finds the
// Databases category for "database", but "warehouse" matches nothing at all, even though it is
// the word in this product's own name. Attach the words people type for the category itself.
const DATABASE_CATEGORY_KEYWORDS = ['warehouse', 'data warehouse', 'dwh']
-// Every self-managed connector links files from a bucket, so a user searching for a file
-// format ("csv", "parquet") should land on them rather than an empty result that pushes
-// them to request a source we already support. Matches the formats the link form accepts.
-const FILE_STORAGE_FORMAT_KEYWORDS = ['csv', 'parquet', 'delta', 'file', 'files', 'flat file']
-
-// "Self-managed data warehouse sources" is the name the sources list gives these, but no connector
-// carries the phrase in its label or keywords, so searching the catalog for the name we taught the
-// user found nothing at all.
-const SELF_MANAGED_KEYWORDS = [
- 'self-managed',
- 'self managed',
- 'selfmanaged',
- 'bring your own',
- 'byo',
- 'own bucket',
- 'own storage',
-]
-
// A "Coming soon" tile for a service we already connect under another tile is a dead end: the user
// registers interest and leaves without the connector that works today. Each key is hidden while
// its value is in the catalog and connectable.
const LIVE_ALTERNATIVE_TO_COMING_SOON: Partial<Record<string, string>> = {
MicrosoftAdvertising: 'BingAds',
- // The managed Amazon S3 source is flag-gated, but the self-managed S3 connector links a bucket.
- AmazonS3: 'aws',
}
// "Request a data warehouse source" survey. We render our own modal and submit the answer
@@ -158,11 +127,6 @@ export interface CatalogCategory {
export interface sourceCatalogLogicValues {
availableSources: Record<string, SourceConfigResponseApi> | null // availableSourcesLogic
featureFlags: FeatureFlagsSet // featureFlagLogic
- manualConnectors: {
- name: string
- type: ManualLinkSourceType
- }[] // sourceWizardLogic
- objectStorageSourcesEnabled: boolean // sourceWizardLogic
dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null // sourcesDataLogic
user: UserType | null // userLogic
catalogFuse: Fuse
@@ -215,12 +179,7 @@ export interface sourceCatalogLogicMeta {
__keaTypeGenInternalSelectorTypes: {
catalogItems: (
availableSources: Record<string, SourceConfigResponseApi> | null,
- manualConnectors: {
- name: string
- type: ManualLinkSourceType
- }[],
featureFlags: FeatureFlagsSet,
- objectStorageSourcesEnabled: boolean,
dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null,
arg: string[] | undefined
) => CatalogItem[]
@@ -294,8 +253,6 @@ export const sourceCatalogLogic = kea<sourceCatalogLogicType>([
// mounted outside the wizard (e.g. the pipeline new-source page).
availableSourcesLogic,
['availableSources'],
- sourceWizardLogic,
- ['manualConnectors', 'objectStorageSourcesEnabled'],
featureFlagLogic,
['featureFlags'],
userLogic,
@@ -353,20 +310,13 @@ export const sourceCatalogLogic = kea<sourceCatalogLogicType>([
catalogItems: [
(s) => [
s.availableSources,
- s.manualConnectors,
s.featureFlags,
- s.objectStorageSourcesEnabled,
s.dataWarehouseSources,
(_, p: SourceCatalogLogicProps) => p.allowedSources,
],
(
availableSources: Record<string, SourceConfigResponseApi> | null,
- manualConnectors: {
- name: string
- type: import('~/types').ManualLinkSourceType
- }[],
featureFlags: import('lib/logic/featureFlagLogic').FeatureFlagsSet,
- objectStorageSourcesEnabled: boolean,
dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null,
allowedSources: ExternalDataSourceType[] | undefined
): CatalogItem[] => {
@@ -412,26 +362,7 @@ export const sourceCatalogLogic = kea<sourceCatalogLogicType>([
]
})
- const selfManaged = manualConnectors.map(
- (source): CatalogItem => ({
- name: source.type,
- label: source.name,
- iconType: source.type,
- category: MANUAL_SOURCE_CATEGORY,
- keywords: [
- ...(MANUAL_SOURCE_KEYWORDS[source.type] ?? []),
- ...FILE_STORAGE_FORMAT_KEYWORDS,
- ...SELF_MANAGED_KEYWORDS,
- ],
- status: 'stable',
- url: urls.dataWarehouseSourceNew(source.type),
- selfManaged: true,
- })
- )
-
- // File upload isn't a `manualConnector` (those link a user's own bucket). Without managed
- // object storage sources it is self-managed too; with them it is a managed source.
- // One entry with three tiles, one per format, since users search for "CSV" rather
+ // File upload has three tiles, one per format, since users search for "CSV" rather
// than "File upload".
const fileUpload = FILE_UPLOAD_FORMATS.map(
({ format, label, keywords }): CatalogItem => ({
@@ -439,11 +370,10 @@ export const sourceCatalogLogic = kea<sourceCatalogLogicType>([
label,
iconType: FILE_UPLOAD_SOURCE_NAME,
category: MANUAL_SOURCE_CATEGORY,
- keywords: objectStorageSourcesEnabled ? keywords : [...keywords, ...SELF_MANAGED_KEYWORDS],
+ keywords,
status: 'stable',
releaseStatus: FILE_UPLOAD_SOURCE_CONFIG.releaseStatus,
url: fileUploadSourceUrl(format),
- selfManaged: !objectStorageSourcesEnabled,
})
)
@@ -452,7 +382,7 @@ export const sourceCatalogLogic = kea<sourceCatalogLogicType>([
const eventSources =
!allowedSources && featureFlags[FEATURE_FLAGS.CDP_HOG_SOURCES] ? EVENT_SOURCE_CATALOG_ITEMS : []
- const items = [...managed, ...selfManaged, ...fileUpload, ...eventSources]
+ const items = [...managed, ...fileUpload, ...eventSources]
const connectableNames = new Set(
items.filter((item) => item.status !== 'coming_soon').map((item) => item.name)
)
@@ -630,7 +560,7 @@ export const sourceCatalogLogic = kea<sourceCatalogLogicType>([
if (!isSourceCategoryFilter(category) || category === values.selectedCategory) {
return
}
- if (category === SELF_MANAGED_CATEGORY && values.objectStorageSourcesEnabled) {
+ if (category === SELF_MANAGED_CATEGORY) {
return
}
actions.setSelectedCategory(category)
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic.tsx b/products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic.tsx
index 84a5a5338751..3b9005e03d5b 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic.tsx
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/sourceWizardLogic.tsx
@@ -57,7 +57,6 @@ import {
import type { WebhookCreateResult } from '../../shared/components/forms/WebhookSetupForm'
import { sourceManagementLogic } from '../../shared/logics/sourceManagementLogic'
import { clonePayloadPreservingFiles, findUploadedFiles, readJsonFile } from '../../shared/sourceFieldFiles'
-import { MANUAL_LINK_SOURCE_LABELS } from '../../shared/storageProvider'
import { destinationStepBlockReason, shouldShowDestinationStep } from './components/destinationStepUtils'
import { FILE_UPLOAD_SOURCE_CONFIG, FILE_UPLOAD_SOURCE_NAME } from './fileUploadSource'
import { selfManagedSourceLogic } from './selfManagedSourceLogic'
@@ -528,10 +527,6 @@ export interface sourceWizardLogicValues {
isWebhookFieldInputsSubmitting: boolean
isWebhookFieldInputsValid: boolean
isWrapped: boolean
- manualConnectors: {
- name: string
- type: ManualLinkSourceType
- }[]
manualLinkingProvider: ManualLinkSourceType | null
modalTitle:
| ''
@@ -545,7 +540,6 @@ export interface sourceWizardLogicValues {
nextButtonDisabledReason: string | null
nextButtonText: string
oauthRedirectUrl: string | undefined
- objectStorageSourcesEnabled: boolean
prefixRequired: boolean
requiredTables: any
returnConfig: {
@@ -984,14 +978,7 @@ export interface sourceWizardLogicMeta {
requiredTables: (arg: any) => any
defaultSourceConnectionDetails: (selectedConnector: SourceConfigResponseApi | null) => Record<string, unknown>
suggestedTablesMap: (selectedConnector: SourceConfigResponseApi | null) => Record<string, string | null>
- breadcrumbs: (
- selectedConnector: SourceConfigResponseApi | null,
- manualLinkingProvider: 'aws' | 'azure' | 'cloudflare-r2' | 'google-cloud' | null,
- manualConnectors: {
- name: string
- type: ManualLinkSourceType
- }[]
- ) => Breadcrumb[]
+ breadcrumbs: (selectedConnector: SourceConfigResponseApi | null) => Breadcrumb[]
hasWebhookSchemas: (databaseSchema: ExternalDataSourceSyncSchema[]) => boolean
webhookNeedsManualConfirmation: (
webhookResult: WebhookCreateResult | null,
@@ -1059,11 +1046,6 @@ export interface sourceWizardLogicMeta {
dataWarehouseSources: PaginatedResponse<ExternalDataSource> | null,
availableSources: any
) => SourceConfigResponseApi[]
- objectStorageSourcesEnabled: (featureFlags: FeatureFlagsSet) => boolean
- manualConnectors: (objectStorageSourcesEnabled: boolean) => {
- name: string
- type: ManualLinkSourceType
- }[]
isSelfManagedSource: (
manualLinkingProvider: 'aws' | 'azure' | 'cloudflare-r2' | 'google-cloud' | null
) => boolean
@@ -1667,15 +1649,8 @@ export const sourceWizardLogic = kea<sourceWizardLogicType>([
},
],
breadcrumbs: [
- (s) => [s.selectedConnector, s.manualLinkingProvider, s.manualConnectors],
- (
- selectedConnector: SourceConfigResponseApi | null,
- manualLinkingProvider: ManualLinkSourceType | null,
- manualConnectors: {
- name: string
- type: ManualLinkSourceType
- }[]
- ): Breadcrumb[] => {
+ (s) => [s.selectedConnector],
+ (selectedConnector: SourceConfigResponseApi | null): Breadcrumb[] => {
return [
{
key: Scene.Sources,
@@ -1685,11 +1660,7 @@ export const sourceWizardLogic = kea<sourceWizardLogicType>([
},
{
key: Scene.DataWarehouseSource,
- name:
- selectedConnector?.label ??
- (manualLinkingProvider
- ? manualConnectors.find((c) => c.type === manualLinkingProvider)?.name
- : 'New'),
+ name: selectedConnector?.label ?? 'New',
iconType: 'data_pipeline',
},
]
@@ -1939,22 +1910,6 @@ export const sourceWizardLogic = kea<sourceWizardLogicType>([
}))
},
],
- // The managed object storage sources replace self-managed tables, so no new ones are created.
- objectStorageSourcesEnabled: [
- (s) => [s.featureFlags],
- (featureFlags: FeatureFlagsSet): boolean =>
- !!featureFlags[FEATURE_FLAGS.DATA_WAREHOUSE_OBJECT_STORAGE_SOURCES],
- ],
- manualConnectors: [
- (s) => [s.objectStorageSourcesEnabled],
- (objectStorageSourcesEnabled: boolean): { name: string; type: ManualLinkSourceType }[] =>
- objectStorageSourcesEnabled
- ? []
- : manualLinkSources.map((source) => ({
- name: MANUAL_LINK_SOURCE_LABELS[source],
- type: source,
- })),
- ],
isSelfManagedSource: [
(s) => [s.manualLinkingProvider],
(manualLinkingProvider: ManualLinkSourceType | null): boolean => manualLinkingProvider !== null,
@@ -2908,8 +2863,8 @@ export const sourceWizardLogic = kea<sourceWizardLogicType>([
actions.clearReturnConfig()
}
- // File upload has no backend connector (the uploaded file becomes a self-managed table),
- // so resolve its client-only synthetic config directly rather than from `connectors`.
+ // File upload isn't in the connector list, so resolve its client-only synthetic config
+ // directly rather than from `connectors`.
if (kind === FILE_UPLOAD_SOURCE_NAME.toLowerCase()) {
if (values.selectedConnector?.name === FILE_UPLOAD_SOURCE_NAME && values.currentStep > 1) {
return
@@ -2919,7 +2874,8 @@ export const sourceWizardLogic = kea<sourceWizardLogicType>([
return
}
- if (values.objectStorageSourcesEnabled && manualLinkSources.some((type) => type === kind)) {
+ // The managed object storage sources replace self-managed tables, so no new ones are created.
+ if (manualLinkSources.some((type) => type === kind)) {
actions.selectConnector(null)
actions.setStep(1)
router.actions.replace(urls.dataWarehouseSourceNew())
@@ -2927,16 +2883,6 @@ export const sourceWizardLogic = kea<sourceWizardLogicType>([
}
const source = values.connectors?.find((s) => s?.name?.toLowerCase?.() === kind)
- const manualSource = values.manualConnectors?.find((s) => s?.type?.toLowerCase() === kind)
-
- if (manualSource) {
- if (values.manualLinkingProvider === manualSource.type && values.currentStep > 1) {
- return
- }
- actions.toggleManualLinkFormVisible(true)
- actions.setManualLinkingProvider(manualSource.type)
- return
- }
if (source) {
if (
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceCatalogLogic.test.ts b/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceCatalogLogic.test.ts
index 97198a70dc61..32e29eb8a22a 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceCatalogLogic.test.ts
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/tests/sourceCatalogLogic.test.ts
@@ -54,7 +54,7 @@ const AVAILABLE_SOURCES: Record<string, SourceConfigResponseApi> = {
category: 'Engineering & monitoring',
fields: [],
} as unknown as SourceConfigResponseApi,
- // Unreleased duplicates of a connector that already works, `BingAds` and the self-managed `aws`.
+ // An unreleased duplicate of a connector that already works.
BingAds: {
name: 'BingAds',
label: 'Bing Ads',
@@ -67,10 +67,17 @@ const AVAILABLE_SOURCES: Record<string, SourceConfigResponseApi> = {
unreleasedSource: true,
fields: [],
} as unknown as SourceConfigResponseApi,
+ // Bucket sources, so a search for a file format or a bucket provider has something to find.
AmazonS3: {
name: 'AmazonS3',
label: 'Amazon S3',
- featureFlag: 'dwh-amazon-s3-test',
+ keywords: ['amazon', 'aws', 's3', 'bucket', 'csv', 'parquet'],
+ fields: [],
+ } as unknown as SourceConfigResponseApi,
+ GoogleCloudStorage: {
+ name: 'GoogleCloudStorage',
+ label: 'Google Cloud Storage',
+ keywords: ['gcs', 'gcp', 'bucket', 'csv', 'parquet'],
fields: [],
} as unknown as SourceConfigResponseApi,
}
@@ -156,27 +163,24 @@ describe('sourceCatalogLogic', () => {
})
// Each of these dead-ended on "no sources match" and pushed the user to request a source we
- // already have. "self-managed" is the name the sources list itself gives these connectors.
- it.each(['csv', 'parquet', 'self-managed', 'self managed', 'bring your own'])(
- 'surfaces the self-managed connectors when searching for "%s"',
- (search) => {
- const logic = sourceCatalogLogic()
- logic.actions.setSearch(search)
+ // already have.
+ it.each(['csv', 'parquet'])('surfaces the bucket sources when searching for "%s"', (search) => {
+ const logic = sourceCatalogLogic()
+ logic.actions.setSearch(search)
- expect(logic.values.filteredItems.map((item) => item.name)).toContain('aws')
- }
- )
+ expect(logic.values.filteredItems.map((item) => item.name)).toContain('AmazonS3')
+ })
// Fuse matches the whole search term as one pattern, so one extra word buries a term that
// matches on its own: each of these returned nothing at all, which sent the user to "request
// a source" for connectors we already have.
- it.each(['source files', 'parquet file storage', 'amazon s3 bucket'])(
+ it.each(['parquet file storage', 'amazon s3 bucket'])(
'retries a multi-word search word by word for "%s"',
(search) => {
const logic = sourceCatalogLogic()
logic.actions.setSearch(search)
- expect(logic.values.filteredItems.some((item) => item.selfManaged)).toBe(true)
+ expect(logic.values.filteredItems.length).toBeGreaterThan(0)
}
)
@@ -184,11 +188,11 @@ describe('sourceCatalogLogic', () => {
const logic = sourceCatalogLogic()
logic.actions.setSearch('amazon gcs gcp')
- // `google-cloud` matches "gcs" and "gcp"; `aws` only "amazon". The closer match must lead,
- // even though the first word found `aws` and word order alone would keep it first.
+ // `GoogleCloudStorage` matches "gcs" and "gcp"; `AmazonS3` only "amazon". The closer match must
+ // lead, even though the first word found `AmazonS3` and word order alone would keep it first.
const names = logic.values.filteredItems.map((item) => item.name)
- expect(names).toContain('aws')
- expect(names.indexOf('google-cloud')).toBeLessThan(names.indexOf('aws'))
+ expect(names).toContain('AmazonS3')
+ expect(names.indexOf('GoogleCloudStorage')).toBeLessThan(names.indexOf('AmazonS3'))
})
// "database" already found these through the category name. The word in the product's own
@@ -247,94 +251,26 @@ describe('sourceCatalogLogic', () => {
}
)
- // No other test covers narrowing the catalog by category: `self-managed` is the one filter that
- // narrows on the connection model rather than on `item.category`, so it needs its own coverage.
- it('narrows the catalog to the self-managed connectors', () => {
+ it('lists no self-managed tiles and ignores a self-managed category link', () => {
const logic = sourceCatalogLogic()
- const selfManagedCount = logic.values.catalogItems.filter((item) => item.selfManaged).length
- expect(selfManagedCount).toBeGreaterThan(0)
-
- expect(logic.values.categoriesWithCounts).toContainEqual({
- category: 'self-managed',
- label: 'Self-managed',
- count: selfManagedCount,
- })
-
- logic.actions.setSelectedCategory('self-managed')
- expect(logic.values.filteredItems).toHaveLength(selfManagedCount)
- expect(logic.values.filteredItems.every((item) => item.selfManaged)).toBe(true)
- expect(logic.values.selectedCategoryLabel).toEqual('Self-managed')
- })
-
- describe('with managed object storage sources', () => {
- afterEach(() => {
- // The flag outlives the test otherwise, and the catalog tests below expect it off.
- featureFlagLogic.actions.setFeatureFlags([], {})
- })
-
- it.each([
- { enabled: false, expectSelfManaged: true },
- { enabled: true, expectSelfManaged: false },
- ])(
- 'self-managed tiles and category with object storage sources enabled=$enabled',
- ({ enabled, expectSelfManaged }) => {
- featureFlagLogic.actions.setFeatureFlags([], {
- [FEATURE_FLAGS.DATA_WAREHOUSE_OBJECT_STORAGE_SOURCES]: enabled,
- })
- const logic = sourceCatalogLogic()
- const selfManagedNames = ['aws', 'google-cloud', 'cloudflare-r2', 'azure']
-
- const presentNames = logic.values.catalogItems.map((item) => item.name)
- const hasCategory = logic.values.categoriesWithCounts.some((cat) => cat.category === 'self-managed')
-
- expect(selfManagedNames.some((name) => presentNames.includes(name))).toBe(expectSelfManaged)
- expect(hasCategory).toBe(expectSelfManaged)
- expect(logic.values.catalogItems.some((item) => item.selfManaged)).toBe(expectSelfManaged)
- }
- )
-
- it.each([
- { enabled: false, expectSelfManaged: true },
- { enabled: true, expectSelfManaged: false },
- ])(
- 'file upload tiles are self-managed and searchable as such with object storage sources enabled=$enabled',
- ({ enabled, expectSelfManaged }) => {
- featureFlagLogic.actions.setFeatureFlags([], {
- [FEATURE_FLAGS.DATA_WAREHOUSE_OBJECT_STORAGE_SOURCES]: enabled,
- })
- const logic = sourceCatalogLogic()
-
- const uploadTiles = logic.values.catalogItems.filter((item) => item.name.startsWith('FileUpload-'))
- expect(uploadTiles).toHaveLength(3)
- for (const tile of uploadTiles) {
- expect(!!tile.selfManaged).toBe(expectSelfManaged)
- expect(tile.keywords.includes('selfmanaged')).toBe(expectSelfManaged)
- }
- }
- )
-
- it('ignores a self-managed category link when object storage sources are enabled', () => {
- featureFlagLogic.actions.setFeatureFlags([], {
- [FEATURE_FLAGS.DATA_WAREHOUSE_OBJECT_STORAGE_SOURCES]: true,
- })
- const logic = sourceCatalogLogic()
- router.actions.push(urls.dataPipelinesNew('source'), { category: 'self-managed' })
+ expect(logic.values.catalogItems.some((item) => item.selfManaged)).toBe(false)
+ expect(logic.values.categoriesWithCounts.some((cat) => cat.category === 'self-managed')).toBe(false)
- expect(logic.values.selectedCategory).toEqual('all')
- })
+ router.actions.push(urls.dataPipelinesNew('source'), { category: 'self-managed' })
+ expect(logic.values.selectedCategory).toEqual('all')
})
it('opens on the category the sources list linked to', () => {
const logic = sourceCatalogLogic()
expect(logic.values.selectedCategory).toEqual('all')
- router.actions.push(urls.dataPipelinesNew('source'), { category: 'self-managed' })
- expect(logic.values.selectedCategory).toEqual('self-managed')
+ router.actions.push(urls.dataPipelinesNew('source'), { category: 'Databases' })
+ expect(logic.values.selectedCategory).toEqual('Databases')
// An unknown value leaves the catalog as it is rather than filtering it down to nothing.
router.actions.push(urls.dataPipelinesNew('source'), { category: 'not-a-category' })
- expect(logic.values.selectedCategory).toEqual('self-managed')
+ expect(logic.values.selectedCategory).toEqual('Databases')
})
it('clears the request text when the modal is closed', () => {
@@ -383,25 +319,14 @@ describe('sourceCatalogLogic', () => {
}
)
- it.each([
- { search: 'microsoft advertising', hidden: ['MicrosoftAdvertising'], live: 'BingAds', flagOn: false },
- { search: 'amazon s3', hidden: ['AmazonS3'], live: 'aws', flagOn: false },
- { search: 'amazon s3', hidden: [], live: 'AmazonS3', flagOn: true },
- ])(
- 'offers $live and not a "Coming soon" duplicate for "$search" (flag on: $flagOn)',
- ({ search, hidden, live, flagOn }) => {
- const logic = sourceCatalogLogic()
- featureFlagLogic.mount()
- featureFlagLogic.actions.setFeatureFlags(flagOn ? ['dwh-amazon-s3-test'] : [], {
- 'dwh-amazon-s3-test': flagOn,
- })
- logic.actions.setSearch(search)
+ it('offers BingAds and not a "Coming soon" duplicate for "microsoft advertising"', () => {
+ const logic = sourceCatalogLogic()
+ logic.actions.setSearch('microsoft advertising')
- const names = logic.values.filteredItems.map((item) => item.name)
- expect(names).toContain(live)
- expect(names.filter((name) => hidden.includes(name))).toEqual([])
- }
- )
+ const names = logic.values.filteredItems.map((item) => item.name)
+ expect(names).toContain('BingAds')
+ expect(names).not.toContain('MicrosoftAdvertising')
+ })
it('flags the source types the project already has', () => {
const logic = sourceCatalogLogic()
diff --git a/products/data_warehouse/frontend/scenes/SourceScene/tabs/ReplaceFileModal.tsx b/products/data_warehouse/frontend/scenes/SourceScene/tabs/ReplaceFileModal.tsx
index 9033b417fb4a..528b374825b0 100644
--- a/products/data_warehouse/frontend/scenes/SourceScene/tabs/ReplaceFileModal.tsx
+++ b/products/data_warehouse/frontend/scenes/SourceScene/tabs/ReplaceFileModal.tsx
@@ -2,7 +2,6 @@ import { useActions, useValues } from 'kea'
import { LemonBanner, LemonButton, LemonModal, LemonSelect, Spinner } from '@posthog/lemon-ui'
-import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonFileInput } from 'lib/lemon-ui/LemonFileInput/LemonFileInput'
import { LemonProgress } from 'lib/lemon-ui/LemonProgress'
@@ -25,7 +24,6 @@ export function ReplaceFileModal({ sourceId }: { sourceId: string }): JSX.Elemen
uploadPercent,
} = useValues(logic)
const { closeReplaceFile, selectFile, setFileFormat, submitReplaceFile } = useActions(logic)
- const objectStorageSourcesEnabled = useFeatureFlag('DATA_WAREHOUSE_OBJECT_STORAGE_SOURCES')
const busyReason = isReplacing ? 'The file is being replaced' : undefined
@@ -81,11 +79,9 @@ export function ReplaceFileModal({ sourceId }: { sourceId: string }): JSX.Elemen
disabledReason={busyReason}
/>
</LemonField.Pure>
- {objectStorageSourcesEnabled && (
- <div className="text-xs text-secondary">
- Rows imported from this file count toward your data warehouse rows synced.
- </div>
- )}
+ <div className="text-xs text-secondary">
+ Rows imported from this file count toward your data warehouse rows synced.
+ </div>
{replaceStage === 'upload' ? (
<div className="flex flex-col gap-1" data-attr="replace-file-progress">
<LemonProgress percent={uploadPercent} />
diff --git a/products/data_warehouse/frontend/scenes/SourcesScene/SourcesList.tsx b/products/data_warehouse/frontend/scenes/SourcesScene/SourcesList.tsx
index c698968d4d32..72830b244d6a 100644
--- a/products/data_warehouse/frontend/scenes/SourcesScene/SourcesList.tsx
+++ b/products/data_warehouse/frontend/scenes/SourcesScene/SourcesList.tsx
@@ -1,27 +1,18 @@
-import { combineUrl } from 'kea-router'
-
import { IconPlusSmall } from '@posthog/icons'
import { LemonButton, LemonTag } from '@posthog/lemon-ui'
import { FlaggedFeature } from 'lib/components/FlaggedFeature'
-import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { HogFunctionList } from 'scenes/hog-functions/list/HogFunctionsList'
import { urls } from 'scenes/urls'
import { SceneDivider } from '~/layout/scenes/components/SceneDivider'
import { SceneSection } from '~/layout/scenes/components/SceneSection'
-import {
- CATEGORY_SEARCH_PARAM,
- SELF_MANAGED_CATEGORY,
-} from 'products/data_warehouse/frontend/scenes/NewSourceScene/sourceCategories'
import { DirectConnectSourcesTable } from 'products/data_warehouse/frontend/shared/components/DirectConnectSourcesTable'
import { ManagedSourcesTable } from 'products/data_warehouse/frontend/shared/components/ManagedSourcesTable'
import { SelfManagedSourcesTable } from 'products/data_warehouse/frontend/shared/components/SelfManagedSourcesTable'
export function SourcesList(): JSX.Element {
- const objectStorageSourcesEnabled = useFeatureFlag('DATA_WAREHOUSE_OBJECT_STORAGE_SOURCES')
-
return (
<div className="flex flex-col gap-4">
<SceneSection
@@ -73,23 +64,6 @@ export function SourcesList(): JSX.Element {
<SceneSection
title="Self-managed data warehouse sources"
description="Connect to your own data sources, making them queryable in PostHog"
- actions={
- objectStorageSourcesEnabled ? undefined : (
- <LemonButton
- type="primary"
- size="small"
- icon={<IconPlusSmall />}
- to={
- combineUrl(urls.dataPipelinesNew('source'), {
- [CATEGORY_SEARCH_PARAM]: SELF_MANAGED_CATEGORY,
- }).url
- }
- data-attr="new-self-managed-source"
- >
- New self-managed source
- </LemonButton>
- )
- }
>
<SelfManagedSourcesTable />
</SceneSection>
diff --git a/products/marketing_analytics/frontend/dashboard/SourceCatalog.tsx b/products/marketing_analytics/frontend/dashboard/SourceCatalog.tsx
index b7c2d79b0971..9a1063e2cc72 100644
--- a/products/marketing_analytics/frontend/dashboard/SourceCatalog.tsx
+++ b/products/marketing_analytics/frontend/dashboard/SourceCatalog.tsx
@@ -5,7 +5,6 @@ import { IconArrowRight, IconCheckCircle, IconExternal, IconInfo } from '@postho
import { LemonButton, LemonCard, LemonInput, Link, Tooltip } from '@posthog/lemon-ui'
import { pngHoggie } from 'lib/brand/hoggies'
-import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { addProjectIdIfMissing } from 'lib/utils/kea-router'
@@ -15,7 +14,6 @@ import { urls } from 'scenes/urls'
import { marketingAnalyticsLogic } from 'scenes/web-analytics/tabs/marketing-analytics/frontend/logic/marketingAnalyticsLogic'
import {
VALID_NON_NATIVE_MARKETING_SOURCES,
- VALID_SELF_MANAGED_MARKETING_SOURCES,
getEnabledNativeMarketingSourcesInDisplayOrder,
nativeSourceDisplayLabel,
} from 'scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utils'
@@ -29,7 +27,7 @@ const HedgehogMoney = pngHoggie(moneyPng)
interface MarketingSource {
id: string
isConnected: boolean
- category: 'native' | 'external' | 'self-managed'
+ category: 'native' | 'external'
}
interface SourceCatalogProps {
@@ -59,14 +57,6 @@ export function SourceCatalog({ onContinue, hasSources, onBack }: SourceCatalogP
isConnected: validExternalTables.some((table) => table.source_type === sourceType),
category: 'external' as const,
})),
- ...(featureFlags[FEATURE_FLAGS.DATA_WAREHOUSE_OBJECT_STORAGE_SOURCES]
- ? []
- : VALID_SELF_MANAGED_MARKETING_SOURCES
- ).map((sourceType) => ({
- id: sourceType,
- isConnected: validExternalTables.some((table) => table.source_type === sourceType),
- category: 'self-managed' as const,
- })),
]
const handleSourceSelect = (sourceId: string): void => {
@@ -95,11 +85,6 @@ export function SourceCatalog({ onContinue, hasSources, onBack }: SourceCatalogP
nativeSourceDisplayLabel(s.id).toLowerCase().includes(manualSourceSearch.toLowerCase()) &&
s.category === 'external'
)
- const selfManagedSources = allSources.filter(
- (s) =>
- nativeSourceDisplayLabel(s.id).toLowerCase().includes(manualSourceSearch.toLowerCase()) &&
- s.category === 'self-managed'
- )
const totalConnected = validNativeSources.length + validExternalTables.length
@@ -126,7 +111,7 @@ export function SourceCatalog({ onContinue, hasSources, onBack }: SourceCatalogP
value={manualSourceSearch}
onChange={setManualSourceSearch}
/>
- {!nativeSources.length && !externalSources.length && !selfManagedSources.length && (
+ {!nativeSources.length && !externalSources.length && (
<p className="text-secondary">No integrations match your search.</p>
)}
{/* Native Sources */}
@@ -160,26 +145,6 @@ export function SourceCatalog({ onContinue, hasSources, onBack }: SourceCatalogP
</div>
</div>
)}
-
- {/* Self-managed Sources */}
- {selfManagedSources.length > 0 && (
- <div>
- <div className="text-xs font-medium text-muted mb-1.5 flex items-center gap-1">
- Self-managed
- <Tooltip
- title="Connect your own data source (e.g. S3, GCS) where you already store marketing data."
- delayMs={0}
- >
- <IconInfo className="w-3 h-3 cursor-help" />
- </Tooltip>
- </div>
- <div className="flex flex-wrap gap-2">
- {selfManagedSources.map((source) => (
- <SourceChip key={source.id} source={source} onSelect={handleSourceSelect} />
- ))}
- </div>
- </div>
- )}
</div>
<div className="border-t p-4 flex flex-wrap items-center justify-between gap-3 bg-bg-light">
{onBack && (
diff --git a/products/warehouse_sources/backend/facade/file_upload_sources.py b/products/warehouse_sources/backend/facade/file_upload_sources.py
index a3a8bcdf4444..808d69f43fe0 100644
--- a/products/warehouse_sources/backend/facade/file_upload_sources.py
+++ b/products/warehouse_sources/backend/facade/file_upload_sources.py
@@ -10,8 +10,6 @@ Temporal client, so this module stays off the ``django.setup()`` path.
from uuid import UUID
-from posthog.models.team import Team
-
from products.warehouse_sources.backend import file_upload_sources as _service
from products.warehouse_sources.backend.facade.contracts import (
FileUploadSourceError,
@@ -37,7 +35,6 @@ __all__ = [
"can_replace_file",
"create_file_upload_source",
"discard_unused_upload",
- "file_upload_sources_enabled",
"has_file_upload_source",
"hosted_upload_in_use",
"is_legacy_upload_url",
@@ -50,17 +47,9 @@ __all__ = [
]
-def file_upload_sources_enabled(team_id: int) -> bool:
- team = Team.objects.only("id", "organization_id").get(pk=team_id)
- return _service.file_upload_sources_enabled(team)
-
-
def object_storage_sources_enabled(team_id: int) -> bool:
- """Whether the team has the managed object storage sources, which replace self-managed tables.
-
- One flag gates every object storage source and the file upload source, so this is the same check.
- """
- return file_upload_sources_enabled(team_id)
+ """Every team has the managed object storage sources, which replace self-managed tables."""
+ return True
def read_upload_in_place(team_id: int, table_name: str, upload: UploadedFileRef) -> UploadReadSettings:
diff --git a/products/warehouse_sources/backend/file_upload_sources.py b/products/warehouse_sources/backend/file_upload_sources.py
index ec3222e5a571..e6329acc4f12 100644
--- a/products/warehouse_sources/backend/file_upload_sources.py
+++ b/products/warehouse_sources/backend/file_upload_sources.py
@@ -22,7 +22,6 @@ import structlog
from posthog.dataclasses import frozen
from posthog.exceptions_capture import capture_exception
-from posthog.models.team import Team
from posthog.temporal.common.client import sync_connect
from products.data_warehouse.backend.facade.api import sync_external_data_job_workflow
@@ -55,9 +54,6 @@ from products.warehouse_sources.backend.models.external_data_schema import (
)
from products.warehouse_sources.backend.models.external_data_source import ExternalDataSource
from products.warehouse_sources.backend.models.table import DataWarehouseTable
-from products.warehouse_sources.backend.presentation.views.external_data_source.helpers import (
- source_feature_flag_missing,
-)
from products.warehouse_sources.backend.temporal.data_imports.sources.common.object_store.config import CsvOptions
from products.warehouse_sources.backend.temporal.data_imports.sources.common.object_store.csv_types import (
CsvColumnType,
@@ -141,10 +137,6 @@ def file_upload_source() -> FileUploadSource:
return FileUploadSource()
-def file_upload_sources_enabled(team: Team) -> bool:
- return not source_feature_flag_missing(file_upload_source(), team)
-
-
def upload_job_inputs(upload: UploadedFile, schema_name: str) -> dict[str, str]:
return {
"upload_id": upload.location.upload_id,
diff --git a/products/warehouse_sources/backend/management/commands/migrate_self_managed_tables.py b/products/warehouse_sources/backend/management/commands/migrate_self_managed_tables.py
index 3f714f475d62..4e219c7b6e41 100644
--- a/products/warehouse_sources/backend/management/commands/migrate_self_managed_tables.py
+++ b/products/warehouse_sources/backend/management/commands/migrate_self_managed_tables.py
@@ -31,9 +31,7 @@ class Command(BaseCommand):
"turns syncing on, and the first sync then replaces it with the same id and name. A table made from an "
"uploaded file gets a file upload source of its own, and its next uploaded file is the first sync. "
"Each source gets the access rules that keep every member's access to its tables, or the table stays "
- "self-managed. Runs only for teams "
- "with the object storage sources feature flag. Without --live-run the command only reports what it "
- "would do."
+ "self-managed. Without --live-run the command only reports what it would do."
)
def add_arguments(self, parser: CommandParser) -> None:
diff --git a/products/warehouse_sources/backend/presentation/views/external_data_source/credential_store.py b/products/warehouse_sources/backend/presentation/views/external_data_source/credential_store.py
index f604c37cb924..8b022462c834 100644
--- a/products/warehouse_sources/backend/presentation/views/external_data_source/credential_store.py
+++ b/products/warehouse_sources/backend/presentation/views/external_data_source/credential_store.py
@@ -21,7 +21,7 @@ from products.warehouse_sources.backend.facade.models import PendingSourceCreden
from products.warehouse_sources.backend.facade.source_management import known_source_key
from products.warehouse_sources.backend.presentation.views.external_data_source.source_type_field import SourceTypeField
-from . import base, helpers
+from . import base
class SourceConnectLinkSerializer(serializers.Serializer):
@@ -164,11 +164,6 @@ class ExternalDataSourceCredentialStoreMixin(base.ExternalDataSourceViewSetBase)
source_type_model = known_source_key(source_type)
source = base.SourceRegistry.get_source(source_type_model)
- if helpers.source_feature_flag_missing(source, self.team):
- return Response(
- status=status.HTTP_400_BAD_REQUEST,
- data={"message": helpers._source_unavailable_message(source_type)},
- )
error_response, _ = self._validate_source_config_and_credentials(source, source_type_model, payload)
if error_response is not None:
diff --git a/products/warehouse_sources/backend/presentation/views/external_data_source/helpers.py b/products/warehouse_sources/backend/presentation/views/external_data_source/helpers.py
index de18c4361798..5691d875ca6d 100644
--- a/products/warehouse_sources/backend/presentation/views/external_data_source/helpers.py
+++ b/products/warehouse_sources/backend/presentation/views/external_data_source/helpers.py
@@ -14,7 +14,6 @@ from rest_framework.exceptions import ValidationError
from posthog.dataclasses import frozen
from posthog.exceptions_capture import capture_exception
-from posthog.ph_client import feature_enabled_or_false
from products.data_warehouse.backend.facade.api import (
DirectQueryEngine,
@@ -54,7 +53,6 @@ from products.warehouse_sources.backend.facade.types import ManagedWarehouseSQLM
if TYPE_CHECKING:
from posthog.integrations import IntegrationUsage
- from posthog.models.team import Team
from products.access_control.backend.facade.user_access_control import AccessControlLevel, UserAccessControl
@@ -88,20 +86,6 @@ def _source_unavailable_message(source_type: str) -> str:
)
-def source_feature_flag_missing(source: AnySource, team: Team) -> bool:
- """Whether the team lacks the feature flag the source requires before the API serves it."""
- flag = source.requires_team_feature_flag
- if flag is None:
- return False
- organization_id = str(team.organization_id)
- return not feature_enabled_or_false(
- flag,
- organization_id,
- groups={"organization": organization_id, "project": str(team.id)},
- group_properties={"organization": {"id": organization_id}},
- )
-
-
def _canonical_legacy_managed_warehouse_source(
queryset: QuerySet[ExternalDataSource],
) -> ExternalDataSource | None:
diff --git a/products/warehouse_sources/backend/presentation/views/external_data_source/schema_operations.py b/products/warehouse_sources/backend/presentation/views/external_data_source/schema_operations.py
index 4920df29ec0b..92df487ab33d 100644
--- a/products/warehouse_sources/backend/presentation/views/external_data_source/schema_operations.py
+++ b/products/warehouse_sources/backend/presentation/views/external_data_source/schema_operations.py
@@ -382,11 +382,6 @@ class ExternalDataSourceSchemaOperationsMixin(base.ExternalDataSourceViewSetBase
data={"message": f"Unknown source_type '{source_type}'"},
)
source = base.SourceRegistry.get_source(source_type_model)
- if helpers.source_feature_flag_missing(source, self.team):
- return Response(
- status=status.HTTP_400_BAD_REQUEST,
- data={"message": helpers._source_unavailable_message(source_type)},
- )
is_valid, errors = source.validate_config(request.data)
if not is_valid:
return Response(
diff --git a/products/warehouse_sources/backend/presentation/views/external_data_source/source_setup.py b/products/warehouse_sources/backend/presentation/views/external_data_source/source_setup.py
index 9b19ee779d72..cdc088f28c49 100644
--- a/products/warehouse_sources/backend/presentation/views/external_data_source/source_setup.py
+++ b/products/warehouse_sources/backend/presentation/views/external_data_source/source_setup.py
@@ -1361,11 +1361,6 @@ class ExternalDataSourceSetupMixin(base.ExternalDataSourceViewSetBase):
).data,
status=status.HTTP_400_BAD_REQUEST,
)
- if helpers.source_feature_flag_missing(source, self.team):
- return Response(
- status=status.HTTP_400_BAD_REQUEST,
- data={"message": helpers._source_unavailable_message(source_type)},
- )
max_instances = source.max_instances_per_team
if max_instances is not None and helpers.count_active_sources(self.team_id, source_type_model) >= max_instances:
return Response(
@@ -2289,11 +2284,6 @@ class ExternalDataSourceSetupMixin(base.ExternalDataSourceViewSetBase):
source_type_model = known_source_key(source_type)
source = base.SourceRegistry.get_source(source_type_model)
- if helpers.source_feature_flag_missing(source, self.team):
- return Response(
- status=status.HTTP_400_BAD_REQUEST,
- data={"message": helpers._source_unavailable_message(source_type)},
- )
error_response, source_config = self._validate_source_config_and_credentials(source, source_type_model, payload)
if error_response is not None or source_config is None:
diff --git a/products/warehouse_sources/backend/self_managed_migration.py b/products/warehouse_sources/backend/self_managed_migration.py
index 6c6459aad117..d0f55ad4f61e 100644
--- a/products/warehouse_sources/backend/self_managed_migration.py
+++ b/products/warehouse_sources/backend/self_managed_migration.py
@@ -47,7 +47,6 @@ from botocore.config import Config as BotoConfig
from botocore.exceptions import BotoCoreError, ClientError
from posthog.dataclasses import frozen
-from posthog.models.team import Team
from products.data_warehouse.backend.facade.api import delete_external_data_schedule
from products.warehouse_sources.backend.facade.contracts import UploadReadSettings
@@ -79,9 +78,6 @@ from products.warehouse_sources.backend.models.external_data_schema import (
)
from products.warehouse_sources.backend.models.external_data_source import ExternalDataSource
from products.warehouse_sources.backend.models.table import DataWarehouseTable
-from products.warehouse_sources.backend.presentation.views.external_data_source.helpers import (
- source_feature_flag_missing,
-)
from products.warehouse_sources.backend.self_managed_access import (
MIGRATION_MARKER_KEY,
SourceAccessPlan,
@@ -361,13 +357,12 @@ def _lock_group(team_id: int, source_type: str, group_key: str, fingerprint: str
class _Planner:
- """Maps tables onto sources, caching the per-team flag check and the per-bucket region lookup."""
+ """Maps tables onto sources, caching the per-bucket region lookup."""
def __init__(self, resolve_region: BucketRegionResolver) -> None:
self._resolve_region = resolve_region
self._sources = _object_storage_sources()
self._upload_source = file_upload_source()
- self._flag_missing: dict[tuple[int, str], bool] = {}
self._regions: dict[tuple[str, str], str | None] = {}
self._access: dict[int, TeamAccessRules] = {}
@@ -392,8 +387,6 @@ class _Planner:
source = self._sources.get(location.service)
if source is None:
return f"no import source reads '{location.service}' storage"
- if self._team_lacks_flag(table.team, source):
- return f"the team doesn't have the '{source.requires_team_feature_flag}' feature flag"
if location.service == "s3" and location.region is None:
region = self._region(table, location, credential, fingerprint)
if region is None:
@@ -426,8 +419,6 @@ class _Planner:
) -> _TablePlan | str:
"""A table that reads a file the team uploaded gets a file upload source of its own."""
source = self._upload_source
- if self._team_lacks_flag(table.team, source):
- return f"the team doesn't have the '{source.requires_team_feature_flag}' feature flag"
file_format = TABLE_FORMAT_TO_FILE_FORMAT.get(table.format)
if file_format is None:
return f"an uploaded '{table.format}' file has no import equivalent"
@@ -456,12 +447,6 @@ class _Planner:
access=access,
)
- def _team_lacks_flag(self, team: Team, source: ObjectStorageSource[Any] | FileUploadSource) -> bool:
- key = (team.pk, str(source.source_type))
- if key not in self._flag_missing:
- self._flag_missing[key] = source_feature_flag_missing(source, team)
- return self._flag_missing[key]
-
def _region(
self,
table: DataWarehouseTable,
@@ -537,7 +522,7 @@ def _select_tables(
"""Self-managed tables, plus every table the migration made a schema for, oldest first.
A table that another source's schema already links to is left out: a table made from an upload
- while the team had the flag waits for the first sync of its own file upload source.
+ through a file upload source waits for the first sync of that source.
"""
queryset = (
DataWarehouseTable.raw_objects.exclude(deleted=True)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/base.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/base.py
index 5353c6718948..5b212a75137f 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/base.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/base.py
@@ -662,11 +662,6 @@ class _BaseSource(ABC, Generic[ConfigType]):
incoming and existing inputs so a source can gate on context. Default: none."""
return []
- # Feature flag a team must have before the API lets it discover tables for or create a source of
- # this type. `SourceConfig.featureFlag` only hides the source in the UI, so a source that must
- # not be reachable through the API without the flag sets this as well.
- requires_team_feature_flag: str | None = None
-
# Top-level ``job_inputs`` keys that hold server-written runtime state, such as a pointer to an
# uploaded file. They are neither credentials nor settings a person picks, so they stay in
# ``job_inputs`` when the connection fields move to their own store. Keys that start with
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/common/object_store/fields.py b/products/warehouse_sources/backend/temporal/data_imports/sources/common/object_store/fields.py
index 306a69c00c70..040e8abf0862 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/common/object_store/fields.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/common/object_store/fields.py
@@ -14,7 +14,6 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.obj
FileFormatChoice,
)
-FEATURE_FLAG = "dwh-object-storage-sources"
KEYWORDS = ["bucket", "csv", "parquet", "delta lake"]
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/file_upload/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/file_upload/source.py
index d159856ffd90..736146a59e3b 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/file_upload/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/file_upload/source.py
@@ -35,7 +35,6 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.obj
NO_TABLE_FILES_ERROR,
ObjectStorageError,
)
-from products.warehouse_sources.backend.temporal.data_imports.sources.common.object_store.fields import FEATURE_FLAG
from products.warehouse_sources.backend.temporal.data_imports.sources.common.object_store.filesystem import ObjectStore
from products.warehouse_sources.backend.temporal.data_imports.sources.common.object_store.formats import (
iter_file_tables,
@@ -127,7 +126,6 @@ class FileUploadSource(SimpleSource[FileUploadInputs]):
at creation, and once each time the file is replaced. The schema's schedule stays paused.
"""
- requires_team_feature_flag = FEATURE_FLAG
syncs_on_demand = True
listed_in_catalog = False
# A file someone uploads leaves no trace in a codebase.
@@ -152,7 +150,6 @@ class FileUploadSource(SimpleSource[FileUploadInputs]):
caption="Upload a CSV, JSON, or Parquet file to query it in the PostHog data warehouse.",
iconPath="/static/services/file-upload.svg",
releaseStatus=ReleaseStatus.ALPHA,
- featureFlag=FEATURE_FLAG,
fields=[],
)
diff --git a/products/warehouse_sources/backend/tests/api/test_external_data_source.py b/products/warehouse_sources/backend/tests/api/test_external_data_source.py
index cf1201cac92a..efca0a0bbe96 100644
--- a/products/warehouse_sources/backend/tests/api/test_external_data_source.py
+++ b/products/warehouse_sources/backend/tests/api/test_external_data_source.py
@@ -184,7 +184,6 @@ def _configure_source_mock_versioning(mock_get_source) -> None:
mock_get_source.return_value.default_version = "v1"
mock_get_source.return_value.get_version_deprecation.return_value = None
mock_get_source.return_value.max_instances_per_team = None
- mock_get_source.return_value.requires_team_feature_flag = None
mock_get_source.return_value.connection_host_fields = []
mock_get_source.return_value.detects_primary_keys = False
mock_get_source.return_value.server_managed_job_input_fields.return_value = []
@@ -6495,7 +6494,6 @@ class TestExternalDataSource(APIBaseTest):
]
mock_source.get_endpoint_permissions.return_value = {}
mock_source.detects_primary_keys = False
- mock_source.requires_team_feature_flag = None
response = self.client.post(
f"/api/environments/{self.team.pk}/external_data_sources/database_schema/",
@@ -9573,44 +9571,6 @@ class TestExternalDataSource(APIBaseTest):
else:
assert response.json()["message"] != limit_message
- @parameterized.expand(
- [
- ("create_without_flag", "", False),
- ("create_with_flag", "", True),
- ("database_schema_without_flag", "database_schema/", False),
- ("database_schema_with_flag", "database_schema/", True),
- ("setup_without_flag", "setup/", False),
- ("setup_with_flag", "setup/", True),
- ("store_credentials_without_flag", "store_credentials/", False),
- ("store_credentials_with_flag", "store_credentials/", True),
- ]
- )
- def test_source_behind_a_team_feature_flag(self, _name: str, path: str, flag_enabled: bool) -> None:
- payload = {"tenant": "acme", "api_key": "key"}
- with (
- patch.object(SourceRegistry, "get_source", return_value=_ConnectionGateSource()),
- patch.object(_ConnectionGateSource, "requires_team_feature_flag", "connection-gate-test-flag"),
- patch.object(
- _ConnectionGateSource,
- "validate_credentials",
- return_value=(False, "The test credentials were rejected."),
- ),
- patch(
- "products.warehouse_sources.backend.presentation.views.external_data_source.helpers.feature_enabled_or_false",
- return_value=flag_enabled,
- ),
- ):
- response = self.client.post(
- f"/api/environments/{self.team.pk}/external_data_sources/{path}",
- data={"source_type": ExternalDataSourceType.TRINO, "prefix": "gate_", "payload": payload, **payload},
- )
-
- assert response.status_code == status.HTTP_400_BAD_REQUEST
- # With the flag the request reaches credential validation.
- expected = "The test credentials were rejected." if flag_enabled else "isn't available to connect yet"
- assert expected in response.json()["message"]
- assert not ExternalDataSource.objects.filter(team_id=self.team.pk).exists()
-
def test_revenue_analytics_config_created_automatically(self):
source = self._create_external_data_source()
diff --git a/products/warehouse_sources/backend/tests/test_self_managed_migration.py b/products/warehouse_sources/backend/tests/test_self_managed_migration.py
index a71d38ff6c40..938ea20f3e4c 100644
--- a/products/warehouse_sources/backend/tests/test_self_managed_migration.py
+++ b/products/warehouse_sources/backend/tests/test_self_managed_migration.py
@@ -141,7 +141,6 @@ class _MigrationTest(BaseTest):
def setUp(self) -> None:
super().setUp()
patches = [
- patch(f"{MODULE}.source_feature_flag_missing", return_value=False),
patch(f"{MODULE}.delete_external_data_schedule"),
# The location check resolves the bucket host, and these example buckets don't exist.
patch.object(source_base, "validate_warehouse_table_url_pattern", return_value=(True, "")),
@@ -149,7 +148,7 @@ class _MigrationTest(BaseTest):
mocks = [p.start() for p in patches]
for p in patches:
self.addCleanup(p.stop)
- self.flag_missing, self.delete_schedule, _ = mocks
+ self.delete_schedule, _ = mocks
self.credential = self._credential("AKIAFIRST")
def _credential(self, access_key: str, access_secret: str = "c2VjcmV0") -> DataWarehouseCredential:
@@ -487,16 +486,6 @@ class TestSelfManagedMigration(_MigrationTest):
assert outcome.action == "none"
assert not ExternalDataSchema.objects.filter(team=self.team).exists()
- def test_teams_without_the_flag_are_skipped(self) -> None:
- self.flag_missing.return_value = True
- self._table()
-
- [outcome] = self._migrate()
-
- assert outcome.status.state == TableMigrationState.SKIPPED
- assert "dwh-object-storage-sources" in (outcome.status.reason or "")
- assert not ExternalDataSchema.objects.filter(team=self.team).exists()
-
def test_status_reports_every_state(self) -> None:
pending = self._table("pending_table")
self._table("skipped_table", url="https://minio.example.com/exports/a.csv")
@@ -1004,7 +993,6 @@ class TestDeletingAMigrationSchema(APIBaseTest):
def setUp(self) -> None:
super().setUp()
patches = [
- patch(f"{MODULE}.source_feature_flag_missing", return_value=False),
patch.object(source_base, "validate_warehouse_table_url_pattern", return_value=(True, "")),
patch(f"{SOURCE_VIEWS}.base.bulk_delete_external_data_schedules", return_value=[]),
patch(f"{SOURCE_VIEWS}.base.delete_external_data_schedule"),
@@ -1224,23 +1212,13 @@ class TestUploadedTableMigration(_MigrationTest):
assert merge_duplicate_sources(team_id=self.team.pk, live_run=True) == []
assert ExternalDataSource.objects.filter(team=self.team, deleted=False).count() == 2
- def test_teams_without_the_flag_keep_their_uploaded_tables(self) -> None:
- self.flag_missing.return_value = True
- self._uploaded("orders", "file_uploads/team_{team}/{upload}/orders.csv")
-
- [outcome] = self._migrate()
-
- assert outcome.status.state == TableMigrationState.SKIPPED
- assert "dwh-object-storage-sources" in (outcome.status.reason or "")
- assert not ExternalDataSource.objects.filter(team=self.team).exists()
-
def test_selection_takes_only_the_teams_own_uploaded_tables(self) -> None:
self._uploaded("uploaded", "file_uploads/team_{team}/{upload}/orders.csv")
self._uploaded("legacy", "managed/team_{team}/orders.csv")
self._uploaded("materialized_view", "dlt/team_{team}_model_abc/modeling/orders")
self._uploaded("another_teams_file", "managed/team_999999/orders.csv")
self._uploaded("nested_key", "managed/team_{team}/sub/orders.csv")
- # A table made with the flag on links to its own file upload source and waits for its first sync.
+ # A table made from an upload links to its own file upload source and waits for its first sync.
waiting = self._uploaded("waiting", "file_uploads/team_{team}/{upload}/waiting.csv")
upload_source = ExternalDataSource.objects.create(team=self.team, source_type="FileUpload", job_inputs={})
ExternalDataSchema.objects.create(name="waiting", team=self.team, source=upload_source, table=waiting)
diff --git a/products/warehouse_sources/sources/amazon_s3/source.py b/products/warehouse_sources/sources/amazon_s3/source.py
index b78553e2c428..6f41092c74e6 100644
--- a/products/warehouse_sources/sources/amazon_s3/source.py
+++ b/products/warehouse_sources/sources/amazon_s3/source.py
@@ -3,7 +3,6 @@ from typing import Any, cast
from products.warehouse_sources.sources.amazon_s3._config import AmazonS3SourceConfig
from products.warehouse_sources.sources.sdk import (
- FEATURE_FLAG,
KEYWORDS,
S3_EXAMPLE_URL,
DataWarehouseSourceCategory,
@@ -42,7 +41,6 @@ class AmazonS3Source(ObjectStorageSource[AmazonS3SourceConfig]):
)
api_docs_url = "https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html"
- requires_team_feature_flag = FEATURE_FLAG
self_managed_service = "s3"
@property
@@ -93,7 +91,6 @@ class AmazonS3Source(ObjectStorageSource[AmazonS3SourceConfig]):
caption=source_caption("an S3 bucket"),
iconPath="/static/services/aws-s3.png",
releaseStatus=ReleaseStatus.ALPHA,
- featureFlag=FEATURE_FLAG,
fields=cast(
list[FieldType],
[
diff --git a/products/warehouse_sources/sources/amazon_s3/tests/test_amazon_s3_source.py b/products/warehouse_sources/sources/amazon_s3/tests/test_amazon_s3_source.py
index 9d4012e3db8f..fbde91c7f736 100644
--- a/products/warehouse_sources/sources/amazon_s3/tests/test_amazon_s3_source.py
+++ b/products/warehouse_sources/sources/amazon_s3/tests/test_amazon_s3_source.py
@@ -403,12 +403,3 @@ def test_delta_sync_reads_from_the_stored_cursor_and_stages_the_next_one(
assert (response.replace_scope is not None) == (sync_type == ExternalDataSchemaSyncType.INCREMENTAL)
staged = cursor.staged_payload()
assert staged is not None and staged["data"]["version"] == 1
-
-
-def test_the_api_gates_the_source_behind_the_same_flag_as_the_ui() -> None:
- # `featureFlag` only hides the source in the UI. Without `requires_team_feature_flag` the API
- # would let any team discover tables for and create the source.
- source = AmazonS3Source()
-
- assert source.requires_team_feature_flag is not None
- assert source.requires_team_feature_flag == source.get_source_config.featureFlag
diff --git a/products/warehouse_sources/sources/azure_blob/source.py b/products/warehouse_sources/sources/azure_blob/source.py
index d82838a839f9..4372eaa395c9 100644
--- a/products/warehouse_sources/sources/azure_blob/source.py
+++ b/products/warehouse_sources/sources/azure_blob/source.py
@@ -3,7 +3,6 @@ from typing import Any, cast
from products.warehouse_sources.sources.azure_blob._config import AzureBlobSourceConfig
from products.warehouse_sources.sources.sdk import (
AZURE_EXAMPLE_URL,
- FEATURE_FLAG,
KEYWORDS,
AzureBlobConfig,
DataWarehouseSourceCategory,
@@ -38,7 +37,6 @@ class AzureBlobSource(ObjectStorageSource[AzureBlobSourceConfig]):
)
api_docs_url = "https://learn.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api"
- requires_team_feature_flag = FEATURE_FLAG
self_managed_service = "azure"
@property
@@ -78,7 +76,6 @@ class AzureBlobSource(ObjectStorageSource[AzureBlobSourceConfig]):
caption=source_caption("an Azure Blob Storage container"),
iconPath="/static/services/azure_blob.png",
releaseStatus=ReleaseStatus.ALPHA,
- featureFlag=FEATURE_FLAG,
fields=cast(
list[FieldType],
[
diff --git a/products/warehouse_sources/sources/cloudflare_r2/source.py b/products/warehouse_sources/sources/cloudflare_r2/source.py
index 642af9b51784..9101e4a88a9f 100644
--- a/products/warehouse_sources/sources/cloudflare_r2/source.py
+++ b/products/warehouse_sources/sources/cloudflare_r2/source.py
@@ -2,7 +2,6 @@ from typing import Any, cast
from products.warehouse_sources.sources.cloudflare_r2._config import CloudflareR2SourceConfig
from products.warehouse_sources.sources.sdk import (
- FEATURE_FLAG,
KEYWORDS,
R2_EXAMPLE_URL,
DataWarehouseSourceCategory,
@@ -34,7 +33,6 @@ class CloudflareR2Source(ObjectStorageSource[CloudflareR2SourceConfig]):
codebase_detection = detect(env=("^R2_", "^CLOUDFLARE_R2_"))
api_docs_url = "https://developers.cloudflare.com/r2/api/s3/api/"
- requires_team_feature_flag = FEATURE_FLAG
self_managed_service = "r2"
@property
@@ -76,7 +74,6 @@ class CloudflareR2Source(ObjectStorageSource[CloudflareR2SourceConfig]):
caption=source_caption("a Cloudflare R2 bucket"),
iconPath="/static/services/cloudflare.png",
releaseStatus=ReleaseStatus.ALPHA,
- featureFlag=FEATURE_FLAG,
fields=cast(
list[FieldType],
[
diff --git a/products/warehouse_sources/sources/google_cloud_storage/source.py b/products/warehouse_sources/sources/google_cloud_storage/source.py
index a166d95e96df..ef0bc073b27b 100644
--- a/products/warehouse_sources/sources/google_cloud_storage/source.py
+++ b/products/warehouse_sources/sources/google_cloud_storage/source.py
@@ -2,7 +2,6 @@ from typing import Any, cast
from products.warehouse_sources.sources.google_cloud_storage._config import GoogleCloudStorageSourceConfig
from products.warehouse_sources.sources.sdk import (
- FEATURE_FLAG,
GCS_EXAMPLE_URL,
KEYWORDS,
DataWarehouseSourceCategory,
@@ -38,7 +37,6 @@ class GoogleCloudStorageSource(ObjectStorageSource[GoogleCloudStorageSourceConfi
)
api_docs_url = "https://cloud.google.com/storage/docs/interoperability"
- requires_team_feature_flag = FEATURE_FLAG
self_managed_service = "gcs"
@property
@@ -80,7 +78,6 @@ class GoogleCloudStorageSource(ObjectStorageSource[GoogleCloudStorageSourceConfi
caption=source_caption("a Google Cloud Storage bucket"),
iconPath="/static/services/google-cloud-storage.png",
releaseStatus=ReleaseStatus.ALPHA,
- featureFlag=FEATURE_FLAG,
fields=cast(
list[FieldType],
[
diff --git a/products/warehouse_sources/sources/sdk/__init__.py b/products/warehouse_sources/sources/sdk/__init__.py
index 7de3d64a2fd1..4d396c6300e9 100644
--- a/products/warehouse_sources/sources/sdk/__init__.py
+++ b/products/warehouse_sources/sources/sdk/__init__.py
@@ -193,7 +193,6 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.obj
ObjectStoreProvider,
)
from products.warehouse_sources.backend.temporal.data_imports.sources.common.object_store.fields import (
- FEATURE_FLAG,
KEYWORDS,
discovery_options_from,
file_option_fields,
@@ -422,7 +421,6 @@ __all__ = [
"ExternalDataSource",
"ExternalDataSourceType",
"ExternalWebhookInfo",
- "FEATURE_FLAG",
"FILE_MODIFIED_AT_COLUMN",
"FILE_PATH_COLUMN",
"FORMAT_ERROR",