Skip to content

feat: write v2 LLMO config to Aurora#1939

Open
aniham wants to merge 5 commits intomainfrom
v2-config-aurora
Open

feat: write v2 LLMO config to Aurora#1939
aniham wants to merge 5 commits intomainfrom
v2-config-aurora

Conversation

@aniham
Copy link
Contributor

@aniham aniham commented Mar 11, 2026

depends on: https://github.com/adobe/mysticat-data-service/pull/135

feat: Migrate V2 LLMO customer config from S3 to PostgreSQL (Aurora)

Summary

Moves V2 customer configuration storage from S3 to PostgreSQL (Aurora) and syncs brands to the Postgres brands table. This replaces the previous S3-based storage and dual-write setup with a single Postgres source of truth.

Changes

Storage layer

  • customer-config-v2-storage.js – New module for reading and writing V2 customer config in the llmo_customer_config table via PostgREST
  • brand-presence-sync.js – Syncs brands from customer config into the Postgres brands table on config save/patch

Brands controller

  • Switches from llmoConfig.readCustomerConfigV2 / writeCustomerConfigV2 (S3) to readCustomerConfigV2FromPostgres / writeCustomerConfigV2ToPostgres
  • Adds requirePostgrestForV2Config() – returns 503 when Postgres is unavailable (DATA_SERVICE_PROVIDER != postgres)
  • All config endpoints (getCustomerConfig, getCustomerConfigLean, getTopics, getPrompts, saveCustomerConfig, patchCustomerConfig) now use Postgres

Behavior

  • 503 Service Unavailable when Postgres is not configured
  • 404 when config is missing (unchanged)
  • Brand sync runs on every save/patch (no conditional dual-write)

Requirements

  • DATA_SERVICE_PROVIDER=postgres for V2 config endpoints
  • llmo_customer_config table with organization_id, config, updated_by
  • brands table for brand sync

Testing

  • Unit tests for customer-config-v2-storage and brand-presence-sync
  • Brands controller tests updated for Postgres storage
  • 503 tests added for all config endpoints when Postgres is unavailable, with full branch coverage

Documentation

  • docs/reference/llmo-brand-presence-schema-and-v2-config-writeup.md – schema and behavior notes

@aniham aniham requested review from igor-grubic and vivesing March 11, 2026 02:31
@github-actions
Copy link

This PR will trigger a minor release when merged.

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@aniham aniham force-pushed the v2-config-aurora branch from c64d5d4 to c8ff23d Compare March 12, 2026 04:56
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.

2 participants