Skip to content

Commit b45bbf3

Browse files
authored
chore(config): retire unused env vars and fully-rolled-out feature flags (#8808)
* chore(config): retire unused env vars and fully-rolled-out feature flags * chore(helm): bump chart version for removed TABLE_ROW_TTL value
1 parent f09312d commit b45bbf3

70 files changed

Lines changed: 132 additions & 841 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/docs/content/docs/platform/connected-accounts.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Each organization has at most one pool. Creating it does not give any workspace
1111

1212
## Availability
1313

14-
Connected accounts must be enabled for your organization. Sim Cloud also requires an active Enterprise plan. Organization owners and admins manage the pool, subject to the organization's permission settings. A workspace admin who is not an organization admin cannot change the pool or its workspace access.
14+
Sim Cloud requires an active Enterprise plan. Organization owners and admins manage the pool, subject to the organization's permission settings. A workspace admin who is not an organization admin cannot change the pool or its workspace access.
1515

16-
For self-hosted deployments using environment-based feature flags, set `CREDENTIAL_GROUPS=true`. Availability is organization-scoped; personal workspaces cannot use an organization pool.
16+
For self-hosted deployments, set `CREDENTIAL_GROUPS=true`, or `ENTERPRISE_ENABLED=true` to enable the whole enterprise suite. Availability is organization-scoped; personal workspaces cannot use an organization pool.
1717

1818
Manage the pool under **Settings → Credential Groups**. It remains available independently of Search. Search administrators use **Settings → Sources**, while members connect personal Search accounts under **Integrations** in the main sidebar. These surfaces can share grants without sharing their purpose or resource settings.
1919

‎apps/docs/content/docs/platform/enterprise/self-hosted.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Three features do not need a flag at all: **custom branding**, **session policie
5656
| Session policies — on by default | `SESSION_POLICIES_ENABLED` | `NEXT_PUBLIC_SESSION_POLICIES_ENABLED` |
5757
| Data retention deletion | `DATA_RETENTION_ENABLED` | `NEXT_PUBLIC_DATA_RETENTION_ENABLED` |
5858
| Data drains | `DATA_DRAINS_ENABLED` | `NEXT_PUBLIC_DATA_DRAINS_ENABLED` |
59+
| Credential Groups | `CREDENTIAL_GROUPS` | — |
5960
| Workspace forks | `FORKING_ENABLED` | `NEXT_PUBLIC_FORKING_ENABLED` |
6061
| Sim Mailer inbox — on by default | `INBOX_ENABLED` | `NEXT_PUBLIC_INBOX_ENABLED` |
6162
| Sandboxes | `SANDBOXES_ENABLED` | `NEXT_PUBLIC_SANDBOXES_ENABLED` |

‎apps/sim/.env.example‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ CRON_SECRET=your_cron_secret # Use `openssl rand -hex 32` to generate. Authentic
214214
# DATA_DRAINS_ENABLED= / NEXT_PUBLIC_DATA_DRAINS_ENABLED= # Export streams
215215
# FORKING_ENABLED= # Workspace forks
216216
# CREDENTIAL_GROUPS= # Enterprise managed OAuth collections
217-
# TABLE_ROW_TTL= # Table TTL columns and expired-row cleanup
218217
# KNOWLEDGE_MEMBER_ACCESS= # Per-member knowledge connectors and hybrid-by-default retrieval
219218
# ORGANIZATIONS_ENABLED= / NEXT_PUBLIC_ORGANIZATIONS_ENABLED= # Organizations only
220219

‎apps/sim/app/api/cron/cleanup-table-row-ttl/route.test.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
import { createMockRequest } from '@sim/testing'
22
import { asyncJobsMock, asyncJobsMockFns } from '@sim/testing/mocks/async-jobs.mock'
33
import { authInternalMock, authInternalMockFns } from '@sim/testing/mocks/auth-internal.mock'
4-
import {
5-
tableTtlAvailabilityMock,
6-
tableTtlAvailabilityMockFns,
7-
} from '@sim/testing/mocks/table-ttl-availability.mock'
84
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
95

106
vi.mock('@/lib/auth/internal', () => authInternalMock)
117
vi.mock('@/lib/core/async-jobs', () => asyncJobsMock)
12-
vi.mock('@/lib/table/ttl-availability', () => tableTtlAvailabilityMock)
138

149
import { GET } from '@/app/api/cron/cleanup-table-row-ttl/route'
1510

16-
const { mockIsTableRowTtlEnabled } = tableTtlAvailabilityMockFns
1711
const { mockVerifyCronAuth } = authInternalMockFns
1812

1913
const mockEnqueue = asyncJobsMockFns.mockJobQueue.enqueue
@@ -23,7 +17,6 @@ describe('table row TTL cleanup route', () => {
2317
vi.useFakeTimers()
2418
vi.setSystemTime(new Date('2026-08-22T17:01:00Z'))
2519
mockVerifyCronAuth.mockReturnValue(null)
26-
mockIsTableRowTtlEnabled.mockResolvedValue(true)
2720
mockEnqueue.mockResolvedValue('job-ttl-1')
2821
})
2922

‎apps/sim/app/api/cron/cleanup-table-row-ttl/route.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { type NextRequest, NextResponse } from 'next/server'
33
import { verifyCronAuth } from '@/lib/auth/internal'
44
import { getJobQueue } from '@/lib/core/async-jobs'
55
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
6-
import { isTableRowTtlEnabled } from '@/lib/table/ttl-availability'
76

87
export const dynamic = 'force-dynamic'
98

@@ -15,11 +14,6 @@ export const GET = withRouteHandler(async (request: NextRequest) => {
1514
const authError = verifyCronAuth(request, 'table row TTL cleanup')
1615
if (authError) return authError
1716

18-
if (!(await isTableRowTtlEnabled())) {
19-
logger.info('Table row TTL cleanup skipped because the feature is disabled')
20-
return NextResponse.json({ triggered: false, reason: 'feature-disabled' })
21-
}
22-
2317
const queue = await getJobQueue()
2418
const scheduleWindow = Math.floor(Date.now() / TTL_CLEANUP_INTERVAL_MS)
2519
const jobId = await queue.enqueue(

‎apps/sim/app/api/table/[tableId]/query/route.test.ts‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { tableApiMock, tableApiMockFns } from '@sim/testing/mocks/table-api.mock'
22
import {
3-
MockTableV2FeatureDisabledError,
43
tableApplicationRowsMock,
54
tableApplicationRowsMockFns,
65
} from '@sim/testing/mocks/table-application-rows.mock'
@@ -10,15 +9,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
109
vi.mock('@/lib/table/api', () => tableApiMock)
1110

1211
vi.mock('@/lib/table/api/row-route-policies', () => ({
13-
internalTableV2QueryErrorPolicy: {
14-
project: (error: unknown) =>
15-
error instanceof MockTableV2FeatureDisabledError
16-
? {
17-
status: 403,
18-
body: { error: error.message, code: 'tables_v2_disabled' },
19-
}
20-
: null,
21-
},
12+
internalTableV2QueryErrorPolicy: { project: () => null },
2213
}))
2314

2415
vi.mock('@/lib/table/application/rows', () => tableApplicationRowsMock)

‎apps/sim/app/api/table/[tableId]/query/route.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export const POST = defineInternalJsonRoute({
3030
includeTotal: !body.cursor,
3131
includeRunState: false,
3232
allowExpandedLimit: true,
33-
requireV2Feature: true,
3433
includePersistedSecretProvenance: negotiateTableRowsProvenance(
3534
request,
3635
principal.kind === 'delegated'

‎apps/sim/app/api/table/utils.ts‎

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,10 @@ import type { ColumnDefinition, Filter, TableDefinition, TablePredicate } from '
1919
import { buildFilterClause, getTableById, TableQueryValidationError } from '@/lib/table'
2020
import { USER_TABLE_ROWS_SQL_NAME } from '@/lib/table/constants'
2121
import { TableLockedError } from '@/lib/table/mutation-locks'
22-
import {
23-
getTableQueryAvailability,
24-
TABLE_QUERY_UNAVAILABLE_REASON,
25-
} from '@/lib/table/query-availability'
2622
import { isTablePredicate } from '@/lib/table/query-builder/converters'
2723
import { validateStoragePredicate } from '@/lib/table/query-builder/validate'
2824
import type { TableLockKind } from '@/lib/table/types'
2925
import { checkWorkspaceAccess } from '@/lib/workspaces/permissions/utils'
30-
import { getWorkspaceOrganizationId } from '@/lib/workspaces/utils'
31-
32-
/**
33-
* Gate for the internal predicate-grammar table query route (`tables-v2-api`
34-
* flag). Runs AFTER authorization, so the caller has already proven read
35-
* access to the table — hiding the gate behind a bare 404 at that point
36-
* serves nobody and reads as data loss (live incident: the table_v2 block
37-
* hard-"Not found"-ing on every query while the copilot gateway, which
38-
* bypasses HTTP, found the rows). Authorized callers get an honest 403
39-
* naming the gate instead.
40-
*/
41-
export async function tablesV2GateError(
42-
userId: string,
43-
workspaceId: string
44-
): Promise<NextResponse | null> {
45-
const orgId = await getWorkspaceOrganizationId(workspaceId)
46-
if ((await getTableQueryAvailability({ userId, orgId })).enabled) return null
47-
return NextResponse.json(
48-
{
49-
error: TABLE_QUERY_UNAVAILABLE_REASON,
50-
code: 'tables_v2_disabled',
51-
},
52-
{ status: 403 }
53-
)
54-
}
5526

5627
/**
5728
* Maps a {@link TableLockedError} thrown by the service layer to a 423 response

‎apps/sim/app/api/v1/logs/projection.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const { mockGetWorkspaceBillingSettings } = workspacesUtilsMockFns
6767
workspacesUtilsMockFns.mockGetWorkspaceBilledAccountUserId.mockImplementation(
6868
async () => 'billed-user'
6969
)
70-
workspacesUtilsMockFns.mockGetWorkspaceOrganizationId.mockImplementation(async () => null)
7170
const { mockMaterializeExecutionDataForDisplay: mockMaterialize } = traceStoreMockFns
7271

7372
const mockGetUserEntityPermissions = permissionsMockFns.mockGetUserEntityPermissions

‎apps/sim/app/api/v1/tables/[tableId]/route.test.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ import { permissionsMock, permissionsMockFns } from '@sim/testing/mocks/permissi
1212
import { createMockRequest } from '@sim/testing/mocks/request.mock'
1313
import { tableMock, tableMockFns } from '@sim/testing/mocks/table.mock'
1414
import { v1MiddlewareMock, v1MiddlewareMockFns } from '@sim/testing/mocks/v1-middleware.mock'
15-
import {
16-
workspacesUtilsMock,
17-
workspacesUtilsMockFns,
18-
} from '@sim/testing/mocks/workspaces-utils.mock'
15+
import { workspacesUtilsMock } from '@sim/testing/mocks/workspaces-utils.mock'
1916
import { beforeEach, describe, expect, it, vi } from 'vitest'
2017

2118
const { mockPerformDeleteTable } = vi.hoisted(() => ({
@@ -48,7 +45,6 @@ vi.mock('@/lib/table/orchestration', () => ({
4845

4946
import { DELETE } from '@/app/api/v1/tables/[tableId]/route'
5047

51-
workspacesUtilsMockFns.mockGetWorkspaceOrganizationId.mockResolvedValue(null)
5248
const { mockGetTableById } = tableMockFns
5349

5450
const { mockCheckRateLimit, mockCheckWorkspaceScope, mockResolveWorkspaceRequestActor } =

0 commit comments

Comments
 (0)