fix: 인기 파견학교 상세 링크 보정 - #566
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Warning Review limit reached
More reviews will be available in 33 minutes and 35 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (13)
Walkthrough이번 변경은 두 앱(
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@codex reveiw |
|
To use Codex here, create an environment for this repo. |
|
@codex reveiw |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4ba60ad2c
ℹ️ 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".
| params: { value: params?.value ?? "" }, | ||
| params: { | ||
| value: params?.value ?? "", | ||
| termId: params?.termId ?? getClientUniversityTermId(), |
There was a problem hiding this comment.
Keep the shared search API from forcing one term
This default adds termId=DEFAULT_UNIVERSITY_TERM_ID to every client text search, but the same useUniversitySearch("") call is used by the mentor application school picker (apps/web/src/app/my/apply-mentor/_components/UniversityScreen/index.tsx), where users with AFTER_EXCHANGE status select the university and term they attended. In that flow, past-term universities no longer come back from the API, so mentors from any term other than the configured current term cannot select their school; make the term filter opt-in for catalog/popular-card callers or provide an explicit way for this shared search to request all terms.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (1)
apps/university-web/src/app/university/[homeUniversity]/[id]/page.tsx (1)
22-30: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win1)
generateStaticParams의 slug별 조회는 병렬화하는 편이 빌드 시간에 유리합니다.
- Line [22]~Line [30]은 독립 요청을 루프 내
await로 순차 처리해서, 홈대학 수만큼 대기 시간이 누적됩니다.- 같은 결과를 유지하면서 병렬화하면 SSG 생성 지연을 줄일 수 있습니다.
♻️ 제안 패치
export async function generateStaticParams() { const params: { homeUniversity: string; id: string }[] = []; - for (const slug of HOME_UNIVERSITY_SLUGS) { - const homeUniversityInfo = getHomeUniversityBySlug(slug); - if (!homeUniversityInfo) continue; - - const universities = await getAllUniversities({ - homeUniversityId: homeUniversityInfo.homeUniversityId, - }); - - for (const university of universities) { - params.push({ - homeUniversity: slug, - id: String(university.id), - }); - } - } + const scopedUniversitiesBySlug = await Promise.all( + HOME_UNIVERSITY_SLUGS.map(async (slug) => { + const homeUniversityInfo = getHomeUniversityBySlug(slug); + if (!homeUniversityInfo) { + return { slug, universities: [] as { id: number }[] }; + } + + const universities = await getAllUniversities({ + homeUniversityId: homeUniversityInfo.homeUniversityId, + }); + return { slug, universities }; + }), + ); + + for (const { slug, universities } of scopedUniversitiesBySlug) { + for (const university of universities) { + params.push({ + homeUniversity: slug, + id: String(university.id), + }); + } + } return params; }🤖 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 `@apps/university-web/src/app/university/`[homeUniversity]/[id]/page.tsx around lines 22 - 30, The sequential loop processing HOME_UNIVERSITY_SLUGS with await inside causes wait times to accumulate linearly. Instead of looping through slugs and awaiting getAllUniversities calls one at a time, create a Promise.all pattern by first mapping over HOME_UNIVERSITY_SLUGS to create an array of independent getAllUniversities calls, then await all of them in parallel. This maintains the same end result while significantly reducing total execution time by executing all independent requests concurrently rather than sequentially.
🤖 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/university-web/src/apis/universities/api.ts`:
- Around line 193-194: The termId fallback at lines 193 and 203 only uses the
nullish coalescing operator (??) which doesn't validate against invalid values
like NaN, 0, or negative numbers that should trigger the fallback to
getClientUniversityTermId(). Replace the simple ?? check with validation logic
that verifies termId is a valid positive number, and only use params?.termId if
it passes validation; otherwise, use the fallback value from
getClientUniversityTermId() to prevent invalid IDs from being passed to the
query.
In
`@apps/university-web/src/apis/universities/server/getSearchUniversitiesByFilter.ts`:
- Around line 43-48: The filter validation for termId and homeUniversityId
parameters only checks for undefined values but does not validate that these
numeric fields are positive integers. This allows NaN, zero, and negative
numbers to pass through and be sent to the server, potentially causing search
failures. Enhance the conditional checks for both filters.termId and
filters.homeUniversityId (and the similar checks around lines 64-71) to validate
not only that they are not undefined, but also that they are valid positive
integers before appending them to the params object. Use appropriate number
validation logic to ensure only valid positive integer values are included in
the query parameters.
In
`@apps/university-web/src/apis/universities/server/getSearchUniversitiesByText.ts`:
- Around line 23-31: The createSearchTextEndpoint function is serializing termId
and homeUniversityId query parameters without validation, which can cause SSG
failures if invalid values like NaN, 0, or negative numbers are passed. Add
validation logic to ensure termId (set on line 26) is a valid positive integer,
and similarly validate homeUniversityId (set on line 30) before converting them
to strings. Either reject invalid values, provide sensible defaults, or only
include these parameters in the URLSearchParams when they pass validation checks
to prevent malformed queries from reaching the SSG endpoint.
In `@apps/university-web/src/app/university/`[homeUniversity]/page.tsx:
- Around line 56-58: The code is applying redundant filtering to the
universities list. The getSearchUniversitiesAllRegions function already filters
results by homeUniversityId parameter, but then lines 60-63 apply an additional
isMatchedHomeUniversityName filter that can exclude valid data that was
correctly returned from the initial query. Remove or reconsider the
isMatchedHomeUniversityName re-validation filter since the
homeUniversityId-based scope from getSearchUniversitiesAllRegions should be
sufficient, preventing the list from being abnormally reduced by duplicate
filtering logic.
In `@apps/web/src/apis/universities/api.ts`:
- Around line 193-194: The termId fallback validation is incomplete because the
nullish coalescing operator only handles null and undefined values, but does not
validate against invalid values like NaN, 0, or negative numbers that might come
from params.termId. Both instances where termId is assigned (line 193 and line
203) need to be updated to include validation that checks whether the termId
value is a valid positive number before using it, falling back to
getClientUniversityTermId() only when the current value is invalid. Add a
validation helper or inline condition that ensures termId is a valid positive
number rather than relying solely on the ?? operator.
In `@apps/web/src/apis/universities/server/getSearchUniversitiesByFilter.ts`:
- Around line 42-47: Add validation for the termId and homeUniversityId
parameters before appending them to the query params. In the conditional blocks
where filters.termId and filters.homeUniversityId are checked and appended
(around lines 42-47 and the also-applies-to section at 67-74), validate that
these values are valid positive integers before passing them to params.append.
If either value is invalid (negative, zero, or NaN), throw an appropriate error
rather than silently passing the invalid value to the query, so that invalid
requests fail with a meaningful error instead of returning empty arrays that
hide the actual problem.
In `@apps/web/src/apis/universities/server/getSearchUniversitiesByText.ts`:
- Around line 22-30: The createSearchTextEndpoint function is missing validation
for the numeric parameters termId and homeUniversityId before they are converted
to strings and added to the URLSearchParams. Add validation to ensure termId
(derived from either params.termId or getUniversityTermId()) is a valid number,
and similarly validate homeUniversityId when it is defined. If either value is
invalid or not a positive number, throw an appropriate error or handle the
invalid case to prevent malformed query parameters from being silently sent to
the API.
---
Nitpick comments:
In `@apps/university-web/src/app/university/`[homeUniversity]/[id]/page.tsx:
- Around line 22-30: The sequential loop processing HOME_UNIVERSITY_SLUGS with
await inside causes wait times to accumulate linearly. Instead of looping
through slugs and awaiting getAllUniversities calls one at a time, create a
Promise.all pattern by first mapping over HOME_UNIVERSITY_SLUGS to create an
array of independent getAllUniversities calls, then await all of them in
parallel. This maintains the same end result while significantly reducing total
execution time by executing all independent requests concurrently rather than
sequentially.
🪄 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: d617ba84-82a1-4017-9ed8-13ecd281f68f
📒 Files selected for processing (14)
apps/university-web/src/apis/universities/api.tsapps/university-web/src/apis/universities/getSearchFilter.tsapps/university-web/src/apis/universities/server/getSearchUniversitiesByFilter.tsapps/university-web/src/apis/universities/server/getSearchUniversitiesByText.tsapps/university-web/src/app/university/[homeUniversity]/[id]/page.tsxapps/university-web/src/app/university/[homeUniversity]/page.tsxapps/university-web/src/constants/university.tsapps/web/src/apis/universities/api.tsapps/web/src/apis/universities/getSearchFilter.tsapps/web/src/apis/universities/server/getSearchUniversitiesByFilter.tsapps/web/src/apis/universities/server/getSearchUniversitiesByText.tsapps/web/src/app/(home)/_ui/PopularUniversitySection/_ui/PopularUniversityCard.tsxapps/web/src/app/(home)/page.tsxapps/web/src/constants/university.ts
관련 이슈
작업 내용
/university로 fallback하지 않도록 수정했습니다.homeUniversityName을 추천 응답 자체, 전체 학교 목록의 id 매칭, 학기+학교명 단일 매칭 순서로 보강하도록 했습니다.homeUniversityName을 반영했습니다./univ-apply-infos/search/text,/univ-apply-infos/search/filter호출에termId,homeUniversityId파라미터를 전달할 수 있도록 web/university-web 검색 API 계층을 보강했습니다.homeUniversityId를 붙여/university/{homeUniversity}/{id}조합을 해당 대학 데이터 기준으로 생성하도록 수정했습니다.DEFAULT_UNIVERSITY_TERM_ID=12fallback을 추가했습니다. 실제 운영 학기 변경 시UNIVERSITY_TERM_ID또는NEXT_PUBLIC_UNIVERSITY_TERM_ID로 덮어쓸 수 있습니다.특이 사항
termId=12,homeUniversityId=1조합에서 인하대 상세 SSG 경로가 생성되는 것을 build로 확인했습니다.검증
pnpm --filter @solid-connect/web run lint:checkpnpm --filter @solid-connect/web run typecheckpnpm --filter @solid-connect/university-web run lint:checkpnpm --filter @solid-connect/university-web run typecheckNODE_ENV=production UNIVERSITY_WEB_DOMAIN=https://university-web.ci.local pnpm --filter @solid-connect/web run buildNODE_ENV=production pnpm --filter @solid-connect/university-web run buildci:checkci:check및buildhttp://localhost:3000/HTML에서 인기 파견학교 카드 href 확인리뷰 요구사항 (선택)
/university/{homeUniversity}/{id}로만 이동하는지 확인 부탁드립니다.UNIVERSITY_TERM_ID또는NEXT_PUBLIC_UNIVERSITY_TERM_ID값이 배포 환경에 맞게 주입되는지 확인 부탁드립니다.