Skip to content

Fix/cron region ufc www#26

Merged
umsungjun merged 2 commits into
mainfrom
fix/cron-region-ufc-www
May 28, 2026
Merged

Fix/cron region ufc www#26
umsungjun merged 2 commits into
mainfrom
fix/cron-region-ufc-www

Conversation

@umsungjun

@umsungjun umsungjun commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

릴리스 노트

  • 버그 수정 및 개선

    • UFC 데이터 크롤링 소스를 메인 도메인으로 통합하여 데이터 안정성 향상
    • 파이터 이미지 로딩 신뢰도 개선
    • 캐시 갱신 및 예측 데이터 로딩 메커니즘 최적화
  • 문서화

    • 서버리스 함수 리전 요구사항 및 지역별 제약사항 명시

Review Change Stack

umsungjun and others added 2 commits May 28, 2026 09:48
메인/예측 페이지에 복붙돼 있던 getPredictions를 src/lib/data/predictions.ts로 통합. 예측 페이지에만 있던 hasRealImage 가드를 공통화해, Supabase 예측이 placeholder 이미지뿐일 때 두 페이지 모두 cached로 폴백하도록 일관성 확보.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Vercel 함수 리전이 US(sfo1)면 kr.ufc.com이 403 차단되므로 스탯·랭킹·이미지 크롤러의 하드코딩된 kr.ufc.com을 www.ufc.com으로 교체. 랭킹은 영문 페이지 대응 위해 체급명 영→한 역매핑(DIVISION_NAME_KO)으로 변경하고 Accept-Language를 en으로. CLAUDE.md에 리전은 반드시 US여야 함 + CloudFront API 폐기를 명시.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 28, 2026 00:49
@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
lets-ko Ready Ready Preview, Comment May 28, 2026 12:49am

@umsungjun umsungjun merged commit 6bb135b into main May 28, 2026
2 of 3 checks passed
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bcb6629e-b04f-49d3-a1f2-95835376daf4

📥 Commits

Reviewing files that changed from the base of the PR and between 21b16c4 and e766e47.

📒 Files selected for processing (7)
  • CLAUDE.md
  • src/app/[locale]/page.tsx
  • src/app/[locale]/predictions/page.tsx
  • src/lib/crawl/rankings-crawler.ts
  • src/lib/crawl/ufc-crawler.ts
  • src/lib/crawl/ufc-image-scraper.ts
  • src/lib/data/predictions.ts

📝 Walkthrough

Walkthrough

이 PR은 예측 데이터 로딩 로직을 공용 모듈로 중앙화하고, UFC 크롤러의 모든 요청을 한국 지역 도메인에서 글로벌 도메인으로 마이그레이션하며 언어 헤더를 영어로 통일합니다.

Changes

Predictions 데이터 소스 중앙화

Layer / File(s) Summary
Predictions 공용 저장소 생성
src/lib/data/predictions.ts
Supabase에서 최신 예측 데이터를 조회하고 이미지 유효성을 검증한 후 반환하거나, 실패 시 캐시 JSON으로 폴백하는 getPredictions 함수를 새로 구현합니다.
HomePage 예측 로직 리팩터링
src/app/[locale]/page.tsx
로컬에 있던 getPredictions 함수와 관련 import를 제거하고, 공용 모듈에서 import한 함수로 대체하여 중복을 제거합니다.
Predictions 페이지 리팩터링
src/app/[locale]/predictions/page.tsx
로컬 getPredictions 구현을 제거하고 공용 모듈의 함수를 사용하도록 변경하여 데이터 로딩 로직을 통합합니다.

UFC 크롤러 리전 마이그레이션

Layer / File(s) Summary
UFC 크롤러 기본 엔드포인트 마이그레이션
src/lib/crawl/ufc-crawler.ts
선수 페이지 URL을 www.ufc.com으로 변경하고, fetch 헤더와 Drupal AJAX 요청의 Accept-Language를 en-US로 조정하여 영문 페이지 접근을 구현합니다.
랭킹 크롤러 로직 업데이트
src/lib/crawl/rankings-crawler.ts
크롤링 대상을 www.ufc.com으로 변경하고, 분기명 매핑을 영문→한국어 방향으로 수정하여 영문 기반 페이지 구조에 맞게 재구성합니다.
이미지 스크레이퍼 URL 우선순위 변경
src/lib/crawl/ufc-image-scraper.ts
파이터 헤드샷 스크레이핑 시 www.ufc.com을 먼저 시도하도록 URL 배열 순서를 변경합니다.
크론 가이드 및 리전 제약 문서화
CLAUDE.md
/api/cron/crawl 파이프라인의 CloudFront API 폐기를 명시하고, www.ufc.com 기반 처리 방식, Vercel US 리전 필수 제약을 경고로 추가합니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • umsungjun/lets-ko#21: 랭킹 크롤러의 챔피언 이미지 URL 정규화를 조정하는 PR로서 본 PR의 rankings-crawler 변경사항과 직접 겹칩니다.
  • umsungjun/lets-ko#6: 본 PR이 ufc-crawler.ts의 Drupal AJAX 요청 URL을 www로 변경하는 것과, 해당 PR이 같은 파일에서 Drupal AJAX 기반 전적 크롤링 플로우를 재작성하는 부분이 코드 레벨로 연결됩니다.
  • umsungjun/lets-ko#19: /api/cron/crawl 파이프라인을 병렬화 및 단계 구조로 재작성하고 enrichFighterImages 사용 방식을 변경하는데, 본 PR의 크론 가이드 및 enrichFighterImages 설명과 직접적으로 관련됩니다.

Poem

🐰 한 곳에 모으니 예측이 맑아지고,
동쪽 산에서 서쪽으로 크롤러 발걸음,
영문의 품에서 각자의 한글 옷을 입으니,
UFC의 데이터도 기뻐하고, 코드도 웃으네! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cron-region-ufc-www

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 and usage tips.

@umsungjun umsungjun removed the request for review from Copilot May 28, 2026 01:12
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