fix: require --yes for money operations in non-interactive mode#216
fix: require --yes for money operations in non-interactive mode#216eliajhmauve wants to merge 1 commit intozeabur:mainfrom
Conversation
Server rent and domain purchase proceed without confirmation in non-interactive mode when --yes is not provided. This can cause unintended charges in CI/CD pipelines. Add an else-if guard to return an error requiring the --yes flag, consistent with how project delete already handles this.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughBoth the domain purchase and server rent CLI commands now enforce the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Summary
server rentanddomain purchaseskip confirmation entirely in non-interactive mode when--yesis not provided, allowing money operations to proceed silently. This can cause unintended charges in CI/CD pipelines.Bug
Both commands use
if f.Interactive && !opts.skipConfirmto guard the confirmation prompt. In non-interactive mode this condition is false, so the code falls through to the API call without any confirmation or error.server/rent/rent.go:domain/purchase/purchase.go:Fix
Add an
else ifguard that returns an error when--yesis not provided in non-interactive mode:This is consistent with how
project deletealready handles the same scenario.Affected Commands
zeabur server rent— rents a server (charges money)zeabur domain purchase— purchases a domain (charges money)Summary by CodeRabbit
--yesflag for confirmation--yesflag for confirmation