feat(service): mark GetStatus, GetStatuses, ListServices as NO_SIDE_EFFECTS#73
Conversation
…FFECTS Annotate the three read-only methods on service.v1.ServiceManager with idempotency_level = NO_SIDE_EFFECTS so Connect-RPC handlers accept HTTP GET for them. The service plugin's read endpoints can then sit behind CDN/proxy caches and be probed from cacheable URLs. CreateService, Terminate, Restart stay POST-only — each mutates the service plugin's process table. Additive proto change; existing POST clients keep working.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds explicit ChangesRPC Idempotency Declaration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Pull request overview
This PR updates the service.v1.ServiceManager protobuf API to explicitly mark the three read-only RPC methods as NO_SIDE_EFFECTS, enabling Connect-RPC to safely expose them over HTTP GET (in addition to POST) for improved caching/probing behavior while keeping mutating methods POST-only.
Changes:
- Annotated
GetStatuswithoption idempotency_level = NO_SIDE_EFFECTS; - Annotated
GetStatuseswithoption idempotency_level = NO_SIDE_EFFECTS; - Annotated
ListServiceswithoption idempotency_level = NO_SIDE_EFFECTS;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Annotate the three read-only methods on
service.v1.ServiceManagerwithoption idempotency_level = NO_SIDE_EFFECTS;:GetStatus— returns the status of a single service's first process. (Deprecated in favor ofGetStatuses, but still served.)GetStatuses— returns per-process status for one service.ListServices— enumerates registered service names.Connect-RPC generates handlers that accept HTTP GET (in addition to POST) for methods carrying this annotation. CDN/proxy/browser layers can cache the responses; PHP clients can probe via
GET /service.v1.ServiceManager/ListServices?message=...directly.CreateService,Terminate,Restartstay POST-only — each mutates the service plugin's internal process table.The annotation is additive: existing POST clients continue to work unchanged. After this PR lands,
update-proto.ymlwill regenerate the Connect bindings on api-go and the next api-gov6.0.0-beta.Xtag will pick up the new behavior.Summary by CodeRabbit