fix(deploy): reuse existing service by name to prevent duplicates#223
fix(deploy): reuse existing service by name to prevent duplicates#223stantheman0128 wants to merge 1 commit intozeabur:mainfrom
Conversation
…cates When deploying with --project-id and --name but without --service-id, the CLI unconditionally creates a new service via CreateEmptyService. If a service with the same name already exists, this creates a duplicate (e.g. "my-app-over"). Fix by looking up existing services in the project first and reusing any service that matches the given name. The --create flag can still be used to force creating a new service. Fixes zeabur#203 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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 2 minutes and 44 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 |
Summary
--project-idand--namebut without--service-id, the CLI now checks if a service with the same name already exists before creating a new one--service-id)--createflag can still be used to explicitly force creating a new serviceRoot Cause
In
runDeploy, when--project-idis provided without--service-id, the code callsCreateEmptyService()unconditionally without checking for name collisions. This creates duplicate services (e.g.my-app-over).Changes
internal/cmd/deploy/deploy.go: Before creating a new service, callListAllServicesto check if one with the same name already exists. If it does, reuse it. If--createis explicitly set, always create a new service.Fixes #203
Test plan
--project-id --name "my-app"twice — second deploy should update existing service, not create duplicate--project-id --name "my-app" --create— should always create a new service--project-id --service-id— behavior unchanged (uses provided service ID)🤖 Generated with Claude Code