Skip to content

feat(repo): GitHub 레포지토리 후보 조회 및 등록 기능 실제 API 연동#25

Merged
i3months merged 10 commits into
feature/resume-managementfrom
feature/github-management
May 20, 2026
Merged

feat(repo): GitHub 레포지토리 후보 조회 및 등록 기능 실제 API 연동#25
i3months merged 10 commits into
feature/resume-managementfrom
feature/github-management

Conversation

@Jaeho-Site

Copy link
Copy Markdown
Contributor

변경 사항

📋 작업 요약

GitHub 레포지토리 도메인(features/repo) 슬라이스를 구축하고, 연동된 깃헙 후보 목록을 가져와 등록하고 관리하는 전체 플로우를 실제 API와 연동했습니다.

✨ 주요 변경 사항

  • 실제 백엔드 API 연동 (api/repo.ts)
    • GitHub 후보 목록(GET /api/repositories/github) 및 등록 목록(GET /api/repositories) 통신 로직을 작성했습니다.
  • 페이지네이션 스펙 대응 분기
    • 백엔드 스펙에 맞추어 후보 목록은 1-based(page/perPage), 등록 목록은 0-based Spring Pageable(page/size) 방식의 컨벤션을 각각 훅에 맞게 적용했습니다.
  • RepositoryPanel 탭 컴포넌트
    • '등록됨' 목록과 'GitHub에서 가져오기' 탭을 Pill-style 토글로 전환할 수 있게 구현했습니다.
  • 후보 레포지토리 로직 (CandidateRepositoryList)
    • 백엔드에서 내려주는 alreadyRegistered, private 플래그를 확인하여 등록 버튼 활성화/비활성화 및 뱃지 상태를 실시간으로 제어합니다.
  • 등록 레포지토리 로직 (RegisteredRepositoryList)
    • 등록 후 분석 상태 전이를 2초 단위로 폴링하며, 완료 시 뱃지가 갱신되도록 Query Cache를 무효화(Invalidate) 처리했습니다.

💡 리뷰어 참고 사항

  • 본 코드는 서버 구동 시 동작하는 실제 API 연동 코드입니다. 백엔드 서버가 다운되어 있거나 백엔드 측에 레포지토리 도메인 로직이 완전히 업로드되기 전에는 로컬 실행 및 통합 테스트가 어려울 수 있으니 리뷰 시 참고 부탁드립니다.
  • 두 개의 서로 다른 페이지네이션 스펙(GitHub형 1-based vs Spring형 0-based)이 충돌하지 않도록 UI와 Hook 레벨에서 분리하여 정합성을 맞추었습니다.
  • Stacked PR 구조이므로, 변경 사항은 앞선 feature/resume-management PR을 베이스로 확인해 주세요.

@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stackup Ready Ready Preview, Comment May 19, 2026 4:37pm

@@ -0,0 +1,46 @@
//중복되는 타입일 수 있으나 정의하는 상태가 달라서 일단 분리 X

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

확인했습니다.

}) {
const register = useRegisterRepoMutation()
const disabled =
candidate.alreadyRegistered || candidate.private || register.isPending

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[질문] private 리포는 disable 처리되나요? 혹시 왜 그런지 여쭤봐도 될까요?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

docs보니 private도 분석 대상이라고 되어있네여. 비활성화는 오류인것 같아 수정했습니다.


export function RepositoryPanel() {
const [tab, setTab] = useState<Tab>('registered')
const { data } = useRegisteredReposQuery()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. 여기서 이미 data를 가져오네요


{tab === 'registered' ? (
<div id="repo-panel-registered" role="tabpanel">
<RegisteredRepositoryList

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. 여기에 RegisteredRepositoryList 가 있습니다.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

데이터 흐름까지 ㄷㄷ 리뷰할 줄 아시는분

}

export function RegisteredRepositoryList({ onBrowseCandidates }: Props) {
const { data, isLoading, isError, error, refetch } = useRegisteredReposQuery()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. 여기서도 useRegisteredReposQuery 를 호출하네요.

이러면 중복으로 두 번 호출하게 될듯합니다.
불필요한 호출이 발생하겠네요

@Jaeho-Site Jaeho-Site May 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TanStack Query가 동일한 queryKey에 대해 자동으로 처리해주기때문에 네트워크 요청은 1화만 발생합니다.
Prop Drilling 방식은 FSD 아키텍처 관점에서 응집도가 떨어질 것 같아 사용하지 않았습니다.
혹시 제가 잘못 이해하고 있으면 다시 말씀주세요 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

네트워크 요청은 한번만 발생하는게 맞습니다. 다만 데이터가 변경될 대 렌더링이 한 번 더 발생할 것 같았습니다.
처음에는 Prop Drilling이 더 좋다고 생각했는데 FSD 응집도를 보면 꼭 그렇지는 않네요.
지금 구조가 더 나아보입니다.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

마감 기한이 빠듯하다 보니 성능 최적화는 기능 구현 완료되고 집중적으로 하게되지 않을까 싶습니다!

| `auth` | GitHub OAuth, 토큰 관리, 로그아웃, 동의 | US-01, US-02, US-03, US-04 |
| `resume` | 이력서 업로드, 목록, 삭제 | US-05, US-06 |
| `repo` (계획) | GitHub 레포 가져오기/등록/삭제 | US-07, US-08 |
| `repo` | GitHub 레포 가져오기/등록/삭제 | US-07, US-08 |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

굿~

@i3months

Copy link
Copy Markdown
Member

고생하셨습니다

@i3months i3months closed this May 20, 2026
@i3months i3months reopened this May 20, 2026
@i3months i3months merged commit f67703e into feature/resume-management May 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants