Skip to content

refactor: drop RPC layer; goridge is a pure IPC transport library#203

Merged
rustatian merged 4 commits into
masterfrom
feature/drop-rpc
May 9, 2026
Merged

refactor: drop RPC layer; goridge is a pure IPC transport library#203
rustatian merged 4 commits into
masterfrom
feature/drop-rpc

Conversation

@rustatian
Copy link
Copy Markdown
Member

@rustatian rustatian commented May 9, 2026

Summary

  • Removes pkg/rpc/ (the net/rpc.ServerCodec + ClientCodec implementations on top of the goridge frame protocol). The rpc plugin migrated to Connect-RPC, so this layer no longer has an in-tree consumer.
  • Removes benchmarks/main.go (benchmarked the deleted RPC codec) and the tests/ directory (RPC regression test, generated proto used only by RPC tests, and the PHP fixtures for the goridge RPC client).
  • Drops google.golang.org/protobuf and its transitives from go.mod / go.sum.
  • Reframes README.md around the binary frame protocol + pipe/socket relays; replaces the net/rpc sample with a socket.NewSocketRelay echo server.
  • Updates Makefile and the Linux/macOS/Windows workflows to stop testing ./pkg/rpc.

Net change: 19 files, +44 / -1874.

Breaking changes

  • Anything importing github.com/roadrunner-server/goridge/v4/pkg/rpc no longer compiles after the next beta bump.
  • A sweep of /home/valery/projects/spiral/plugins/* finds ~30 test-helper files still importing pkg/rpc; each pins v4.0.0-beta.1 in its own go.mod and keeps building until that plugin bumps goridge. The bump is the natural fast-fail trigger for migrating each plugin's test client to a Connect client.
  • goridge is on v4.0.0-beta.1 (pre-stable), so the next tag should be v4.0.0-beta.2 (or higher) — the existing "never delete beta tags" policy applies.

Summary by CodeRabbit

  • Documentation

    • Reframed project description to focus on a binary frame protocol; updated installation and minimal socket-based usage examples.
  • Refactor

    • Removed RPC client/codec implementations and related RPC integration code.
  • Tests

    • Removed RPC and PHP integration tests; removed benchmarking harness.
  • Chores

    • Adjusted CI test coverage targets and workflows; bumped a dependency; updated ignore rules.

Review Change Stack

The rpc plugin migrated to Connect-RPC, leaving goridge's pkg/rpc
(net/rpc.ServerCodec / ClientCodec on top of the goridge frame protocol)
without an in-tree consumer. Strip it; the package's role going forward
is the binary frame protocol with pipe and socket relays for PHP↔Go IPC.

Removed:
- pkg/rpc/                — codec, client, doc, tests
- benchmarks/main.go      — net/rpc benchmark (meaningless without pkg/rpc)
- tests/issues/           — RPC-specific regression test
- tests/message.{pb.go,proto} — proto used only by RPC tests
- tests/php_test_files/   — PHP fixtures for the RPC client

Updated:
- go.mod / go.sum         — drop google.golang.org/protobuf and its
                            transitives (no remaining consumer)
- README.md               — reframe as "IPC transport with pipe/socket
                            relays"; replace the net/rpc sample with a
                            socket.NewSocketRelay echo server
- Makefile, .github/workflows/{linux,macos,windows}.yml — drop the
                            ./pkg/rpc test invocations

Breaking change for anything importing github.com/roadrunner-server/goridge/v4/pkg/rpc.
A sweep of /home/valery/projects/spiral/plugins shows ~30 test-helper
files in spiral plugins still importing pkg/rpc; those modules pin
v4.0.0-beta.1 in their own go.mod files, so they keep building until
each plugin chooses to bump goridge — that bump is the natural fast-fail
trigger for migrating each plugin's test client to Connect.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 59af738c-2cea-4118-a3f9-333389263ca3

📥 Commits

Reviewing files that changed from the base of the PR and between 6ef8ea3 and 8199136.

📒 Files selected for processing (1)
  • README.md

📝 Walkthrough

Walkthrough

This PR removes Goridge's net/rpc codec infrastructure entirely, repositioning the project as a standalone binary frame protocol library with pipe and socket transports. The changes eliminate 1,300+ lines of RPC-specific code, tests, and PHP integration while pivoting documentation and build configuration to emphasize frame-based IPC.

Changes

RPC Infrastructure Removal & Frame Protocol Pivot

Layer / File(s) Summary
Documentation & Usage Examples
README.md
README is rewritten to describe Goridge as a high-performance binary frame protocol rather than a PHP-to-Golang RPC bridge. Features list, installation instructions, and code examples shift from RPC-based to socket/pipe usage patterns.
RPC Codec Implementation Removal
pkg/rpc/client.go, pkg/rpc/codec.go, pkg/rpc/doc.go
Entire ClientCodec and server Codec types are removed, eliminating request/response framing, codec selection, CRC verification, and all net/rpc integration logic. Package documentation is deleted.
RPC Tests & Integration Removal
pkg/rpc/client_server_test.go, pkg/rpc/codec_edge_test.go, tests/issues/issue_185_test.go, tests/message.proto, tests/php_test_files/issue_185.php, tests/php_test_files/composer.json
Multiple test functions and PHP integration tests are removed; protobuf schema and composer.json dependency on spiral/goridge are deleted.
CI & Build Configuration
.github/workflows/linux.yml, .github/workflows/macos.yml, .github/workflows/windows.yml, Makefile
Test coverage for ./pkg/rpc is removed across all platforms; workflows and Makefile now cover only ./internal, ./pkg/frame, ./pkg/pipe, and ./pkg/socket.
Benchmarks, Dependencies & Configuration
benchmarks/main.go, go.mod, .gitignore
RPC benchmark suite is deleted; github.com/roadrunner-server/errors is bumped to v1.5.0; .gitignore updated to ignore local Claude settings.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 The RPC codec bids farewell,
Frame protocols rise to tell
A simpler tale of pipes and sockets,
No more PHP in code pockets!
Goridge lightens, streamlines true,
From bridge to frames, we start anew. 🚀

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is comprehensive and covers all key changes, breaking changes, and rationale, but the formal PR description template sections are not explicitly filled. Ensure the description explicitly follows the template structure with 'Reason for This PR', 'Description of Changes', and 'License Acceptance' sections, and verify all checklist items are addressed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: dropping the RPC layer and reframing goridge as a pure IPC transport library.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/drop-rpc

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 and usage tips.

@rustatian rustatian self-assigned this May 9, 2026
@rustatian rustatian marked this pull request as ready for review May 9, 2026 19:15
Copilot AI review requested due to automatic review settings May 9, 2026 19:15
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 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 @.claude/settings.local.json:
- Around line 1-21: Remove the local Claude policy file from the PR and stop
tracking it: delete .claude/settings.local.json from the commit, add the
filename (or the entire .claude/ directory) to .gitignore, and run git rm
--cached on the file so it remains local but is not committed; also re-check the
commit history for any other local agent policy files and ensure none are
included before merging.

In `@README.md`:
- Line 23: Update the README wording: change the phrase "no external
dependencies, drop-in (64bit PHP required for the PHP side)" to use "64-bit"
(i.e., "no external dependencies, drop-in (64-bit PHP required for the PHP
side)"), and rename the heading "### Sample of usage" to "### Sample usage" to
improve clarity; edit the exact strings in the README where they appear.
- Line 41: The heading "Sample of usage" currently uses ATX style (###); change
it to the document's setext-style to satisfy MD003 by replacing the ATX line
"### Sample of usage" with a setext header: keep the text "Sample of usage" on
its own line and add a following underline of hyphens (---) to make it a setext
H2 so it matches the rest of the README's header style.
🪄 Autofix (Beta)

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

Run ID: a38fc058-6869-453e-8dbb-4d856ae4d424

📥 Commits

Reviewing files that changed from the base of the PR and between 5aa585d and eae0ed3.

⛔ Files ignored due to path filters (3)
  • go.sum is excluded by !**/*.sum
  • tests/message.pb.go is excluded by !**/*.pb.go
  • tests/php_test_files/composer.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • .claude/settings.local.json
  • .github/workflows/linux.yml
  • .github/workflows/macos.yml
  • .github/workflows/windows.yml
  • Makefile
  • README.md
  • benchmarks/main.go
  • go.mod
  • pkg/rpc/client.go
  • pkg/rpc/client_server_test.go
  • pkg/rpc/codec.go
  • pkg/rpc/codec_edge_test.go
  • pkg/rpc/doc.go
  • tests/issues/issue_185_test.go
  • tests/message.proto
  • tests/php_test_files/composer.json
  • tests/php_test_files/issue_185.php
💤 Files with no reviewable changes (14)
  • .github/workflows/linux.yml
  • .github/workflows/macos.yml
  • Makefile
  • pkg/rpc/doc.go
  • tests/php_test_files/issue_185.php
  • tests/php_test_files/composer.json
  • pkg/rpc/client_server_test.go
  • .github/workflows/windows.yml
  • pkg/rpc/client.go
  • tests/issues/issue_185_test.go
  • benchmarks/main.go
  • tests/message.proto
  • pkg/rpc/codec.go
  • pkg/rpc/codec_edge_test.go

Comment thread .claude/settings.local.json Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.59%. Comparing base (5aa585d) to head (8199136).

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #203       +/-   ##
===========================================
+ Coverage   72.05%   90.59%   +18.53%     
===========================================
  Files           8        5        -3     
  Lines         816      372      -444     
===========================================
- Hits          588      337      -251     
+ Misses        193       21      -172     
+ Partials       35       14       -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors goridge into a pure IPC transport library by removing the in-tree net/rpc codec layer and associated benchmarks/tests, and updating docs/tooling to reflect the frame protocol + relays as the primary surface.

Changes:

  • Remove pkg/rpc (server/client codecs on top of the frame protocol) and all RPC-specific benchmarks and tests.
  • Drop protobuf dependencies from go.mod/go.sum.
  • Update README.md, Makefile, and CI workflows to align with a transport-only library.

Reviewed changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/php_test_files/issue_185.php Removed PHP RPC fixture used by the deleted RPC layer tests.
tests/php_test_files/composer.lock Removed PHP dependency lockfile used only by removed fixtures/tests.
tests/php_test_files/composer.json Removed PHP fixture dependency definition.
tests/message.proto Removed proto schema used only by removed RPC tests/benchmarks.
tests/message.pb.go Removed generated Go protobuf code tied to deleted RPC tests/benchmarks.
tests/issues/issue_185_test.go Removed Go regression test that depended on pkg/rpc and PHP fixtures.
README.md Reframed project description around frame protocol + relays; replaced net/rpc sample with socket relay echo server.
pkg/rpc/doc.go Removed RPC package docs due to deletion of RPC layer.
pkg/rpc/codec.go Removed server-side net/rpc codec implementation.
pkg/rpc/codec_edge_test.go Removed RPC codec edge/regression tests.
pkg/rpc/client.go Removed client-side net/rpc codec implementation.
pkg/rpc/client_server_test.go Removed RPC client/server integration tests (proto/json/raw/concurrency).
Makefile Removed go test target invocation for deleted ./pkg/rpc.
go.sum Removed protobuf-related sums; updated roadrunner-server/errors sums.
go.mod Dropped protobuf dependency; bumped roadrunner-server/errors version.
benchmarks/main.go Removed benchmark app that exercised the deleted RPC codec.
.github/workflows/windows.yml Updated CI to stop testing ./pkg/rpc.
.github/workflows/macos.yml Updated CI to stop testing ./pkg/rpc.
.github/workflows/linux.yml Updated CI to stop testing ./pkg/rpc.
.claude/settings.local.json Added Claude local permissions config file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
for {
conn, err := ln.Accept()
if err != nil {
continue
Comment thread README.md
Comment on lines +80 to +86
out := frame.NewFrame()
out.WriteVersion(out.Header(), frame.Version1)
out.WriteFlags(out.Header(), frame.CodecRaw)
out.WritePayload(in.Payload())
out.WritePayloadLen(out.Header(), uint32(len(in.Payload())))
out.WriteCRC(out.Header())

Comment thread .claude/settings.local.json Outdated
Comment on lines +3 to +19
"allow": [
"Bash(tail:*)",
"Bash(go test:*)",
"Bash(golangci-lint run:*)",
"Bash(head:*)",
"Bash(gh api:*)",
"Bash(ls:*)",
"Bash(which yamllint:*)",
"Bash(go run:*)",
"WebFetch(domain:github.com)",
"WebFetch(domain:raw.githubusercontent.com)",
"Bash(php:*)",
"WebFetch(domain:packagist.org)",
"Bash(git:*)",
"WebFetch(domain:api.github.com)",
"WebSearch"
]
rustatian added 2 commits May 9, 2026 21:20
Removes the accidentally-tracked .claude/settings.local.json (it's a
per-user IDE state file, not shared project config) and adds it to
.gitignore so it stays out of the repo on future commits.
- "64bit" → "64-bit" hyphenation
- "Sample of usage" → "Sample usage", switch from ATX (###) to setext
  to match the rest of the README and silence markdownlint MD003
- log + return on Accept() failure instead of silently spinning
- mirror the incoming frame's version + flags in the response so the
  echo example is faithful for clients sending JSON / Proto / Gob
  framed payloads
@rustatian rustatian merged commit 7704fbd into master May 9, 2026
15 checks passed
@rustatian rustatian deleted the feature/drop-rpc branch May 9, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants