Skip to content

feat(control-plane): version data import table naming - #1022

Merged
EDsCODE merged 4 commits into
mainfrom
codex/data-import-table-naming-version
Aug 3, 2026
Merged

feat(control-plane): version data import table naming#1022
EDsCODE merged 4 commits into
mainfrom
codex/data-import-table-naming-version

Conversation

@EDsCODE

@EDsCODE EDsCODE commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Problem

Existing organizations need to keep the data-import table names they already use, while newly provisioned organizations should use the copy workflow naming format. The naming choice must be stable at organization scope and available to PostHog writers.

Changes

  • Add an organization-level data_imports_table_naming_version with legacy_batch_v1 and copy_v1 values.
  • Backfill existing organizations to legacy_batch_v1, then make copy_v1 the database default for organizations created after the migration.
  • Return the organization policy from GET /api/v1/orgs/:id/teams alongside the team rows.
  • Allow admins to set the policy through POST /api/v1/orgs and change it through PUT /api/v1/orgs/:id, with validation and audit detail.
  • Expose the policy as a constrained selector in both organization admin editors.
  • Document that existing physical tables must be migrated before changing the policy for an organization that has already written data.
  • Add migration, API, Postgres persistence, and admin UI coverage.

Important

Deploy this before PostHog/posthog#76032. Apply any deliberate policy exceptions after this migration and before the PostHog writers deploy.

Tests

  • just test-controlplane
  • just test-controlplane-k8s
  • just test-configstore-integration
  • just ui-test
  • just lint

Agent context

Codex implemented this as a human-directed change. The migration intentionally separates the backfill value from the post-migration default so existing and newly provisioned organizations take different policies without hard-coded tenant data. The admin API and both admin interfaces provide a validated override for deliberate exceptions without direct database writes.

@EDsCODE EDsCODE self-assigned this Aug 2, 2026
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Test Impact Plan

Deterministic summary of how this PR changes tests, CI runners, and coverage-risk signals.

Summary

Area Added Changed Deleted
Test files 0 4 0
E2E/journey files 0 0 0
Workflow files 0 0 0

Signals

  • Test cases: +5 / -0
  • Assertions: +27 / -0
  • Skips or known failures added: 0
  • Workflow continue-on-error added: 0
  • Workflow path filters added: 0
  • Test commands removed from justfile: 0
  • E2E/journey retry lines added: 0

Coverage risk: neutral or increased

No coverage-reduction warnings detected.

@EDsCODE
EDsCODE marked this pull request as ready for review August 3, 2026 01:01
@EDsCODE
EDsCODE requested a review from a team August 3, 2026 01:22
@EDsCODE
EDsCODE merged commit 04b203f into main Aug 3, 2026
31 checks passed
@EDsCODE
EDsCODE deleted the codex/data-import-table-naming-version branch August 3, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant