Skip to content

fix: Vercel 배포 환경에서 웹 버전이 표시되지 않는 문제 수정 - #275

Merged
iOdiO89 merged 7 commits into
devfrom
fix/290-version
Jun 26, 2026
Merged

fix: Vercel 배포 환경에서 웹 버전이 표시되지 않는 문제 수정#275
iOdiO89 merged 7 commits into
devfrom
fix/290-version

Conversation

@iOdiO89

@iOdiO89 iOdiO89 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

작업 요약

  • vercel 배포 환경에서 웹 버전이 표시되지 않던 문제를 해결했습니다.

작업 내용

문제점

  • Vercel 배포본 마이페이지에서 웹 버전(NEXT_PUBLIC_WEB_VERSION)이 비어 footer가 안 보임
  • 기존 prebuild는 로컬 git 태그 → .env.local 주입 방식이라 Vercel shallow clone 환경과 맞지 않음

원인 분석

  • Vercel 빌드 컨테이너에서 git describeweb-v* 태그를 안정적으로 못 읽음
  • 버전 주입이 prebuild 훅에 분산돼 있어 배포 환경 기준 SSOT가 없었음

해결 방법

  • prebuild 제거, next.config async에서 getWebVersion으로 빌드 시 env 주입
  • Vercel: 태그 배포면 VERCEL_GIT_COMMIT_REF 파싱, 브랜치 배포면 GitHub API로 최신 web-v* 조회
  • 로컬: git describegit tag -l fallback
  • 실패 시 빈 문자열 반환 (stale 버전 노출 없음)

close #270

Summary by CodeRabbit

릴리스 노트

  • 리팩터

    • 웹 버전 결정 방식을 빌드 설정에 통합하여, 배포/빌드 시점에 자동으로 NEXT_PUBLIC_WEB_VERSION이 채워지도록 개선
  • 변경사항

    • 빌드 전 실행 스크립트를 제거해 빌드 파이프라인을 간소화
    • 빌드에 사용되는 환경 변수 범위를 명확히 지정하여 버전 산정이 더 일관되게 동작
  • 빌드/구성

    • Next 설정을 비동기 생성 방식으로 전환 (동작은 동일한 형태 유지)

@iOdiO89 iOdiO89 self-assigned this Jun 22, 2026
@iOdiO89 iOdiO89 added fix Something isn't working WEB labels Jun 22, 2026
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
depromeet Ready Ready Preview, Comment Jun 26, 2026 12:06pm

@github-actions
github-actions Bot requested review from kanghaeun and ychany June 22, 2026 06:29
@github-actions

Copy link
Copy Markdown

No description provided.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@iOdiO89, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 39 minutes and 49 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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 credits.

🚦 How do rate 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 see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f9587794-586c-4e9a-aac8-46be1e933c46

📥 Commits

Reviewing files that changed from the base of the PR and between 9a8d51d and a1cdd18.

📒 Files selected for processing (1)
  • apps/web/config/getWebVersion.mjs
📝 Walkthrough

Walkthrough

prebuild.mjs 기반의 웹 버전 주입을 제거하고, getWebVersion()을 통해 버전을 조회해 next.config.mjs의 비동기 설정에서 NEXT_PUBLIC_WEB_VERSION에 넣도록 변경했습니다. turbo.json에는 빌드 환경 변수가 추가되었고, predev/prebuild 스크립트는 삭제되었습니다.

Changes

Web Version 주입 방식 교체

Layer / File(s) Summary
버전 조회 로직
apps/web/config/getWebVersion.mjs
web-v 태그 파서, GitHub API 조회, git describe, git tag -l, 그리고 VERCEL_GIT_COMMIT_REF/process.env.VERCEL 분기 흐름이 추가되어 버전을 순차 조회한다.
next.config.mjs 및 빌드 설정
apps/web/next.config.mjs, apps/web/package.json, turbo.json
nextConfig가 async 함수로 바뀌고 getWebVersion() 결과가 env.NEXT_PUBLIC_WEB_VERSION에 주입된다. predev/prebuild 스크립트는 삭제되며, build 작업의 env에 Vercel/Git 관련 값이 추가된다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • depromeet/PIKI-Client#178: NEXT_PUBLIC_WEB_VERSIONprebuild.mjs로 주입하던 기존 흐름을 다루는 코드 경로가 이번 변경과 직접 연결됩니다.

Suggested reviewers

  • soyeong0115
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 Vercel 배포에서 웹 버전이 표시되지 않는 문제 수정이라는 핵심 변경을 정확히 요약합니다.
Linked Issues check ✅ Passed build 시점의 버전 조회로 Vercel의 shallow clone과 캐시 제약을 해결해 #270의 핵심 요구를 충족합니다.
Out of Scope Changes check ✅ Passed 버전 조회와 빌드 설정 변경에 국한되어 요구사항 밖의 변경은 보이지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

@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: 2

🤖 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/web/config/getWebVersion.mjs`:
- Around line 17-18: The getWebVersion.mjs file reads environment variables
(VERCEL, VERCEL_GIT_COMMIT_REF, VERCEL_GIT_REPO_OWNER, VERCEL_GIT_REPO_SLUG, and
GITHUB_TOKEN) but these are not declared as dependencies in the Turbo cache
configuration. Add these environment variable keys to the env or globalEnv field
of the affected tasks (build and dev) in turbo.json to ensure that changes to
these environment variables properly invalidate the cache and prevent stale
version values from being reused.
- Around line 31-34: The fetch call to the GitHub API endpoint
(https://api.github.com/repos/${owner}/${repo}/tags?per_page=100) lacks a
timeout configuration, which can cause the build to hang indefinitely during
network delays or API unresponsiveness. Add an AbortController with an explicit
timeout signal to the fetch request options (alongside the existing headers).
Set an appropriate timeout duration (e.g., 5-10 seconds) to ensure the fetch
fails fast and allows the build process to continue or fail gracefully instead
of blocking the next.config evaluation.
🪄 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: 219cc2ec-587b-47c4-92c6-7702d8b73d43

📥 Commits

Reviewing files that changed from the base of the PR and between 69d903e and fbb94c8.

📒 Files selected for processing (4)
  • apps/web/config/getWebVersion.mjs
  • apps/web/next.config.mjs
  • apps/web/package.json
  • apps/web/scripts/prebuild.mjs
💤 Files with no reviewable changes (2)
  • apps/web/scripts/prebuild.mjs
  • apps/web/package.json

Comment thread apps/web/config/getWebVersion.mjs
Comment thread apps/web/config/getWebVersion.mjs 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/web/config/getWebVersion.mjs`:
- Around line 31-33: The getWebVersion.mjs tag lookup only fetches the first 100
GitHub tags, so web-* selection can miss the newest release when there are more
than 100 tags. Update the tag retrieval in getWebVersion to either paginate
through the GitHub “List repository tags” results until all tags are collected
or switch to a direct latest-tag lookup approach, then keep the existing version
चयन logic working against the complete tag set.
🪄 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: 4e544c67-f97c-4c7d-9f75-ded92c172f3e

📥 Commits

Reviewing files that changed from the base of the PR and between fbb94c8 and 9a8d51d.

📒 Files selected for processing (2)
  • apps/web/config/getWebVersion.mjs
  • turbo.json

Comment thread apps/web/config/getWebVersion.mjs Outdated
@iOdiO89
iOdiO89 merged commit f558858 into dev Jun 26, 2026
5 checks passed
@iOdiO89
iOdiO89 deleted the fix/290-version branch June 26, 2026 12:07
iOdiO89 added a commit that referenced this pull request Jul 19, 2026
* fix: 웹 버전 확인 전 반드시 git fetch 하도록 설정

* chore: vercel 배포 로그 확인

* chore: git open api로 웹 버전 정보 확인하도록 변경

* chore: turbo 캐시 의존에 누락된 환경변수 추가

* chore: github api로 version 가져올 때 timeout 10초 제한 추가

* refactor: 가장 최신 웹 버전 태그 가져오도록 수정
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Something isn't working WEB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Vercel 배포 시 환경변수에 Git 태그(웹 버전) 주입 누락 문제

1 participant