fix: return error instead of nil when service delete is blocked in non-interactive mode#213
fix: return error instead of nil when service delete is blocked in non-interactive mode#213eliajhmauve wants to merge 1 commit intozeabur:mainfrom
Conversation
…n-interactive mode When --yes is omitted in non-interactive mode, the existing guard already blocks deletion — but returns nil (exit code 0). This makes it impossible for CI/CD scripts to detect that the deletion did not occur. Fix: return fmt.Errorf so the process exits with a non-zero exit code, consistent with how other CLI errors are reported.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 7 minutes and 24 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
Problem
service deletealready has a guard for non-interactive mode without--yes:The guard is correct — deletion is blocked. But returning
nilmeans exit code 0, so CI/CD scripts cannot tell whether the service was actually deleted or silently skipped.Fix
Replace
f.Log.Info(...); return nilwithreturn fmt.Errorf(...)so the exit code is non-zero when deletion is blocked.The
--yes/-yflag and all existing behavior are unchanged.Files changed
internal/cmd/service/delete/delete.go— 1-line fix