Skip to content

[REFACTOR] 그래프 조회를 영속 참조 기반 읽기 경로로 전환 #211

Description

@sun007021

작업 설명

현재 그래프 조회는 기수 문서의 contents를 읽고 요청마다 CrewDocumentReferenceExtractor로 참조를 파싱한다. #208 에서 추가된 node/reference 조회 계약을 사용해 읽기 경로를 영속 참조 기반으로 전환한다.

API 응답 계약은 그대로 유지한다. DB에는 방향성 source -> target 참조가 저장되지만 API는 기존처럼 UUID가 작은 문서를 source로 둔 무방향 REFERENCE edge 하나만 반환한다. 기존 contents projection과 CrewGraphReadModel은 롤백 수단으로 후속 Go 판정 전까지 남긴다.

작업 목록

  • CrewGraphQueryServicefindAllGraphNodesByGenerationTitle로 node를 조회하도록 변경
  • DocumentReferenceRepository.findAllReadModelsByGenerationTitle로 reference를 조회하도록 변경
  • 읽기 경로에서 CrewDocumentReferenceExtractorcontents 의존 제거
  • 방향성 DB row를 기존 무방향 API edge로 정규화
  • 상호 참조, 중복 row, 자기참조 방어 처리
  • 조직 선택 그래프 로직과 응답 순서 유지
  • service/controller/repository 회귀 테스트 보강

완료 조건

  • API response record와 JSON shape가 변경되지 않는다.
  • 조직 미선택 조회 query 최대 2개, 조직 선택 조회 query 최대 4개다.
  • graph read SQL select list에 contents가 없다.
  • A -> BB -> A가 모두 저장돼도 API edge는 하나다.
  • CrewDocumentReferenceExtractor component와 기존 contents projection은 삭제하지 않는다.
  • 새 dependency를 추가하거나 build.gradle을 변경하지 않는다.
  • 관련 테스트와 Java 17 전체 테스트가 통과한다.

관련 이슈

예상 작업 시간

0.5D

우선순위

  • 긴급
  • 높음
  • 보통
  • 낮음

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions