Skip to content

refactor: 지원 대학 국가 코드 검증 개선#560

Merged
whqtker merged 2 commits into
mainfrom
fix/admin-univ-apply-country-validation
Jun 21, 2026
Merged

refactor: 지원 대학 국가 코드 검증 개선#560
whqtker merged 2 commits into
mainfrom
fix/admin-univ-apply-country-validation

Conversation

@whqtker

@whqtker whqtker commented Jun 19, 2026

Copy link
Copy Markdown
Member

변경 사항

  • 어드민 지원 대학 추가 미리보기에서 국가 코드 검증 기준을 서버의 국가 목록 응답으로 변경했습니다.
  • /admin/countries 응답을 정규화해 등록된 국가 코드 Set을 만들고, universityCountryCode 값이 목록에 없으면 미리보기 단계에서 오류로 표시합니다.
  • 형식은 맞지만 서버에 등록되지 않은 국가 코드가 거부되는 테스트를 추가했습니다.

배경

기존 프론트 검증은 국가 코드가 대문자 2글자인지만 확인해 ZZ처럼 실제 서버 마스터 데이터에 없는 코드도 통과할 수 있었습니다. 국가/권역 마스터 데이터를 서버에서 받을 수 있으므로, import 전 preview 검증도 서버 데이터 기준으로 맞췄습니다.

검증

  • pnpm --filter @solid-connect/admin test
  • pnpm --filter @solid-connect/admin lint:check
  • pnpm --filter @solid-connect/admin typecheck
  • push hook: @solid-connect/admin ci:check, @solid-connect/admin build

참고

  • 로컬 Node 버전은 v24.14.0이라 저장소 요구사항인 22.x와 다르다는 pnpm 경고가 출력됐지만, 위 검증 명령은 모두 통과했습니다.

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
solid-connect-university-web Error Error Jun 21, 2026 5:33am
solid-connect-web-admin Ready Ready Preview, Comment Jun 21, 2026 5:33am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
solid-connection-web Skipped Skipped Jun 21, 2026 5:33am

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7ad6370d-88c3-49d0-8f5e-bd9dec68ac70

📥 Commits

Reviewing files that changed from the base of the PR and between 886ad91 and 0d964ff.

📒 Files selected for processing (1)
  • apps/admin/src/components/features/univ-apply-infos/UnivApplyInfosPageContent.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/admin/src/components/features/univ-apply-infos/UnivApplyInfosPageContent.tsx

Walkthrough

이 PR은 대학 정보 import 기능에 국가 코드 기반 검증을 추가하는 변경입니다. 다음과 같이 진행됩니다:

  1. 검증 컨트랙트 확장

    • univApplyInfoValidation.tsValidatePreviewRowsOptions 인터페이스(validCountryCodes?: ReadonlySet<string>)를 추가했습니다.
    • validatePreviewRows 함수가 선택적 options 인자를 받도록 시그니처를 확장했습니다.
    • universityCountryCode 값이 존재하고 validCountryCodes가 제공된 경우에만, 화이트리스트 미포함 시 오류를 추가하는 분기 로직을 구현했습니다.
  2. 페이지 컴포넌트 연동

    • UnivApplyInfosPageContent.tsxuseMemo, AdminCollection, CountryResponse import를 추가했습니다.
    • toOptionalString, normalizeCollection, getCountryCode 로컬 헬퍼 함수 3개를 추가하여 다양한 응답 형태를 정규화했습니다.
    • adminApi.getCountries를 호출하는 countriesQuery를 추가하고, 그 결과로부터 validCountryCodes Set을 useMemo로 계산합니다.
    • validatePreviewRows 호출부에 { validCountryCodes }를 전달하도록 변경했습니다.
  3. 테스트 추가

    • univApplyInfoValidation.test.tsZZ 코드를 입력했을 때 오류가 발생하는지를 확인하는 케이스를 추가했습니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • wibaek
  • enunsnv
  • khwww
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경사항의 핵심을 명확하게 요약하고 있습니다. '지원 대학 국가 코드 검증 개선'은 이 PR의 주요 목적을 직관적으로 전달합니다.
Description check ✅ Passed PR 설명이 필수 섹션들을 충실히 포함하고 있으나 '관련 이슈' 섹션이 누락되었습니다. 작업 내용, 배경, 검증 정보는 잘 작성되어 있습니다.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/admin-univ-apply-country-validation

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.

@github-actions github-actions Bot added the admin label Jun 19, 2026
@whqtker whqtker marked this pull request as ready for review June 19, 2026 07:13
@whqtker whqtker changed the title 지원 대학 국가 코드 검증 개선 refactor: 지원 대학 국가 코드 검증 개선 Jun 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 886ad91a1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/admin/src/components/features/univ-apply-infos/UnivApplyInfosPageContent.tsx Outdated

@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
`@apps/admin/src/components/features/univ-apply-infos/UnivApplyInfosPageContent.tsx`:
- Around line 162-170: The validCountryCodes useMemo hook on line 162-170
creates an empty Set even when countriesQuery.data is undefined or null, which
causes validatePreviewRows on line 194 to incorrectly mark all country codes as
unregistered during loading or failed data fetches since an empty Set is still
truthy. Add a guard condition in the useMemo hook to only construct the
validCountryCodes Set when countriesQuery.data is actually available, and ensure
that when data is not ready, either avoid calling validatePreviewRows or pass
null/undefined instead of an empty Set to prevent false positive validation
errors.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 845fb089-5244-4b22-a9da-5b81da7217b1

📥 Commits

Reviewing files that changed from the base of the PR and between f9adfc6 and 886ad91.

📒 Files selected for processing (3)
  • apps/admin/src/components/features/univ-apply-infos/UnivApplyInfosPageContent.tsx
  • apps/admin/src/components/features/univ-apply-infos/univApplyInfoValidation.test.ts
  • apps/admin/src/components/features/univ-apply-infos/univApplyInfoValidation.ts

@whqtker whqtker self-assigned this Jun 19, 2026
@vercel vercel Bot temporarily deployed to Preview – solid-connection-web June 21, 2026 05:32 Inactive
@whqtker whqtker merged commit 64410bd into main Jun 21, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant