Skip to content

feat: deprecate the MessagePack codec - #52

Merged
roxblnfk merged 3 commits into
4.xfrom
deprecate-msgpack-codec
Oct 12, 2026
Merged

roxblnfk merged 3 commits into
4.xfrom
deprecate-msgpack-codec

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

🔍 What was changed

  • MsgpackCodec and Frame::CODEC_MSGPACK are deprecated and will be removed in the next major. The constructor raises a silenced E_USER_DEPRECATED; the object is still created. Use the default JSON codec or ProtobufCodec instead.
  • Fixed MsgpackCodec construction without ext-msgpack: the rybakit/msgpack branch fell through to the LogicException.
  • The test server now runs on Goridge v4 (Go 1.27), the protocol RoadRunner 3 speaks. The MsgPack RPC suites are replaced by one test that pins the actual behaviour, and the clone test uses RawCodec as its second codec.

Why?

roadrunner/goridge 4.x requires spiral/roadrunner ^3.0, and Goridge v4 does not support MessagePack, so the codec cannot work with this package line. The old test server was built on Goridge v3 and kept the MsgPack suites green.

Review notes

  • Goridge v4 does not answer a MessagePack frame with an RPC error: storeCodec() in ReadRequestHeader fails first, net/rpc stops serving and closes the connection. The PHP client gets a TransportException, not a ServiceException.
  • A clone test that used MsgpackCodec broke the shared static relay pool with dropped connections, so it switched codecs instead of being skipped.

Checklist

  • How was this tested:
    • Full suite locally against a Goridge v4 server built from tests/test-server: 179 tests, 178 passed, 1 skipped (ext-msgpack not installed)
    • Psalm and php-cs-fixer clean
    • Test server image built via tests/test-server/Dockerfile (only go build was run locally)

Summary by CodeRabbit

  • Deprecations
    • MessagePack codecs and frames are deprecated. RoadRunner 3 does not support MessagePack frames and drops the connection when one is received. Use JSON or Protobuf instead.
    • MessagePack support is planned for removal in the next major version.

… missing

The library branch fell through to the LogicException, so the codec could only be built with ext-msgpack.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
RoadRunner 3 runs Goridge v4, which drops the connection on a MessagePack frame, so the codec cannot work with spiral/roadrunner ^3.0. The class stays until the next major; its constructor raises a silenced E_USER_DEPRECATED.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
The v3 server still accepted MessagePack, so the MsgPack RPC suites passed against a protocol RoadRunner 3 no longer speaks. They are replaced by one test that pins the dropped connection, and the clone test switches its second codec to raw. Goridge v4 requires Go 1.27.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk requested a review from a team October 12, 2026 17:51
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7430f64c-4ae8-4b09-b57e-4194faf7665d

📥 Commits

Reviewing files that changed from the base of the PR and between e903420 and 254376f.


⛔ Files ignored due to path filters (1)
  • tests/test-server/go.sum is excluded by !**/*.sum

📒 Files selected for processing (12)
  • README.md
  • composer.json
  • psalm-baseline.xml
  • src/Frame.php
  • src/RPC/Codec/MsgpackCodec.php
  • tests/Goridge/MsgPackMultiRPCTest.php
  • tests/Goridge/MsgPackRPCTest.php
  • tests/Goridge/MsgpackCodecTest.php
  • tests/Goridge/MultiRPC.php
  • tests/test-server/Dockerfile
  • tests/test-server/go.mod
  • tests/test-server/server.go

💤 Files with no reviewable changes (1)
  • tests/Goridge/MsgPackMultiRPCTest.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.



📝 Walkthrough

Walkthrough

The pull request deprecates the MessagePack codec and frame constant, updates tests and the test server to Goridge v4, and removes MessagePack from README guidance and Composer suggestions.

Changes

MessagePack deprecation

Layer / File(s) Summary
Deprecate MessagePack APIs
src/Frame.php, src/RPC/Codec/MsgpackCodec.php, psalm-baseline.xml
The frame constant and codec now document MessagePack's incompatibility with RoadRunner 3 (Goridge v4). Constructing the codec emits an E_USER_DEPRECATED notice. The Composer-library initialization path now returns after setting its handlers.
Update compatibility tests
tests/Goridge/MsgPackRPCTest.php, tests/Goridge/MsgPackMultiRPCTest.php, tests/Goridge/MsgpackCodecTest.php, tests/Goridge/MultiRPC.php, tests/test-server/*
RPC coverage checks that a MessagePack frame leads to a transport exception and that a default-codec ping returns pong. Codec tests check for the deprecation notice. Multi-RPC tests use RawCodec, and the test server uses Go 1.27 and Goridge v4.
Remove MessagePack recommendations
README.md, composer.json
The README removes MessagePack from its structured-data formats and documents the codec deprecation. Composer metadata removes the MessagePack keyword and suggestions.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: butschster


Merge Risk: ⚪ Minimal · up to 25437

This change deprecates the MessagePack codec and updates test infrastructure and docs. No concrete merge-blocking risk was found. Existing MsgpackCodec users will see a silenced deprecation notice, and behavior is otherwise unchanged.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 6 files. (5 skipped: 5… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: deprecating the MessagePack codec.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Full details: Docstring Coverage

Explanation

Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 6 files. (5 skipped: 5 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@roxblnfk
roxblnfk merged commit aa0f428 into 4.x Oct 12, 2026
14 of 15 checks passed
@roxblnfk
roxblnfk deleted the deprecate-msgpack-codec branch October 12, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant