fix: enable bidirectional sync pairs (int<->prod, dev<->int)
| .. | .. |
|---|
| 11 | 11 | router = APIRouter() |
|---|
| 12 | 12 | |
|---|
| 13 | 13 | # Only adjacent-environment sync paths are allowed (data flows down) |
|---|
| 14 | | -_VALID_SYNC_PAIRS = {("prod", "int"), ("int", "dev")} |
|---|
| 14 | +_VALID_SYNC_PAIRS = {("prod", "int"), ("int", "dev"), ("int", "prod"), ("dev", "int")} |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | |
|---|
| 17 | 17 | def _sse_line(payload: dict) -> str: |
|---|
| .. | .. |
|---|
| 68 | 68 | if (from_env, to_env) not in _VALID_SYNC_PAIRS: |
|---|
| 69 | 69 | raise HTTPException( |
|---|
| 70 | 70 | status_code=400, |
|---|
| 71 | | - detail=f"Invalid sync path '{from_env} -> {to_env}'. Only adjacent pairs are allowed: prod->int, int->dev.", |
|---|
| 71 | + detail=f"Invalid sync path '{from_env} -> {to_env}'. Only adjacent pairs are allowed: prod<->int, int<->dev.", |
|---|
| 72 | 72 | ) |
|---|
| 73 | 73 | return StreamingResponse( |
|---|
| 74 | 74 | _sync_generator(project, from_env, to_env, db_only, uploads_only, dry_run), |
|---|