Add UpdateComposeSource RPC for existing compose stacks - #7
Conversation
DeployCompose calls services.compose.createService first, so the panel rejects it with "Service already exists." before any content is written. There was no way to replace the compose content of a running stack over gRPC, only via the CLI's set-source-inline. UpdateComposeSource writes the content and redeploys, running the same gate as DeployCompose: invalid YAML and network_mode host are rejected, host-published ports are stripped, expose is kept. A missing service, or one that exists under a different type, maps to NotFound rather than a bare panel error, since the panel answers NOT_FOUND for both. skip_deploy stores the content without deploying so a caller can batch edits and deploy once. Also drop composeFile from the updateSourceInline payload. The panel's schema accepts only projectName, serviceName and content, and silently dropped the extra field, so both the RPC and the CLI were sending a field that never existed. services set-source-inline now takes 3 positional arguments; the old 4-argument form still works and warns that compose-file is ignored.
- CHANGELOG: v0.2.0 entry covering the new RPC, the dropped composeFile field and the set-source-inline argument change. - Deployment guide: new "Update an existing Compose stack" section under the gRPC Compose chapter, with the exact DeployCompose error it works around and a field table. The CLI Compose chapter points at it. - README: UpdateComposeSource in the RPC table, a grpcurl example, RPC count 17, corrected set-source-inline usage. - Bump documented image tags to 0.2.0.
|
Warning Review limit reached
Next review available in: 55 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughThe PR adds ChangesCompose source update
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant PaaSServer
participant Easypanel
Caller->>PaaSServer: UpdateComposeSource request
PaaSServer->>PaaSServer: Validate and sanitize YAML
PaaSServer->>Easypanel: Replace Compose source
Easypanel-->>PaaSServer: Stored result or NOT_FOUND
PaaSServer->>Easypanel: Redeploy when skip_deploy is false
PaaSServer-->>Caller: Update response
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
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 `@grpc_e2e_test.go`:
- Around line 639-651: Extend the Step 6 test after the existing skipDeploy
response assertions to read back the persisted compose source using the test’s
existing source retrieval mechanism. Assert that the returned content contains
“nginx:alpine” and no longer contains “httpd:alpine”, preserving the current
deployed=false/status=stored checks.
🪄 Autofix
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4022aa8a-be36-4f16-8f86-9d70d03cf1fd
⛔ Files ignored due to path filters (2)
proto/paas.pb.gois excluded by!**/*.pb.goproto/paas_grpc.pb.gois excluded by!**/*.pb.go
📒 Files selected for processing (11)
CHANGELOG.mdREADME.mdcmd/services.godocs/deployment-guide.mdgrpc_e2e_test.gointernal/easypanel/client.gointernal/easypanel/version_test.gointernal/server/paas.gointernal/server/panel_fake_test.gointernal/server/updatecomposesource_test.goproto/paas.proto
Why
DeployComposeis intentionally create-only: it callsservices.compose.createServicefirst. A second call for an existing stack fails with the panel'sService already exists.beforeupdateSourceInlinecan run. The CLI had an update path, but gRPC did not.What changed
paas.PaaS/UpdateComposeSource.skip_deploystores content for batched changes.DeployCompose: invalid YAML andnetwork_mode: hostrejected; hostports:removed;expose:retained.NotFound.composeFiletoservices.compose.updateSourceInline; panel schema accepts onlyprojectName,serviceName,content.services set-source-inlinenow documents and accepts 3 args. Legacy 4-arg form remains compatible and warns its compose-file argument is ignored.v0.2.0.Verification
make fmt-checkmake vetgo build ./...go test ./internal/... ./cmd/... -count=1go test ./... -count=1 -timeout 25m— passed; includes liveTestGRPC_UpdateComposeSourceE2Etwice.Live E2E asserts missing service maps to
NotFound,DeployComposestill rejects an existing service, the new RPC replaces content and strips host ports,skip_deploystores without deploy, and cleanup destroys the throwaway service.Summary by CodeRabbit
New Features
Documentation
Bug Fixes