Skip to content

AI DB 엔티티와 레포지토리 추가#7

Merged
cfcromn merged 3 commits into
developfrom
feature/ai-db-entities-repositories
Jul 8, 2026
Merged

AI DB 엔티티와 레포지토리 추가#7
cfcromn merged 3 commits into
developfrom
feature/ai-db-entities-repositories

Conversation

@cfcromn

@cfcromn cfcromn commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

✨ 작업 내용

이번 PR에서 어떤 작업을 했는지 간단히 요약해주세요.

  • FastAPI 앱을 app/ 패키지 구조로 정리하고 기존 main.py 호환 경로를 유지했습니다.
  • SQLAlchemy 2.0 기반 DB 세션 설정과 Alembic 마이그레이션 기본 구성을 추가했습니다.
  • decision_logs, shap_values, model_versions ORM 엔티티와 최소 레포지토리를 추가했습니다.
  • 로컬 compose Postgres에 AI 서비스용 arena_ai DB 초기화 SQL을 연결했습니다.
  • 엔티티 메타데이터 검증 테스트를 추가했습니다.
  • write-pr 스킬이 저장소 PR 템플릿을 읽고 채우도록 명시했습니다.

🔍 리뷰 시 참고사항

  • challenge_id, order_id는 Spring Boot DB 논리 참조라 FK를 만들지 않았습니다.
  • shap_values.decision_id만 AI 서비스 내부 테이블 FK로 설정했습니다.
  • 기존 volume이 있는 로컬 Postgres에서는 docker-entrypoint-initdb.d SQL이 재실행되지 않으므로 arena_ai DB를 수동 생성해야 할 수 있습니다.

✅ 체크리스트

  • 문서(README, .env.example 등) 변경이 필요한 경우 작성 또는 수정했나요?
  • 작업한 코드가 정상적으로 동작하는 것을 직접 확인했나요?
  • 필요한 경우 테스트 코드를 작성하거나 수정했나요?
  • Merge 대상 브랜치를 올바르게 설정했나요?
  • PR에 관련 없는 작업이 포함되지 않았나요?
  • 적절한 라벨과 리뷰어를 설정했나요?

📎 관련 이슈(선택)

@cfcromn cfcromn added the ✨ Feature 신규 기능 label Jul 8, 2026
@cfcromn cfcromn self-assigned this Jul 8, 2026
@cfcromn cfcromn requested a review from hej090224 July 8, 2026 01:43

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request sets up the database schema, SQLAlchemy models, repositories, and Alembic migrations for an AI trading system, including tables for model versions, decision logs, and SHAP values. The reviewer provided highly actionable feedback to improve the implementation, such as enforcing a single 'CHAMPION' model version using a partial unique index, using timezone-aware datetimes, properly mapping SQLAlchemy Enum types to ensure runtime conversion, optimizing queries with a composite index on decision logs, and replacing plain assert statements in tests with proper unittest assertions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread app/mlops/models.py
Comment thread alembic/env.py Outdated
Comment thread app/mlops/models.py Outdated
Comment thread app/mlops/models.py
Comment thread app/trading_ai/models.py Outdated
Comment thread app/trading_ai/models.py Outdated
Comment thread app/trading_ai/models.py Outdated
Comment thread tests/test_models_metadata.py Outdated
@cfcromn cfcromn merged commit 6755d56 into develop Jul 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 신규 기능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants