Skip to content

Feat/add keep alive action#24

Merged
SanghunYun95 merged 64 commits intomainfrom
feat/add-keep-alive-action
Mar 25, 2026
Merged

Feat/add keep alive action#24
SanghunYun95 merged 64 commits intomainfrom
feat/add-keep-alive-action

Conversation

@SanghunYun95
Copy link
Copy Markdown
Owner

@SanghunYun95 SanghunYun95 commented Mar 25, 2026

Summary by CodeRabbit

  • Chores
    • 자동화 워크플로우의 안정성이 개선되었습니다. 서비스 모니터링이 더 정확한 상태 감지와 오류 집계로 강화되어, 리다이렉션을 포함한 엔드포인트 응답을 보다 신뢰성 있게 확인하고 심각한 서버 오류나 연결 실패를 포착하여 전체 체크의 실패 여부를 종합적으로 판단합니다.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

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

Project Deployment Actions Updated (UTC)
philo-rag Ready Ready Preview, Comment Mar 25, 2026 1:28pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

keep-alive GitHub Actions 단계의 셸 옵션을 완화하고, Supabase 대상 경로를 /rest/v1/로 변경하며, HEAD 요청에서 리다이렉트 추적을 하는 GET 요청으로 전환해 HTTP 상태 코드를 캡처하고 집계된 종료 상태로 처리하도록 변경했습니다.

Changes

Cohort / File(s) 요약
GitHub Actions Workflow
\.github/workflows/keep-alive.yml
keep-alive 단계 수정: set -e 제거 (set -uo pipefail), 대상 URL을 도메인 루트에서 .../rest/v1/로 변경, curl -fsS -I(HEAD) → curl -s -L(GET, 리다이렉트 추적)로 전환, HTTP 상태 코드(요청 실패는 000) 캡처, 200–499를 정상으로 보고 500 이상 또는 000을 오류로 처리, 개별 오류를 집계하는 EXIT_STATUS 도입 및 마지막에 집계된 종료 코드로 종료.

Sequence Diagram(s)

(생성 조건 미충족 — 생략)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 분

Possibly related PRs

  • Feat/add keep alive action #22: 동일한 .github/workflows/keep-alive.yml를 다루며 초기 워크플로우의 HEAD 요청 및 엄격한 셸 옵션을 변경한 PR로, curl 동작 및 셸 옵션 관련 수정점이 코드 수준에서 연관됩니다.

🐰 발끝으로 톡톡, 워크플로우 깨우네
리다이렉트 따라가며 상태를 보며,
숫자 하나하나 집계해,
서버가 웃으면 통과, 울면 알려주네.
홧팅! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Feat/add keep alive action' is vague and doesn't clearly convey what the pull request actually changes. It uses generic phrasing that could apply to many different types of changes to a keep-alive workflow. Consider using a more specific title that describes the actual changes, such as 'Refactor keep-alive workflow to handle HTTP errors gracefully' or 'Improve keep-alive script error handling and status code validation'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-keep-alive-action
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/add-keep-alive-action

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/keep-alive.yml (1)

32-40: HTTP_CODE가 비어있거나 "000"인 경우 처리 개선 고려

curl이 완전히 실패하는 경우(DNS 해석 실패, 네트워크 도달 불가 등) HTTP_CODE가 "000"이거나 빈 문자열이 될 수 있습니다. 현재 조건문은 "000"은 올바르게 처리하지만, 빈 문자열일 경우 산술 비교에서 예상치 못한 동작이 발생할 수 있습니다.

♻️ 연결 실패 시 명확한 에러 메시지를 위한 제안
            HTTP_CODE=$(curl -s -L -o /dev/null -w "%{http_code}" --connect-timeout 30 --max-time 120 --retry 3 "$url")
+           HTTP_CODE=${HTTP_CODE:-000}  # 빈 문자열인 경우 기본값 설정
            echo "HTTP Status for $url: $HTTP_CODE"
            
-           if [[ "$HTTP_CODE" -ge 200 && "$HTTP_CODE" -lt 500 ]]; then
+           if [[ "$HTTP_CODE" == "000" ]]; then
+             echo "::error::Failed to connect to $url (Connection failed)"
+             EXIT_STATUS=1
+           elif [[ "$HTTP_CODE" -ge 200 && "$HTTP_CODE" -lt 500 ]]; then
              echo "Keep-alive ping sent to $url at $(date -u +'%Y-%m-%dT%H:%M:%SZ')"
            else
              echo "::error::Failed to ping $url (Status: $HTTP_CODE)"
              EXIT_STATUS=1
            fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/keep-alive.yml around lines 32 - 40, The HTTP status
handling should explicitly detect empty or "000" results from the curl call
before performing numeric comparisons: check the HTTP_CODE variable returned by
the curl invocation (HTTP_CODE) and if it is empty or equals "000" print a clear
error message (including the URL and that curl failed to connect), set
EXIT_STATUS=1, and skip the numeric comparison branch; otherwise proceed with
the existing numeric range check (the if [[ "$HTTP_CODE" -ge 200 && "$HTTP_CODE"
-lt 500 ]]) to mark success/failure. Ensure the error branch also keeps the
existing ::error:: format and uses the same EXIT_STATUS variable so CI correctly
fails.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/keep-alive.yml:
- Around line 32-40: The HTTP status handling should explicitly detect empty or
"000" results from the curl call before performing numeric comparisons: check
the HTTP_CODE variable returned by the curl invocation (HTTP_CODE) and if it is
empty or equals "000" print a clear error message (including the URL and that
curl failed to connect), set EXIT_STATUS=1, and skip the numeric comparison
branch; otherwise proceed with the existing numeric range check (the if [[
"$HTTP_CODE" -ge 200 && "$HTTP_CODE" -lt 500 ]]) to mark success/failure. Ensure
the error branch also keeps the existing ::error:: format and uses the same
EXIT_STATUS variable so CI correctly fails.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4b9e834e-874f-49c6-ba1b-1a4afaa09322

📥 Commits

Reviewing files that changed from the base of the PR and between 427fc30 and a4f65e0.

📒 Files selected for processing (1)
  • .github/workflows/keep-alive.yml

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/keep-alive.yml (1)

36-46: HTTP 상태 코드 검증 로직이 적절합니다

  • 000: 연결 실패 처리
  • 200-499: 서비스 활성 상태 (4xx는 인증 필요한 Supabase에서 401 반환 시에도 서비스가 살아있음을 의미)
  • 500+: 서버 에러로 실패 처리

로직이 keep-alive 목적에 잘 부합합니다.

선택적 개선: 예기치 않은 비숫자 응답에 대한 방어적 처리를 추가할 수 있습니다.

♻️ 선택적 개선 제안
            HTTP_CODE=${HTTP_CODE:-000}
            echo "HTTP Status for $url: $HTTP_CODE"
            
-           if [[ "$HTTP_CODE" == "000" ]]; then
+           if ! [[ "$HTTP_CODE" =~ ^[0-9]+$ ]]; then
+             echo "::error::Invalid HTTP response from $url (Code: $HTTP_CODE)"
+             EXIT_STATUS=1
+           elif [[ "$HTTP_CODE" == "000" ]]; then
              echo "::error::Failed to connect to $url (Connection failed)"
              EXIT_STATUS=1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/keep-alive.yml around lines 36 - 46, The current
keep-alive step assumes $HTTP_CODE is numeric; add a defensive check before the
existing if/elif/else so that when HTTP_CODE is empty or non-numeric you treat
it as a failure: validate $HTTP_CODE (e.g., regex /^[0-9]+$/) and if it fails,
echo an error like "::error::Unexpected HTTP_CODE value: $HTTP_CODE" and set
EXIT_STATUS=1, otherwise proceed with the existing numeric comparisons (the
variable to update and checks to guard are the same HTTP_CODE and EXIT_STATUS
used in the shown if/elif/else block).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/keep-alive.yml:
- Around line 36-46: The current keep-alive step assumes $HTTP_CODE is numeric;
add a defensive check before the existing if/elif/else so that when HTTP_CODE is
empty or non-numeric you treat it as a failure: validate $HTTP_CODE (e.g., regex
/^[0-9]+$/) and if it fails, echo an error like "::error::Unexpected HTTP_CODE
value: $HTTP_CODE" and set EXIT_STATUS=1, otherwise proceed with the existing
numeric comparisons (the variable to update and checks to guard are the same
HTTP_CODE and EXIT_STATUS used in the shown if/elif/else block).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 23f066a5-6bf1-445b-8f16-68ee4e2f89d7

📥 Commits

Reviewing files that changed from the base of the PR and between a4f65e0 and 24c81d9.

📒 Files selected for processing (1)
  • .github/workflows/keep-alive.yml

@SanghunYun95 SanghunYun95 merged commit 5dd6710 into main Mar 25, 2026
3 checks passed
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