How allen246/sync_tool_feature_flag works
This Flask-backed configuration migration tool helps operators generate database pull queries, provide source and destination exports, and produce migration SQL for branch/product, workflow, and feature-flag configuration. It also compares message-queue definitions and offers a v2-only full-tenant export with table selection, review, validation, and migration generation. The browser UI drives the HTTP API; generated SQL is run manually against databases. Source excerpts show the main API, service, and UI entry points; some script and UI internals were not sampled, so uncertain wiring is omitted.
Main entry points: app.py Flask routes · tabs Sync domain tabs · tenant-export.js Tenant export tab · main.js UI bootstrap
Components 24
Browser interface
- UI bootstrap
static/js/main.js - Sync domain tabs
static/js/tabs - Tenant export tab
static/js/tabs/tenant-export.js - SQL preview
static/js/components/sql-preview.js - Input and data handling
static/js/lib/data.js - Tab and flow state
static/js/state - Queue comparison tab
static/js/tabs/mq.js
HTTP API
- Flask routes
app.py
Configuration sync
- Branch service
services/branch_service.py - Workflow service
services/workflow_service.py - Feature flag service
services/feature_flag_service.py - Branch generators
scripts/branch_product_sync.py - Workflow generators
scripts/workflow_sync.py - Flag generators
scripts/feature_flag.py - Script and query utilities
services/common.py
Tenant export
- Tenant export service
services/tenant_export_service.py - Tenant query builders
scripts/v2/tenant_export_query.py - Tenant table registry
scripts/v2/tenant_registry.py - Tenant validation and upsert
scripts/v2/tenant_upsert.py
Queue comparison
- Queue comparison service
services/mq_service.py - Definition comparator
scripts/mq_comparison.py
Other components
- Operator
- Browser
- Source and destination DBs
Connections 31
- Operator → Browser: uses
- Browser → UI bootstrap: loads
- UI bootstrap → Sync domain tabs: registers tabs
- UI bootstrap → Tenant export tab: registers v2
- UI bootstrap → Tab and flow state: starts
- Sync domain tabs → Flask routes: requests domain API
- Tenant export tab → Flask routes: requests export API
- Sync domain tabs → Input and data handling: uses
- Tenant export tab → Input and data handling: uses
- Sync domain tabs → SQL preview: previews SQL
- Tenant export tab → SQL preview: previews SQL
- Flask routes → Branch service: dispatches branch
- Flask routes → Workflow service: dispatches workflow
- Flask routes → Feature flag service: dispatches flags
- Flask routes → Tenant export service: dispatches export
- Flask routes → Queue comparison service: dispatches compare
- Branch service → Script and query utilities: uses utilities
- Branch service → Branch generators: loads generator
- Workflow service → Script and query utilities: uses utilities
- Workflow service → Workflow generators: loads generator
- Feature flag service → Script and query utilities: uses utilities
- Feature flag service → Flag generators: loads generator
- Tenant export service → Tenant query builders: builds pull queries
- Tenant export service → Tenant table registry: reads table metadata
- Tenant export service → Tenant validation and upsert: validates and generates
- Queue comparison service → Definition comparator: compares definitions
- Queue comparison tab → Flask routes: submits definitions
- Tenant export tab → Source and destination DBs: operator runs queries
- Sync domain tabs → Source and destination DBs: operator runs queries
- Operator → Tenant export tab: pastes exports and reviews
- Operator → Sync domain tabs: pastes exports