Skip to content

fix: back to applogger/v1 DTOs, plain-string log methods - #100

Open
rustatian wants to merge 2 commits into
masterfrom
revert/protos-v1
Open

fix: back to applogger/v1 DTOs, plain-string log methods#100
rustatian wants to merge 2 commits into
masterfrom
revert/protos-v1

Conversation

@rustatian

Copy link
Copy Markdown
Member

RPC layer back on applogger/v1; Error/Warning/Info/Debug/Log take a plain string again, matching roadrunner-php/app-logger.

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.

Copilot AI lite review requested due to automatic review settings August 12, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Reverts the app-logger RPC wire contract back to applogger/v1 DTOs and restores plain-string RPC methods for Error/Warning/Info/Debug/Log, aligning behavior with the v1 proto expectations and the PHP app-logger packages.

Changes:

  • Switch RPC DTO imports from applogger/v2 back to applogger/v1 and update related types.
  • Change RPC log-level methods to accept a plain string argument again.
  • Bump github.com/roadrunner-server/api-go/v6 to v6.0.0-beta.14 in both main and tests modules.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
go.mod Bumps api-go/v6 dependency to v6.0.0-beta.14.
go.sum Updates checksums for the api-go/v6 bump.
rpc.go Reverts RPC method arg types to plain strings and v1 DTOs for context logging.
rpc_test.go Updates unit tests to use v1 DTOs and new RPC method signatures.
tests/go.mod Bumps api-go/v6 in the tests module to v6.0.0-beta.14.
tests/go.sum Updates checksums for the tests module dependency bump.
tests/app_logger_test.go Updates integration tests to call RPC methods with plain string args and v1 DTOs.
Suppressed comments (6)

rpc.go:36

  • This RPC method takes a *bool reply but never writes to it, meaning the wire response will always be false. Set the reply to true on success (and guard against nil for direct calls).
func (r *service) Info(in string, _ *bool) error {
	r.log.InfoContext(context.Background(), in)
	return nil

rpc.go:46

  • The *bool reply is currently ignored, so clients will always decode a false response. Set it to true after the log call (nil-guarded) so the reply reflects success.
func (r *service) Warning(in string, _ *bool) error {
	r.log.WarnContext(context.Background(), in)
	return nil

rpc.go:56

  • The reply parameter is a *bool but is never set, so RPC callers always get false. Consider setting it to true on success (with a nil check for direct calls).
func (r *service) Debug(in string, _ *bool) error {
	r.log.DebugContext(context.Background(), in)
	return nil

rpc.go:68

  • Log now uses a *bool reply but never sets it, so callers always receive false even when the write succeeds. Set the reply to true after a successful write (nil-guarded).
func (r *service) Log(in string, _ *bool) error {
	if _, err := io.WriteString(r.stderr, ensureNewline(in)); err != nil {
		return fmt.Errorf("write log message to stderr: %w", err)
	}
	return nil

rpc_test.go:215

  • This test invokes Log with a nil *bool reply, which doesn't reflect how net/rpc will call the method (non-nil reply). Passing a real reply pointer makes the test closer to production usage and compatible if Log starts setting the reply.
func TestRPCLog(t *testing.T) {
	var buf bytes.Buffer
	s := &service{log: slog.New(slog.DiscardHandler), stderr: &buf}

	err := s.Log("hello stderr\n", nil)
	require.NoError(t, err)

rpc_test.go:242

  • The Log write-failure subtest passes a nil *bool reply. Use a real reply pointer so the call pattern matches net/rpc and remains safe if the implementation sets the reply before returning.
	t.Run("Log", func(t *testing.T) {
		err := s.Log("x", nil)
		require.Error(t, err)
		assert.ErrorIs(t, err, want)
	})

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread rpc.go
Comment thread rpc_test.go
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (3dbff3e) to head (d538cbf).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #100   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           62        62           
=========================================
  Hits            62        62           

☔ View full report in Codecov by Harness.
📢 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.

@rustatian rustatian changed the title Back to applogger/v1 DTOs, plain-string log methods fix: back to applogger/v1 DTOs, plain-string log methods Aug 13, 2026
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.

2 participants