fix: rename lock/v1 messages back to Request/Response - #95
Conversation
There was a problem hiding this comment.
Pull request overview
Reverts the lock/v1 protobuf message type names back to Request/Response (wire-identical, fields unchanged) to restore compatibility with released DTO/PHP clients, and bumps api-go to the corresponding beta.
Changes:
- Update RPC handler method signatures to use
lock/v1.Requestandlock/v1.Response. - Update test RPC client helpers to construct and send
lock/v1.Requestand decodelock/v1.Response. - Bump
github.com/roadrunner-server/api-go/v6fromv6.0.0-beta.13tov6.0.0-beta.14(root module + tests module) and refreshgo.sumfiles.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
rpc.go |
Switches RPC method signatures to lock/v1.Request / lock/v1.Response to match the reverted proto naming. |
tests/rpc.go |
Updates test RPC client calls to use lock/v1.Request / lock/v1.Response. |
go.mod |
Bumps api-go dependency to v6.0.0-beta.14. |
go.sum |
Updates checksums for the api-go version bump. |
tests/go.mod |
Bumps api-go dependency to v6.0.0-beta.14 for the tests module. |
tests/go.sum |
Updates checksums for the tests module dependency bump. |
Suppressed comments (3)
tests/rpc.go:42
new(int64(ttl))/new(int64(wait))won’t compile becausenewrequires a type, not a value. Use local int64 variables and take their addresses (or a helper likeproto.Int64).
This issue also appears in the following locations of the same file:
- line 45
- line 61
func lock(resource, id string, ttl, wait int) (bool, error) {
return call("lock.Lock", &lockV1.Request{
Resource: resource,
Id: id,
Ttl: new(int64(ttl)),
Wait: new(int64(wait)),
})
tests/rpc.go:51
new(int64(ttl))/new(int64(wait))won’t compile becausenewrequires a type, not a value. Use local int64 variables and take their addresses (or a helper likeproto.Int64).
func lockRead(resource, id string, ttl, wait int) (bool, error) {
return call("lock.LockRead", &lockV1.Request{
Resource: resource,
Id: id,
Ttl: new(int64(ttl)),
Wait: new(int64(wait)),
})
tests/rpc.go:66
new(int64(ttl))won’t compile becausenewrequires a type, not a value. Use a local int64 variable and take its address (or a helper likeproto.Int64).
func updateTTL(resource, id string, ttl int) (bool, error) {
return call("lock.UpdateTTL", &lockV1.Request{
Resource: resource,
Id: id,
Ttl: new(int64(ttl)),
})
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #95 +/- ##
==========================================
- Coverage 79.49% 75.89% -3.60%
==========================================
Files 4 4
Lines 668 668
==========================================
- Hits 531 507 -24
- Misses 117 141 +24
Partials 20 20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
lock/v1 message names are Request/Response again (fields unchanged, wire-identical).
Part of the v1 proto revert (roadrunner-server/api#77, roadrunner-server/api-go#35): wire format back to what roadrunner-api-dto v1.14.1 and the released PHP packages speak. Pins api-go v6.0.0-beta.14. Tests temporarily pin sibling revert branches via pseudo-versions; they will be bumped to the new betas once tagged.