Skip to main content

Config Service — Migration Plan

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template


1. Migration Context

The config-service replaces a fragmented pattern where each UI boundary made 5–7 individual API calls to determine permissions, visible UI elements, and theming. The legacy pattern existed in:

  • Ad-hoc feature flag checks in frontend components (hardcoded guards)
  • Access Policy Service ABAC JSONB blobs (not composable)
  • Tenant Service branding fields (no inheritance chain)
  • No formal role inheritance (each service duplicated role logic)

2. Migration Phases

Phase 0 — Bootstrap (Pre-service)

TaskOwnerNotes
Create and deploy config-service with DB migrationsPlatform teamGLOBAL node + system roles seeded
Import existing role definitions from identity/access-policyData migration scriptMap legacy role codes to new RoleDefinition rows
Import existing feature flags from platform-admin-serviceData migration scriptCreate FeatureDefinition + CONFIG_NODE (FEATURE type)
Import tenant branding as DesignTokensData migration scriptTenant primaryColor, logoUrlbrand.primary, brand.logo tokens

Phase 1 — Parallel Run

TaskOwnerNotes
Services call both old pattern AND config-serviceService ownersCompare results; alert on discrepancy
Frontend continues using existing guardsFrontend teamNo user-visible change
Monitor resolution latency vs. SLOSREValidate p95 < 100 ms in production traffic

Phase 2 — Cutover (Tenant by Tenant)

TaskOwnerNotes
Enable config-service resolution for Pilot TenantPlatform teamShadow mode first; cutover on approval
Migrate UI element definitions for pilot tenantFrontend teamRegister all UI elements in ui_definitions
Enable includeUI=true for pilot tenant frontendFrontend teamReplace hardcoded guards with UIElementConfig
Monitor for unexpected denialsSREAlert on denial spike > 2x baseline
Expand to all tenants iterativelyPlatform teamOne tenant per sprint

Phase 3 — Legacy Deprecation

TaskOwnerNotes
Remove ad-hoc feature flag checks from frontendFrontend teamAfter all tenants migrated
Deprecate individual permission call pattern from servicesService ownersReplace with GET /internal/config/resolve
Remove legacy branding from tenant-service API responsesTenant teamConfig-service tokens take precedence

3. Rollback Plan

PhaseRollback action
Phase 0Drop config-service DB schema; no other services affected
Phase 1Disable config-service calls; services revert to old pattern
Phase 2 per tenantFeature flag in platform-admin disables config-service for that tenant; old guards re-activate
Phase 3Revert frontend and service code; re-enable legacy branding fields

4. Data Migration Scripts

ScriptPurpose
scripts/migrate-roles-from-iam.tsRead roles from identity-service API; create RoleDefinition + inheritance rows
scripts/migrate-feature-flags.tsRead feature flags from platform-admin-service; create FeatureDefinition + ConfigNode rows
scripts/migrate-tenant-branding.tsRead primaryColor, logoUrl from tenant-service; create DesignToken rows
scripts/validate-migration.tsRun parallel resolution comparisons; report discrepancies

5. Open Questions

  • Agreed timeline with identity-service team for role model handoff.
  • Approval process for legacy feature flag format → FeatureDefinition schema mapping.