Skip to content

feat: Kakao 키워드 장소 검색 구현 - #33

Merged
minsour merged 8 commits into
mainfrom
feature/GM-63-kakao-keyword-search
Jul 9, 2026
Merged

minsour merged 8 commits into
mainfrom
feature/GM-63-kakao-keyword-search

Conversation

@minsour

@minsour minsour commented Jun 24, 2026 •

Copy link
Copy Markdown
Member

📌 Related Issue

GM-63

🚀 Description

  • Kakao Local API의 키워드 장소 검색을 KakaoProvider에 연결했습니다.
  • GeoQuery를 Kakao keyword search 요청으로 변환하고, Kakao 응답을 서비스 내부 표준 형태인 GeoCandidate로 정규화합니다.
  • 실제 API 확인을 위해 임시 geocoder 테스트 엔드포인트도 함께 추가했습니다.

✅ Done

  • Kakao keyword search API 호출 구현
  • Authorization: KakaoAK {KAKAO_REST_API_KEY} 인증 헤더 적용
  • areaName + placeName 기반 query 생성
  • Kakao 응답 schema를 kakao.type.ts로 분리
  • Kakao 응답을 GeoCandidate로 정규화
  • Kakao API 오류 처리 추가
  • KakaoProvider 단위 테스트 추가
  • 실제 API 동작 확인용 임시 API 추가

📢 Notes

  • _test/geocode API는 KakaoProvider 실제 연동 확인을 위한 임시 엔드포인트이며, 전체 장소 저장/추출 플로우가 연결되면 제거할 예정입니다.
  • KAKAO_REST_API_KEY는 SM에 등록해두었습니다.

Summary by CodeRabbit

  • New Features

    • 카카오 기반 장소 지오코딩이 실제로 연동되어 주소·지역·장소명 조합으로 검색할 수 있게 되었습니다.
    • 지도 링크, 카테고리, 전화번호, 좌표 등 결과 정보가 확장되었습니다.
    • 테스트용 지오코딩 조회 엔드포인트를 추가했습니다.
  • Bug Fixes

    • 카카오 REST API 키가 누락/빈 값이면 즉시 환경 설정 검증에 실패하도록 강화했습니다.
    • 검색 실패/요청 제한/응답 형식 오류를 더 명확히 처리하고, 실패 결과에 대해 경고 로그를 남기도록 개선했습니다.
  • Tests

    • 카카오 검색 및 예외 케이스 커버리지를 위한 테스트를 추가했습니다.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b82ecd04-9b11-41a1-8ca0-a6fd9a081a01

📥 Commits

Reviewing files that changed from the base of the PR and between d5a42d4 and 53a5768.

📒 Files selected for processing (3)
  • package.json
  • src/config/env.schema.spec.ts
  • src/config/env.schema.ts

📝 Walkthrough

Walkthrough

KAKAO_REST_API_KEY가 필수 비빈 문자열로 바뀌었고, Kakao 키워드 검색 API 연동이 KakaoProvider에 구현되었습니다. 지오코더 타입 계약과 실패 로깅이 갱신됐으며, PlaceController에 테스트용 지오코드 엔드포인트가 추가되었습니다.

Changes

Kakao 지오코더 통합

Layer / File(s) Summary
환경변수 필수화
src/config/env.schema.ts, package.json, src/config/env.schema.spec.ts
KAKAO_REST_API_KEY가 필수 비빈 문자열로 바뀌고, e2e 실행 및 환경변수 검증 테스트에 해당 값이 추가됨.
Geocoder 타입 계약 갱신
src/infrastructures/geocoder/geocoder.type.ts
AREA_TYPES/AreaType 추가, GeoQuery.areaType 추가, GeoCandidate.providerPlaceId 추가 및 mapUrl 리네임, GeocoderProvider.name이 readonly로 변경됨.
GeocoderService 실패 로깅
src/infrastructures/geocoder/geocoder.service.ts
Logger가 추가되고 searchAll에서 실패한 provider별 경고 로그를 남기도록 변경됨.
KakaoProvider Kakao API 연동
src/infrastructures/geocoder/providers/kakao.type.ts, src/infrastructures/geocoder/providers/kakao.provider.ts, src/infrastructures/geocoder/providers/kakao.provider.spec.ts
Kakao 응답 스키마와 문서 타입이 추가되고, search가 fetch 호출, 상태별 예외 처리, JSON/스키마 검증, GeoCandidate 매핑, URL 생성, 숫자 변환을 수행하도록 구현 및 테스트됨.
PlaceController 테스트용 지오코더 엔드포인트
src/modules/place/place.dto.ts, src/modules/place/place.controller.ts
지오코드 요청 스키마가 추가되고, GeocoderService 주입 및 _test/geocode 핸들러가 쿼리 검증 후 searchAll을 호출하도록 연결됨.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PlaceController
  participant GeocoderService
  participant KakaoProvider
  participant KakaoAPI

  PlaceController->>GeocoderService: searchAll(placeName, areaName, areaType)
  GeocoderService->>KakaoProvider: search(query)
  KakaoProvider->>KakaoAPI: fetch(keyword search URL, Authorization)
  KakaoAPI-->>KakaoProvider: response(status, json)
  alt 성공
    KakaoProvider-->>GeocoderService: GeoCandidate[]
  else 실패/에러
    KakaoProvider-->>GeocoderService: AppException
    GeocoderService->>GeocoderService: 경고 로그 기록
  end
  GeocoderService-->>PlaceController: GeoCandidate[]
Loading

Possibly related PRs

  • mash-up-kr/Team-MINO-Node#2: envSchema/validateEnv 환경변수 검증 체계를 다룬 PR로, 이번 KAKAO_REST_API_KEY 규칙 변경과 직접 연결됨.
  • mash-up-kr/Team-MINO-Node#32: GeocoderService.searchAll와 geocoder.type.ts의 타입 계약을 확장한 PR로, 이번 Kakao 연동과 같은 흐름의 후속 변경임.

Suggested reviewers: labyrinth30, KKardy, sudosubin

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 주요 변경인 Kakao 키워드 장소 검색 구현을 간결하게 잘 요약합니다.
Description check ✅ Passed 필수 섹션이 모두 포함되어 있고 관련 이슈, 구현 내용, 완료 항목, Notes도 충분히 기재되어 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 feature/GM-63-kakao-keyword-search

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.

@labyrinth30 labyrinth30 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Kakao 키워드 검색 연동의 요청 타임아웃, 응답 스키마 검증, 예외 매핑과 테스트를 확인했습니다.

다만 GET /api/v1/place/_test/geocode가 인증이나 환경 제한 없이 공개되어 있어, 외부에서 Kakao API 호출 비용과 rate limit을 소모할 수 있습니다. 임시 엔드포인트를 제거하거나 비운영 환경에서만 등록되도록 제한 부탁드립니다.

Comment on lines +73 to +87
private getApiKey(): string {
const apiKey = this.configService.get("KAKAO_REST_API_KEY", {
infer: true,
});

if (!apiKey?.trim()) {
throw new AppException(
"KAKAO_REST_API_KEY_MISSING",
"카카오 REST API 키가 설정되지 않았습니다.",
HttpStatus.INTERNAL_SERVER_ERROR,
);
}

return apiKey;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

이 부분은 env var validation 쪽에서 required + min length 1 설정해서 방지해보는 건 어떨까요 👀

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

좋습니다! 588a0e6

@KKardy KKardy left a comment

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.

👍
확인했습니다!

Comment on lines +29 to +30
const url = this.createKeywordSearchUrl(query);
let response: Response;

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.

💬
사소한 질문이 있는데요. 저는 뭔가... response, url 과 같은 변수명이 명확하지않아서 좀 지양하려 하거든요..!
물론, 지금 이 service logic에서는 이해가 안될 부분이 전혀 없지만.. 어떻게 생각하시는지 궁금해요!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

response, url 과 같은 변수명이 명확하지않아서 좀 지양하려 하거든요..!

제 생각은..! 예전에는 저도 싫어서 많이 지양하려고 했던 것 같은데요
어느순간 마음의 불편함이 사라지기 시작한 것 같아요!

  1. ai를 사용하면서 더 굳이굳이인 부분이 되기도 했고, ai가 해당 맥락을 명시하지 않는 경우가 꽤나 많은데 크게 중요하지 않은 부분에 일일이 수정하라고 하는 비용이 더 든다고 느꼈어요!
  2. search(searchUrl: string) vs search(url: string) 을 보면, 저의 경우는 전자는 해당 함수에 다른 url이 또 있나? 라는 생각이 들고, 후자는 우선 저 url은 search url이겠구나, 그리고 다른 url이 없나? 라는 생각이 들어요
    결국, 가독성이 나아진다고 느껴지지 않더라구요
    (한 문맥에 여러 컨텍스트가 있는 경우(e.g. response 여러개, url 여러개) 가 아닌 하나의 컨텍스트만 있거나, 해당 문맥이 짧은 경우)

Comment on lines +45 to +51
if (response.status === HttpStatus.TOO_MANY_REQUESTS) {
throw new AppException(
"KAKAO_RATE_LIMITED",
"카카오 장소 검색 요청 한도를 초과했습니다.",
HttpStatus.TOO_MANY_REQUESTS,
);
}

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.

💬
요청 한도가 초과되기 전에 파악하는 방법이 있을까요?
만약 요청 한도가 초과되어 이게 에러가 나기 시작한다면, 감당 안되질 거 같아서 대안이 있으면 어떨까 했습니다.

  • 요청 한도를 조회하다가 한도 시점이 오면 discord에 알림
  • 카카오에 카드를 등록하여 한도를 초과하더라도 자동 결제
  • fallback 대응

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

요청 한도가 초과되기 전에 파악하는 방법이 있을까요?

찾아보니 응답에도 없고 사용량 조회 API도 없네요!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

제안주신것들 좋습니다! 요거는 회의때 한번 논의해보면 좋을것 같은데요 그 후에 작업 분리해서 가시죠ㅎㅎ

Base automatically changed from feature/GM-63-geocoder-provider-flow to main July 5, 2026 09:15
@minsour

minsour commented Jul 5, 2026 •

Copy link
Copy Markdown
Member Author

Kakao 키워드 검색 연동의 요청 타임아웃, 응답 스키마 검증, 예외 매핑과 테스트를 확인했습니다.
다만 GET /api/v1/place/_test/geocode가 인증이나 환경 제한 없이 공개되어 있어, 외부에서 Kakao API 호출 비용과 rate limit을 소모할 수 있습니다. 임시 엔드포인트를 제거하거나 비운영 환경에서만 등록되도록 제한 부탁드립니다.

AI야. Summary 잘 읽어라.
"_test/geocode API는 KakaoProvider 실제 연동 확인을 위한 임시 엔드포인트이며, 전체 장소 저장/추출 플로우가 연결되면 제거할 예정입니다."

@labyrinth30
윤하야 요거 지금 인증 자체가 없기도 하고 e2e PR에서 제거될거 같아서 우선은 그대로 가는거 괜찮나?

@coderabbitai coderabbitai 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.

Actionable comments posted: 4

♻️ Duplicate comments (1)
src/infrastructures/geocoder/providers/kakao.provider.ts (1)

47-61: 🩺 Stability & Availability | 🔵 Trivial

Rate limit 대응 전략 미해결(과거 리뷰 재확인).

이전 리뷰에서 요청 한도 초과 전 대응 방안(한도 모니터링/알림, 결제 등록, fallback)에 대한 논의가 있었으나, 현재 코드는 429 응답을 예외로 던지는 것 외에 사전 대응 로직이 없습니다. 운영 관점에서 Kakao API 쿼터 소진 시 전체 검색 기능이 즉시 저하될 수 있으므로, 최소한 요청 실패율/429 발생을 관찰할 수 있는 모니터링(알림)을 고려해 주세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/infrastructures/geocoder/providers/kakao.provider.ts` around lines 47 -
61, The Kakao geocoder currently only throws on 429 or other failures in
kakao.provider.ts, but it does not surface rate-limit exhaustion for operations
monitoring. Update the Kakao API request handling in the provider to emit
observable telemetry when HttpStatus.TOO_MANY_REQUESTS or other request failures
occur, using the existing request/exception path in Kakao provider methods to
increment failure-rate or 429 metrics and trigger an alert-friendly log. Keep
the AppException behavior, but add monitoring hooks around the response handling
so operators can detect quota exhaustion before search failures spread.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/infrastructures/geocoder/geocoder.service.ts`:
- Around line 14-31: `GeocoderService.searchAll`는 `Promise.allSettled`에서
rejected된 provider의 실패 원인을 버리고 있으므로, `settled`를 처리할 때 `rejected` 항목의 `reason`을
`NestJS Logger`로 warn 이상에 기록하도록 추가하세요. `searchAll` 내부에서 `fulfilled`만 모으기 전에 각 실패
provider와 에러 사유를 남기고, 전체 실패 시에도 `AppException`을 던지기 전에 어떤 provider들이 왜 실패했는지 추적
가능하게 유지하세요.

In `@src/infrastructures/geocoder/providers/kakao.provider.spec.ts`:
- Around line 34-53: The Kakao provider spec is missing coverage for the `catch`
path in `kakao.provider.ts`, so add a test that replaces `globalThis.fetch` with
a rejected mock to simulate network failure or timeout/abort and asserts
`KAKAO_REQUEST_FAILED` is thrown. Reuse the existing `createKakaoResponse` setup
and place the new case alongside the current response-error tests so the
`fetchAddress`/provider error handling is verified for both HTTP failures and
fetch rejection paths.

In `@src/infrastructures/geocoder/providers/kakao.provider.ts`:
- Around line 55-61: The Kakao provider’s non-ok handling in the geocoder
request path currently maps every failure to the same
KAKAO_REQUEST_FAILED/BAD_GATEWAY exception. Update the response handling in
kakao.provider.ts to branch on response status in the provider logic (the code
around the response.ok check) and use distinct AppException codes/statuses for
authentication failures like 401/403, bad requests like 400, and
upstream/service failures like 5xx. Keep the existing KAKAO_REQUEST_FAILED path
only for true external outage cases, and make the new error codes/statuses easy
to locate through the Kakao provider’s request method.

In `@src/modules/place/place.dto.ts`:
- Around line 11-20: `testGeocodeRequestSchema`의 `areaType` 값이 `AreaType`과 중복
하드코딩되어 있습니다. `place.dto.ts`의 `testGeocodeRequestSchema`에서
`v.picklist(["landmark", "address", "region"])`를 직접 쓰지 말고, `geocoder.type.ts`의
`AreaType`을 단일 소스로 두도록 공용 상수(예: `AREA_TYPES`)를 export한 뒤
`v.picklist(AREA_TYPES)`로 연결하세요. 필요하면 `AreaType`도 해당 상수에서 파생되게 바꿔 스키마와 타입이 항상 함께
유지되도록 정리하세요.

---

Duplicate comments:
In `@src/infrastructures/geocoder/providers/kakao.provider.ts`:
- Around line 47-61: The Kakao geocoder currently only throws on 429 or other
failures in kakao.provider.ts, but it does not surface rate-limit exhaustion for
operations monitoring. Update the Kakao API request handling in the provider to
emit observable telemetry when HttpStatus.TOO_MANY_REQUESTS or other request
failures occur, using the existing request/exception path in Kakao provider
methods to increment failure-rate or 429 metrics and trigger an alert-friendly
log. Keep the AppException behavior, but add monitoring hooks around the
response handling so operators can detect quota exhaustion before search
failures spread.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 272a5aa1-a950-4e7e-abdc-02b155ca8308

📥 Commits

Reviewing files that changed from the base of the PR and between 88d7ce8 and 588a0e6.

📒 Files selected for processing (11)
  • src/config/env.schema.ts
  • src/infrastructures/geocoder/geocoder.service.spec.ts
  • src/infrastructures/geocoder/geocoder.service.ts
  • src/infrastructures/geocoder/geocoder.type.ts
  • src/infrastructures/geocoder/providers/kakao.provider.spec.ts
  • src/infrastructures/geocoder/providers/kakao.provider.ts
  • src/infrastructures/geocoder/providers/kakao.type.ts
  • src/modules/place/place.controller.ts
  • src/modules/place/place.dto.ts
  • src/modules/place/place.service.spec.ts
  • src/modules/place/place.service.ts

Comment thread src/infrastructures/geocoder/geocoder.service.ts
Comment thread src/infrastructures/geocoder/providers/kakao.provider.spec.ts
Comment thread src/infrastructures/geocoder/providers/kakao.provider.ts
Comment thread src/modules/place/place.dto.ts
minsour and others added 3 commits July 5, 2026 19:39
충돌 해결:
- env.schema.ts: KAKAO_REST_API_KEY(required) + main의 INSTAGRAM_* 유니온
- geocoder.type.ts: AREA_TYPES 단일 소스 유지 (main 필드 포함 상위집합)
- geocoder.service.ts: provider 실패 로깅 유지 (main 구현 상위집합)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
KAKAO_REST_API_KEY가 env 검증에서 required가 되면서 e2e 부팅 시
validateEnv가 실패하던 문제 해결. INSTAGRAM_* 주입과 동일 패턴.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/infrastructures/geocoder/geocoder.service.ts`:
- Around line 20-26: The provider failure warn log in geocoder.service should
preserve full error details when the rejection reason is an Error instance.
Update the logging in the settled.forEach block to detect result.reason in
geocoder.service and, for Error objects, log the stack (or the Error object
itself) instead of interpolating only the stringified message; keep the existing
provider name context in the warn message.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4a7f6634-ab47-490d-a166-767b530b00a6

📥 Commits

Reviewing files that changed from the base of the PR and between 588a0e6 and d5a42d4.

📒 Files selected for processing (6)
  • package.json
  • src/config/env.schema.ts
  • src/infrastructures/geocoder/geocoder.service.ts
  • src/infrastructures/geocoder/geocoder.type.ts
  • src/infrastructures/geocoder/providers/kakao.provider.spec.ts
  • src/modules/place/place.dto.ts

Comment on lines +20 to +26
settled.forEach((result, index) => {
if (result.status === "rejected") {
this.logger.warn(
`Geocoder provider "${this.providers[index].name}" failed: ${result.reason}`,
);
}
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

과거 리뷰 요청사항 정확히 반영됨.

Provider별 실패 사유를 warn 레벨로 로깅하는 로직이 이전 리뷰 코멘트에서 요청한 대로 정확히 구현되었습니다.

다만 result.reason이 Error 인스턴스인 경우 템플릿 문자열 삽입 시 toString() 결과(예: Error: message)만 남고 stack trace는 사라집니다. 운영 중 디버깅 편의를 위해 Error 인스턴스 여부를 확인해 stack을 함께 로깅하는 것을 고려해보세요.

♻️ 제안
     settled.forEach((result, index) => {
       if (result.status === "rejected") {
+        const reason =
+          result.reason instanceof Error
+            ? result.reason.stack
+            : result.reason;
         this.logger.warn(
-          `Geocoder provider "${this.providers[index].name}" failed: ${result.reason}`,
+          `Geocoder provider "${this.providers[index].name}" failed: ${reason}`,
         );
       }
     });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
settled.forEach((result, index) => {
if (result.status === "rejected") {
this.logger.warn(
`Geocoder provider "${this.providers[index].name}" failed: ${result.reason}`,
);
}
});
settled.forEach((result, index) => {
if (result.status === "rejected") {
const reason =
result.reason instanceof Error
? result.reason.stack
: result.reason;
this.logger.warn(
`Geocoder provider "${this.providers[index].name}" failed: ${reason}`,
);
}
});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/infrastructures/geocoder/geocoder.service.ts` around lines 20 - 26, The
provider failure warn log in geocoder.service should preserve full error details
when the rejection reason is an Error instance. Update the logging in the
settled.forEach block to detect result.reason in geocoder.service and, for Error
objects, log the stack (or the Error object itself) instead of interpolating
only the stringified message; keep the existing provider name context in the
warn message.

@KKardy KKardy left a comment

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.

확인했습니다 👍

…eyword-search

# Conflicts:
#	package.json
#	src/config/env.schema.ts

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/config/env.schema.spec.ts`:
- Around line 4-13: Add validation coverage for the new KAKAO_REST_API_KEY
requirement in env.schema.spec.ts by extending the validateEnv tests to assert
that a missing or empty KAKAO_REST_API_KEY causes an exception. Use the existing
requiredEnvironment fixture and the validateEnv helper in
src/config/env.schema.spec.ts to cover both the success path and the failure
path for the minLength(1) rule.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b82ecd04-9b11-41a1-8ca0-a6fd9a081a01

📥 Commits

Reviewing files that changed from the base of the PR and between d5a42d4 and 53a5768.

📒 Files selected for processing (3)
  • package.json
  • src/config/env.schema.spec.ts
  • src/config/env.schema.ts

@coderabbitai coderabbitai 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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/config/env.schema.spec.ts`:
- Around line 4-13: Add validation coverage for the new KAKAO_REST_API_KEY
requirement in env.schema.spec.ts by extending the validateEnv tests to assert
that a missing or empty KAKAO_REST_API_KEY causes an exception. Use the existing
requiredEnvironment fixture and the validateEnv helper in
src/config/env.schema.spec.ts to cover both the success path and the failure
path for the minLength(1) rule.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b82ecd04-9b11-41a1-8ca0-a6fd9a081a01

📥 Commits

Reviewing files that changed from the base of the PR and between d5a42d4 and 53a5768.

📒 Files selected for processing (3)
  • package.json
  • src/config/env.schema.spec.ts
  • src/config/env.schema.ts
🛑 Comments failed to post (1)
src/config/env.schema.spec.ts (1)

4-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

KAKAO_REST_API_KEY 검증 케이스 추가를 권장합니다.

requiredEnvironment에 KAKAO_REST_API_KEY: "test"가 포함되어 있어 기본 환경변수 계약은 잘 반영되었습니다. 하지만 이 PR의 핵심 변경사항인 KAKAO_REST_API_KEY 필수화(minLength(1))에 대한 검증 테스트가 없습니다. 누락 또는 빈 문자열 입력 시 validateEnv가 예외를 던지는지 확인하는 케이스를 추가하면 좋겠습니다.

🧪 제안하는 테스트 케이스
 describe("Sentry environment", () => {
   // ... 기존 Sentry 테스트 ...
 });

+
+describe("Kakao environment", () => {
+  it.each([
+    ["누락", {}],
+    ["빈 문자열", { KAKAO_REST_API_KEY: "" }],
+  ])("KAKAO_REST_API_KEY %s을 거부한다", (_name, override) => {
+    const { KAKAO_REST_API_KEY: _, ...rest } = requiredEnvironment;
+    expect(() =>
+      validateEnv({ ...rest, ...override }),
+    ).toThrow("Invalid environment variables");
+  });
+});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/config/env.schema.spec.ts` around lines 4 - 13, Add validation coverage
for the new KAKAO_REST_API_KEY requirement in env.schema.spec.ts by extending
the validateEnv tests to assert that a missing or empty KAKAO_REST_API_KEY
causes an exception. Use the existing requiredEnvironment fixture and the
validateEnv helper in src/config/env.schema.spec.ts to cover both the success
path and the failure path for the minLength(1) rule.

@minsour
minsour merged commit e4f2d75 into main Jul 9, 2026
7 checks passed
@minsour
minsour deleted the feature/GM-63-kakao-keyword-search branch July 9, 2026 12:56
@coderabbitai coderabbitai Bot mentioned this pull request Jul 9, 2026
6 tasks done
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.

4 participants