feat(scripts): just seed-from-prod 으로 PRD→dev 시드 자동화 (#371 follow-up)#377
Merged
Conversation
PRD→dev 시드 작업 중 발견된 post_magazines.status='failed' drift를 계기로, dev/prod/assets 3 영역과 Supabase CLI / SeaORM / TS 상수 3종 사실상 SOT 의 운영 모델 정리 로드맵을 4단계로 분해. GitHub 이슈 등록: - #371 DB 운영 모델 SOT 문서화 (P0) - #372 post_magazines.status='failed' drift 정합화 (P1) - #373 drift 검증 CI 게이트 (P2) - #374 [Epic] SeaORM ↔ Supabase 마이그레이션 통합 B.3 (P3) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
이전에 PRD→dev 시드는 9 단계 수동 절차로 (export, dump auth/public, reset, 시스템 row 삭제, import auth/public, verify, cleanup) 진행됐음. 재사용 가능하게 단일 명령으로 패키징. Usage: export PRD_DB_URL='postgresql://...' # NEVER paste in chat just seed-from-prod 추가: - scripts/seed-from-prod.sh — pre-flight, dump, reset --no-seed, system-seed row 삭제, import auth→public, 검증, cleanup - Justfile — seed-from-prod target 안전 가드: - PRD_DB_URL 미설정 시 fail-fast + Dashboard 안내 메시지 - 모든 prerequisite (pg_dump, psql, docker, supabase) 사전 체크 - /tmp dump 파일에 PID 접미사 + trap 으로 항상 cleanup - interactive confirm prompt (yes 입력 필수) - 비밀번호 로테이션 reminder 출력 - post_magazines drift (#372) 미적용 PRD 일 경우 안내 Closes (옵션 #5 in spec) part of #371 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- 2026-04-30-db-operating-model-design.md: `date` → `updated` 필드명, tags 를 허용 어휘 [db, ops, architecture] 로 교체 (이전 [database, migration, supabase, seaorm, drift, documentation] — 어휘 외 6건). - 2026-04-23-e2e-hardening-reprioritization-design.md: `title` 더블쿼트로 감싸 `#170)` 의 YAML comment 절단 해소 → H1_TITLE_MISMATCH 제거. tags 를 [testing, ops] 로 정합화 (이전 infrastructure/hardening 어휘 외). `bun run wiki:lint` 결과: 10 errors → 0 errors (TOO_MANY_RELATED 1건은 warning, CI 통과). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
thxforall
added a commit
that referenced
this pull request
Apr 30, 2026
) (#379) #371 PR #375 의 operating-model.md 후속. 동시기 머지될 #372/#373/#377/#378 의 산출물을 진입점 문서에 cross-reference 한다. 변경: - 'dev → prod 동기화 (시드)' 섹션의 13줄 bash 블록을 `just seed-from-prod` (#377) 한 줄로 단축. 자세한 동작은 scripts/seed-from-prod.sh 로 위임. - drift 패턴 표의 'SeaORM 만 변경' 행에 `post_magazines.status='failed'` (#372) 사례 inline 인용 (commit 6351e7c, 2026-04-22 → 45 row → 2026-04-30 발견). nightly drift CI (#373) 도 같은 패턴 자동 감지로 안내. - '관련 문서' 표에 nightly drift CI (#373, #378) 와 PRD→dev 시드 스크립트 (#377) 추가. - 변경 이력에 후속 항목 기록. 검증: bun run wiki:lint 통과 (0 errors, 1 warning). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
thxforall
added a commit
that referenced
this pull request
Apr 30, 2026
) (#386) #371 PR #375 의 operating-model.md 후속. 동시기 머지될 #372/#373/#377/#378 의 산출물을 진입점 문서에 cross-reference 한다. 변경: - 'dev → prod 동기화 (시드)' 섹션의 13줄 bash 블록을 `just seed-from-prod` (#377) 한 줄로 단축. 자세한 동작은 scripts/seed-from-prod.sh 로 위임. - drift 패턴 표의 'SeaORM 만 변경' 행에 `post_magazines.status='failed'` (#372) 사례 inline 인용 (commit 6351e7c, 2026-04-22 → 45 row → 2026-04-30 발견). nightly drift CI (#373) 도 같은 패턴 자동 감지로 안내. - '관련 문서' 표에 nightly drift CI (#373, #378) 와 PRD→dev 시드 스크립트 (#377) 추가. - 변경 이력에 후속 항목 기록. 검증: bun run wiki:lint 통과 (0 errors, 1 warning). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/seed-from-prod.sh신규 — PRD→dev 시드 단일 명령Justfileseed-from-prodtarget 추가just seed-from-prod)Spec 의 옵션 #5 — part of #371.
배경
2026-04-30 PRD→dev 시드 작업이 9 단계 수동 절차로 진행됐음:
매번 반복 수행 비효율 + 단계 빠뜨릴 위험. 재사용 가능하게 패키징.
사용법
PRD_DB_URL미설정 시 fail-fast + Dashboard 안내 메시지 출력.안전 가드
PRD_DB_URLenv 만 사용. 명령어 인라인 금지. 출력 메시지에서도 비밀번호 로테이션을 명시 안내.pg_dump,psql,docker,supabase누락 시 즉시 fail.supabase_db_*컨테이너 미기동 시 안내./tmp/prd-{auth,public}.$$.sql(PID 접미사).trap cleanup EXIT로 성공/실패 모두에서 자동 삭제.검증
bash -nsyntax OKjust seed-from-prodtarget 정상 호출검증 미완 (사용자/CI)
관련
docs/superpowers/specs/2026-04-30-db-operating-model-design.md의 옵션 5번docs/database/operating-model.md의 dev 시드 절차 섹션을just seed-from-prod한 줄로 단축Test plan
export PRD_DB_URL+just seed-from-prod실행 시 정상 종료bash -n통과 (이미 확인)🤖 Generated with Claude Code