Skip to content

fix: P0 remediation — 배치 재시도 증폭·동시 등록 경합·배포/모니터링 노출 (P0-2b/3/4/5) - #93

Merged
alexization merged 3 commits into
developfrom
feat/p0-remediation
Jul 21, 2026
Merged

fix: P0 remediation — 배치 재시도 증폭·동시 등록 경합·배포/모니터링 노출 (P0-2b/3/4/5)#93
alexization merged 3 commits into
developfrom
feat/p0-remediation

Conversation

@alexization

Copy link
Copy Markdown
Owner

개요

P0 remediation 묶음 브랜치. 서로 독립적인 P0 항목 3건(배치 재시도 증폭, 동시 등록 경합, 배포·모니터링 노출)을 담는다. develop(공통 조상 b4bf305)에서 갈라졌으며, 먼저 머지된 #92(공개 프로필 PII 제거)와는 파일 겹침이 없어 충돌 없이 머지된다.

변경 (커밋별)

refactor: 배치 프로세서 순수화 — P0-3

  • ScoredUserUpdate carrier 신설로 프로세서 계산 결과(user/stats/diff/date)를 writer로 전달
  • ScoreRecalculationProcessorUser→ScoredUserUpdate 순수 함수로 변경, saveActivityLog 제거해 청크 tx에서 DB 쓰기 분리
  • UserItemWriter가 청크 tx 안에서 user saveAll + 활동 로그 find-or-update(upsert)로 점수·로그 원자적 커밋
  • processorNonTransactional로 롤백·재시도 시 GitHub 재fetch 없이 캐시된 프로세서 출력 재사용
  • rate-limit 예외를 noRetry로 지정해 무의미한 백오프 반복 차단(skip 유지)

fix: 동시 등록 node_id unique 위반 폴백 — P0-2b

  • register 신규 등록 경로에서 DataIntegrityViolationException을 잡아 findByNodeId 재조회로 기존 사용자 처리에 재진입
  • 동시 refresh/로그인 race로 중복 삽입이 시도돼도 멱등하게 기존 사용자 응답 반환

fix: 배포 stale 이미지·Grafana 노출 차단 — P0-4 / P0-5

  • git-ranker-api에 image 태그 명시로 CI push 이미지와 compose pull 연결, deploy SSH 스크립트에 set -euo pipefail 추가 (P0-4)
  • Grafana ports를 127.0.0.1 loopback 바인딩으로 변경, 필수 시크릿에 ${VAR:?} 강제 (P0-5)

검증

  • ./gradlew test → BUILD SUCCESSFUL
  • 인프라 설정(P0-4/5)은 단위 테스트 harness 없음 — docker compose config image 해석 확인 + 배포 드라이런은 사람 게이트(G4)

- git-ranker-api에 image 태그 명시(${DOCKERHUB_USERNAME}/git-ranker:${IMAGE_TAG:-latest})해 CI push 이미지와 compose pull 연결 (P0-4)
- deploy.yml SSH 스크립트에 set -euo pipefail 추가해 pull/cd 실패 시 즉시 중단 (P0-4)
- grafana ports를 127.0.0.1 loopback 바인딩으로 변경해 인터넷 노출 차단 (P0-5)
- DOCKERHUB_USERNAME·DB_PASSWORD·GF_SECURITY_ADMIN_PASSWORD에 ${VAR:?} 강제로 빈 값 폴백 방지 (P0-5)
- 인프라 설정 변경이라 테스트 harness 없음: 검증은 docker compose config로 image 해석 확인, 배포 드라이런은 사람 게이트 G4
- register의 신규 등록 경로에서 DataIntegrityViolationException을 잡아 findByNodeId 재조회로 기존 사용자 처리에 재진입
- 동시 refresh/로그인 race로 중복 삽입이 시도돼도 멱등하게 기존 사용자 응답 반환
- UserRegistrationServiceTest에 unique 위반 폴백 케이스 추가 (P0-2b)
- ScoredUserUpdate carrier 신설: 프로세서 계산 결과(user/stats/diff/date)를 writer로 전달
- ScoreRecalculationProcessor를 User→ScoredUserUpdate 순수 함수로 변경, saveActivityLog 제거해 청크 tx에서 DB 쓰기 분리
- UserItemWriter가 청크 tx 안에서 user saveAll + 활동 로그 find-or-update(upsert) 수행해 점수·로그 원자적 커밋
- 스텝에 processorNonTransactional 추가해 롤백·재시도 시 GitHub 재fetch 없이 캐시된 프로세서 출력 재사용
- rate-limit 예외(GitHubRateLimitException/Exhausted)를 noRetry로 지정해 무의미한 백오프 반복 차단 (skip은 유지)
- 프로세서/writer 테스트를 carrier 기준으로 재작성; job config 재시도 설정은 배치 설정이라 단위 테스트 harness 없음 (P0-3)
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@alexization, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 476d1434-f72d-4030-a91a-620584c6c228

📥 Commits

Reviewing files that changed from the base of the PR and between 9f1cb82 and 51bb928.

📒 Files selected for processing (10)
  • .github/workflows/deploy.yml
  • docker-compose.yml
  • src/main/java/com/gitranker/api/batch/dto/ScoredUserUpdate.java
  • src/main/java/com/gitranker/api/batch/job/DailyScoreRecalculationJobConfig.java
  • src/main/java/com/gitranker/api/batch/processor/ScoreRecalculationProcessor.java
  • src/main/java/com/gitranker/api/batch/writer/UserItemWriter.java
  • src/main/java/com/gitranker/api/domain/user/service/UserRegistrationService.java
  • src/test/java/com/gitranker/api/batch/processor/ScoreRecalculationProcessorTest.java
  • src/test/java/com/gitranker/api/batch/writer/UserItemWriterTest.java
  • src/test/java/com/gitranker/api/domain/user/service/UserRegistrationServiceTest.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/p0-remediation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@alexization
alexization merged commit 74d6653 into develop Jul 21, 2026
1 of 2 checks passed
@alexization
alexization deleted the feat/p0-remediation branch July 21, 2026 06:24
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.

1 participant