mistercrunch opened a new pull request, #34510: URL: https://github.com/apache/superset/pull/34510
<img width="1007" height="776" alt="Screenshot 2025-08-01 at 1 42 15 PM" src="https://github.com/user-attachments/assets/c21bbf89-c78f-42af-a65a-6a750fbde197" /> Implements a UUID-based reference system that enables Superset themes to be dynamically configured through external systems like Split.io, overcoming payload size limitations. ## Problem Split.io has a 1KB limit for JSON payloads, but Superset theme configurations typically exceed 3KB. This prevented teams from managing themes dynamically through feature flags without deployments. ## Solution Instead of storing full theme objects, store lightweight UUID references: - Before: `{"algorithm": "dark", "token": {...}, ...}` (3KB+) - After: `{"uuid": "a7f3c8e2-4d1b-4c7a-9f8e-2b5d6c8a9e1f"}` (<100 bytes) ## Implementation Details ### Backend Changes - **ResolveAndUpsertThemeCommand**: New command that resolves UUID references to full theme configurations and upserts them as system themes - **Enhanced bootstrap data**: Modified `get_theme_bootstrap_data()` to dynamically resolve UUID references on every page load - **Fallback support**: Graceful degradation to safe defaults if UUID resolution fails (empty object for default theme, dark algorithm for dark theme) ### Frontend Changes - **UUID display in Theme Modal**: Added read-only UUID field with copy-to-clipboard functionality using existing CopyToClipboard component - **Minimal styling**: Uses Label component with monospace font, following existing patterns ### How It Works 1. Store themes in Superset's Theme CRUD system (each gets a UUID) 2. Reference themes by UUID in Split.io or other configuration systems 3. On page load, the system: - Detects UUID references in theme configuration - Resolves them to full theme definitions from the database - Upserts as system themes for consistency - Falls back to safe defaults on errors ### Testing Comprehensive test coverage including: - UUID resolution scenarios (found, not found, invalid JSON) - System theme upsert behavior (create new, update existing) - Fallback configurations for different theme types - UUID precedence over inline configuration This architecture transforms Split.io's constraint into a feature, enabling truly dynamic theme management with instant updates and no deployment required. 🤖 Generated with help from [Claude Code](https://claude.ai/code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org