Skip to content

chore: protoreg plugin#141

Draft
rustatian wants to merge 1 commit intomasterfrom
feature/protoreflect-plugin
Draft

chore: protoreg plugin#141
rustatian wants to merge 1 commit intomasterfrom
feature/protoreflect-plugin

Conversation

@rustatian
Copy link
Member

@rustatian rustatian commented Jan 7, 2026

Reason for This PR

Description of Changes

  • Add protoreg plugin and reflection server.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any user-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.

Summary by CodeRabbit

  • New Features
    • Enabled gRPC server reflection, allowing clients to automatically discover and interact with available services without requiring pre-compiled service definitions.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
@rustatian rustatian self-assigned this Jan 7, 2026
Copilot AI review requested due to automatic review settings January 7, 2026 15:32
@rustatian rustatian added the enhancement New feature or request label Jan 7, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

The changes introduce a new Registry interface for accessing protobuf metadata, enable gRPC server reflection, add protobuf reflection dependencies, and simplify PHP test dependencies by removing unused packages.

Changes

Cohort / File(s) Summary
API Interface Addition
api/interfaces.go
Adds new public Registry interface with methods: Registry(), Services(), and FindMethodByFullPath(). Imports protobuf reflection packages protoresolve and protoreflect.
Dependency Updates
go.mod, tests/go.mod
Adds indirect dependency github.com/jhump/protoreflect/v2 v2.0.0-beta.2 and bumps github.com/prometheus/common from v0.67.4 to v0.67.5.
gRPC Server Configuration
plugin.go
Adds registry field to Plugin struct, registers gRPC server reflection via reflection.Register(p.server) in Serve(), and captures api.Registry instance in Collects() method.
PHP Test Dependencies
tests/php_test_files/composer.json
Removes 12 PHP dependencies (guzzlehttp/guzzle, spiral/roadrunner-tcp, spiral/roadrunner-jobs, and others); retains core packages and adds spiral/goridge ^4.0 as the only new dependency.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐰 A registry hops into sight,
With reflection shining bright,
gRPC now can truly see,
All the methods it will be!
PHP dependencies—poof!—take flight,
Cleaner code, a lovely sight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: protoreg plugin' directly corresponds to the main change: adding a protoreg plugin with reflection server capabilities.
Description check ✅ Passed The description covers all required template sections including reason for PR, changes description, and license acceptance with all checklist items marked as complete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

Copy link

@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: 2

🤖 Fix all issues with AI agents
In @go.mod:
- Line 9: The go.mod currently pins github.com/jhump/protoreflect/v2 at the
pre-release v2.0.0-beta.2; either change that module requirement to the stable
v1.17.0 release if it is API-compatible with your codebase (update any import
paths and run go mod tidy/build to verify), or keep the v2 beta but add a clear
rationale comment in the repo (e.g., in go.mod or a DEPENDENCIES.md) stating why
the pre-release is required and when you plan to reevaluate; ensure CI
builds/tests pass after making the change.

In @plugin.go:
- Line 51: The struct field named `registry` is never referenced after being set
in the Collects() method; either remove the `registry` field declaration from
the plugin struct to eliminate unused state, or if you intend to use it later,
keep the field and add a clear TODO comment next to `registry` describing the
planned usage; also ensure to update any code in Collects() that assigns to
`registry` (in method Collects) so it compiles cleanly after removing or retains
consistency with the TODO when kept.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3452a3f and cb08f92.

⛔ Files ignored due to path filters (3)
  • go.sum is excluded by !**/*.sum
  • go.work.sum is excluded by !**/*.sum
  • tests/go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • api/interfaces.go
  • go.mod
  • plugin.go
  • tests/go.mod
  • tests/php_test_files/composer.json
🧰 Additional context used
🧬 Code graph analysis (1)
plugin.go (1)
api/interfaces.go (1)
  • Registry (16-20)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Agent
  • GitHub Check: CodeQL analysis (go)
  • GitHub Check: gRPC plugin (Go stable, PHP 8.4, OS ubuntu-latest)
  • GitHub Check: Analyze (go)
🔇 Additional comments (8)
go.mod (1)

40-40: LGTM!

The Prometheus dependency bump from v0.67.4 to v0.67.5 appears to be a routine minor version update.

tests/go.mod (1)

60-60: LGTM!

The Prometheus dependency update is consistent with the main module.

api/interfaces.go (2)

6-6: LGTM!

The imports for protoreflection support are appropriate for the new Registry interface.

Also applies to: 13-13


16-20: Interface design is appropriate for dependency injection.

The Registry interface provides a clean API for accessing protobuf metadata and service descriptors. The method signatures appropriately expose proto reflection capabilities. The interface is actively used in the Plugin's dependency injection layer, where implementations are expected to be provided by external modules.

plugin.go (3)

27-27: LGTM!

The import for gRPC reflection support is appropriate for the reflection.Register call added later.


170-170: LGTM!

Registering the gRPC server for reflection is the correct approach to enable the reflection service. This allows clients to query the server for available services and methods.


273-276: Registry collection without usage.

The code collects api.Registry into p.registry, but this field is never referenced elsewhere in the plugin. Consider whether additional logic is missing or if this should be deferred.

Likely an incorrect or invalid review comment.

tests/php_test_files/composer.json (1)

13-13: The composer.json file still contains 9 active dependencies, not just spiral/goridge ^4.0. The PHP test files demonstrate usage of multiple packages including spiral/roadrunner-grpc, spiral/roadrunner-worker, nyholm/psr7, and others. The claim that the file has been "significantly simplified by removing unused dependencies and keeping only spiral/goridge ^4.0" is incorrect.

Likely an incorrect or invalid review comment.

Copy link

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 adds support for gRPC reflection server and introduces a Registry interface for protocol buffer registration, enabling runtime introspection of gRPC services. The changes integrate the protoreg plugin functionality into the existing gRPC plugin.

Key Changes:

  • Added Registry interface in the API layer for protocol buffer service introspection
  • Integrated gRPC reflection server registration in the plugin's Serve method
  • Added dependency on jhump/protoreflect/v2 library (beta version)

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
api/interfaces.go Added new Registry interface with methods for accessing protocol buffer service descriptors and registry
plugin.go Added registry field, integrated reflection.Register call, and added registry collection in dependency injection
go.mod Added jhump/protoreflect/v2 v2.0.0-beta.2 dependency
go.sum Updated checksums for new dependency and prometheus/common version bump
tests/go.mod Added jhump/protoreflect/v2 as indirect dependency
tests/go.sum Updated checksums for test dependencies
tests/php_test_files/composer.json Removed multiple PHP test dependencies (appears unrelated to main changes)
go.work.sum Updated workspace dependency checksums

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant