Skip to content

Refactor: enahnce CI - #15147

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
wangq8:refactor/enhance-ci
May 22, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
wangq8:refactor/enhance-ci

Conversation

@wangq8

@wangq8 wangq8 commented May 22, 2026 •

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Refactor: enahnce CI

Type of change

  • Refactoring

@wangq8 wangq8 added the ci Continue Integration label May 22, 2026
@coderabbitai

coderabbitai Bot commented May 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request updates .github/workflows/tests.yml to replace unbounded service-readiness wait loops with bounded 60-iteration loops across four test scenarios (Infinity and Elasticsearch SDK/API and CLI tests). Each loop now includes explicit timeout failure behavior: Docker log output and exit 1 when readiness is not reached.

Changes

Service Readiness Wait Strategy

Layer / File(s) Summary
Bounded service readiness check with timeout
.github/workflows/tests.yml
All service readiness checks in test steps replace open-ended until ... ping ... sleep loops with a uniform for i in $(seq 1 60) pattern that sets a svc_ready flag, logs consistent wait output, and on timeout prints Docker logs and exits non-zero. Applied to Infinity SDK/API tests (lines 236–269), Infinity CLI setup (lines 332–345), Elasticsearch SDK/API tests (lines 450–483), and Elasticsearch CLI setup (lines 546–559).

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A workflow refined with care,
No more endless waiting there—
Sixty tries, then fail with grace,
Docker logs show the race.
Readiness now has a bound! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete; it only repeats the title and marks the refactoring checkbox without explaining what problem is being solved or why the changes were necessary. Expand the description to explain the specific CI issues addressed (e.g., missing timeout/failure paths in service readiness waits) and the benefits of the refactoring.
Title check ❓ Inconclusive The title 'Refactor: enahnce CI' contains a typo ('enahnce' instead of 'enhance') and is vague; it does not clearly specify what CI aspect was refactored or what the main change accomplishes. Correct the typo and provide specific details about the CI enhancement, e.g., 'Refactor: Add timeout handling to service readiness checks in CI workflow'.
✅ Passed checks (3 passed)
Check name Status Explanation
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.

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


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.

@wangq8
wangq8 marked this pull request as ready for review May 22, 2026 06:05
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 22, 2026

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

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 @.github/workflows/tests.yml:
- Around line 236-249: The readiness probe loop uses curl with --connect-timeout
5 which only limits the connect phase and can hang if the endpoint stalls;
update the curl invocation inside the loop that references RAGFLOW_CONTAINER,
HOST_ADDRESS and svc_ready to also include a per-attempt wall-clock timeout
(e.g. add --max-time 10) for all six probes (the occurrences around the shown
loop and the other five blocks referenced in the comment) so each curl call
cannot block indefinitely; also adjust the accompanying rg test to detect curl
calls that use --connect-timeout without a matching --max-time.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a1a598c7-c988-404b-9ad3-4f930ee2bfa2

📥 Commits

Reviewing files that changed from the base of the PR and between a9ec78c and 3ada32b.

📒 Files selected for processing (1)
  • .github/workflows/tests.yml

Comment on lines +236 to +249
svc_ready=0
for i in $(seq 1 60); do
if sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/api/v1/system/ping > /dev/null 2>&1; then
svc_ready=1
break
fi
echo "Waiting for service to be available... ($i/120)"
sleep 5
done
if [ "$svc_ready" -ne 1 ]; then
echo "Service did not become ready after 5 minutes. Docker logs:"
sudo docker logs ${RAGFLOW_CONTAINER}
exit 1
fi

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Bounded loop can still hang because probe lacks total request timeout.

curl --connect-timeout 5 only limits connect phase. If the socket connects but the endpoint stalls, this call can block indefinitely and bypass your 60-iteration cap. Add --max-time to enforce per-attempt wall-clock timeout.

Suggested patch (apply to all six readiness probes)
- if sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 ${HOST_ADDRESS}/api/v1/system/ping > /dev/null 2>&1; then
+ if sudo docker exec ${RAGFLOW_CONTAINER} curl -s --connect-timeout 5 --max-time 5 ${HOST_ADDRESS}/api/v1/system/ping > /dev/null 2>&1; then
#!/bin/bash
# Verify there are no readiness probes that use connect-timeout without max-time.
# Expected result: no output.
rg -nP 'curl\s+-s\s+--connect-timeout\s+5(?!\s+--max-time)' .github/workflows/tests.yml

Also applies to: 256-269, 332-345, 450-463, 470-483, 546-559

🤖 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 @.github/workflows/tests.yml around lines 236 - 249, The readiness probe loop
uses curl with --connect-timeout 5 which only limits the connect phase and can
hang if the endpoint stalls; update the curl invocation inside the loop that
references RAGFLOW_CONTAINER, HOST_ADDRESS and svc_ready to also include a
per-attempt wall-clock timeout (e.g. add --max-time 10) for all six probes (the
occurrences around the shown loop and the other five blocks referenced in the
comment) so each curl call cannot block indefinitely; also adjust the
accompanying rg test to detect curl calls that use --connect-timeout without a
matching --max-time.

@wangq8
wangq8 requested a review from asiroliu May 22, 2026 06:22
@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.12%. Comparing base (a9ec78c) to head (3ada32b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15147   +/-   ##
=======================================
  Coverage   93.12%   93.12%           
=======================================
  Files          10       10           
  Lines         713      713           
  Branches      116      116           
=======================================
  Hits          664      664           
  Misses         29       29           
  Partials       20       20           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 22, 2026
@wangq8
wangq8 merged commit f4e63ef into infiniflow:main May 22, 2026
1 check passed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 8, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants