fix: disable global timeout for --server mode - #3440
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughServer mode now computes an effective timeout of zero for ChangesServer-mode timeout handling
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🤖 Finished Review · ✅ Success · Started 3:55 PM UTC · Completed 4:10 PM UTC |
PR Summary by QodoDisable global timeout for persistent server mode
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
27 rules 1.
|
There was a problem hiding this comment.
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 `@cmd/root/root_cmd.go`:
- Around line 119-122: The server-mode override in cmd/root/root_cmd.go should
avoid permanently mutating the package-level globalTimeout by using an
invocation-local effective timeout or restoring the prior value after execution.
In cmd/root/root_cmd_test.go, capture globalTimeout before the test and register
t.Cleanup to restore it afterward; apply the change at both listed sites.
🪄 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: Enterprise
Run ID: 9334cf2d-b8de-4017-ab88-f26f762e7053
📒 Files selected for processing (2)
cmd/root/root_cmd.gocmd/root/root_cmd_test.go
ReviewFindingsLow
Previous runReviewFindingsMedium
Low
Labels: PR fixes a bug in CLI timeout behavior for server mode |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
The default 5-minute global timeout was killing the persistent HTTP server started by `ec validate input --server`. The timeout is now automatically disabled when --server is used. Also add missing unit build tag to root_cmd_test.go Ref: https://redhat.atlassian.net/browse/EC-2029 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Not sure why the build task failed, but perhaps it was spurious. |
94c6b77 to
e801b01
Compare
|
🤖 Finished Review · ❌ Failure · Started 4:47 PM UTC · Completed 5:02 PM UTC |
|
Fullsend failed, but the other bots are happy. Ready for (human) review. |
Summary
ec validate input --server--serveris detected, so the server runs indefinitely until interruptedRef: EC-2029
Test plan
go test -tags unit ./cmd/root/... ./cmd/validate/...)TestGlobalTimeoutDisabledInServerModetest verifiesglobalTimeoutis set to 0 when--serverflag is presentec validate input --server --policy <policy>and confirm it stays alive past 5 minutes🤖 Generated with Claude Code