Skip to content

feat: Connect-RPC service definitions for informer, metrics, resetter, tcp#74

Merged
rustatian merged 4 commits into
masterfrom
feature/tier-c-services
May 12, 2026
Merged

feat: Connect-RPC service definitions for informer, metrics, resetter, tcp#74
rustatian merged 4 commits into
masterfrom
feature/tier-c-services

Conversation

@rustatian
Copy link
Copy Markdown
Member

@rustatian rustatian commented May 12, 2026

Summary

Adds proto service blocks for the four Tier C plugins so they can migrate to Connect-RPC on the next plugin sweep. Each plugin gets its own v1 package under roadrunner/api/<domain>/v1/service.proto. Read-only RPCs are marked option idempotency_level = NO_SIDE_EFFECTS; so the generated Connect handlers accept HTTP GET (clients without a Connect SDK — e.g. PHP via curl — can call them as plain GET requests).

informer/v1.InformerService

RPC HTTP method Notes
ListPlugins GET returns the set of plugins exposing workers
GetWorkers GET per-plugin OS-process snapshot
GetJobs GET per-plugin jobs-pipeline state snapshot
AddWorker POST dedicated AddWorkerRequest
RemoveWorker POST dedicated RemoveWorkerRequest

ProcessState mirrors pool/v2/state/process.State. Field widths follow the existing service.v1.Status convention rather than the Go source: int32 pid (POSIX PIDs always fit) and float cpu_percent (consistency with the rest of the api repo). JobState mirrors api-plugins/v6/jobs.State.

metrics/v1.MetricsService

RPC HTTP method Notes
Add / Sub / Observe / Set POST each wraps a Metric in its own dedicated request — AddRequest, SubRequest, ObserveRequest, SetRequest
Declare POST wraps NamedCollector
Unregister POST takes a name

Notes:

  • CollectorType is a proto enum (HISTOGRAM / GAUGE / COUNTER / SUMMARY).
  • Collector.Objectives is repeated Objective { double quantile; double error; } — proto3 forbids float-keyed maps (the Go type uses map[float64]float64).
  • No GET candidates — every method mutates the Prometheus registry.
  • Scraping continues to happen on the existing Prometheus HTTP endpoint (metrics.address config); it is not part of this RPC surface.

resetter/v1.ResetterService

RPC HTTP method
ListPlugins GET
Reset POST

tcp/v1.TCPService

RPC HTTP method
Close POST

Single method: terminate an open TCP connection identified by UUID.

Breaking changes

None. These are net-new proto packages; no existing message or service is renamed or removed.

…tter, tcp

Tier C plugin RPC migration: each gets its own v1 service block, with read-only
methods marked NO_SIDE_EFFECTS so generated Connect handlers accept HTTP GET.

informer/v1.InformerService
  - ListPlugins, GetWorkers, GetJobs (GET)
  - AddWorker, RemoveWorker

metrics/v1.MetricsService
  - Add, Sub, Observe, Set (mutate prometheus state)
  - Declare, Unregister
  - CollectorType enum + Objective repeated message (proto3 disallows float-keyed maps)

resetter/v1.ResetterService
  - ListPlugins (GET)
  - Reset

tcp/v1.TCPService
  - Close
Copilot AI review requested due to automatic review settings May 12, 2026 15:10
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Warning

Rate limit exceeded

@rustatian has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 36 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 11336609-201f-4c32-8a43-657633b1e151

📥 Commits

Reviewing files that changed from the base of the PR and between 137d5aa and 41847c0.

📒 Files selected for processing (3)
  • .github/workflows/buf-lint.yml
  • roadrunner/api/informer/v1/service.proto
  • roadrunner/api/tcp/v1/service.proto
📝 Walkthrough

Walkthrough

This PR introduces four new gRPC service API definitions as protobuf specifications. The InformerService exposes worker state introspection and lifecycle operations, the MetricsService provides write-side metric mutation, the ResetterService controls plugin reset behavior, and the TCPService manages TCP connection closure. Each service is independently defined in its own protobuf package (informer.v1, metrics.v1, resetter.v1, tcp.v1).

Changes

Runtime Management Service APIs

Layer / File(s) Summary
Informer Service API for worker state introspection
roadrunner/api/informer/v1/service.proto
Protobuf InformerService contract with ProcessState and JobState data messages, RPCs for listing plugins, retrieving worker and job states (marked NO_SIDE_EFFECTS), and operations to add/remove workers.
Metrics Service API for runtime metric mutation
roadrunner/api/metrics/v1/service.proto
Protobuf MetricsService contract with CollectorType enum, Objective/Collector/Metric shape messages for Prometheus schema, and write-side RPCs (Add, Sub, Observe, Set, Declare, Unregister) each returning Response.
Resetter Service API for plugin reset control
roadrunner/api/resetter/v1/service.proto
Protobuf ResetterService contract with ListPlugins (marked idempotent) and Reset RPCs for plugin lifecycle management.
TCP Service API for connection management
roadrunner/api/tcp/v1/service.proto
Protobuf TCPService contract with a single Close RPC accepting a UUID and returning operation success status.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

C-enhancement

Poem

🐰 Four new APIs hop into view,
Worker states and metrics too,
Reset and TCP take their place,
gRPC contracts with style and grace!
Services running at rabbit pace! 🏃‍♂️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding Connect-RPC service definitions for four plugins (informer, metrics, resetter, tcp).
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.
Description check ✅ Passed The pull request provides a comprehensive description with clear objectives, detailed service definitions, HTTP method mappings, field specifications, and explicitly states there are no breaking changes.

✏️ 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/tier-c-services

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
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

Adds new Connect-RPC proto surfaces for four Tier C plugins (informer, metrics, resetter, tcp) under roadrunner/api/<domain>/v1/service.proto, enabling those plugins to migrate to Connect-RPC while marking read-only RPCs as NO_SIDE_EFFECTS for HTTP GET compatibility.

Changes:

  • Introduce InformerService (read-only introspection + worker add/remove) with ProcessState/JobState message models.
  • Introduce MetricsService for runtime metric mutation, including collector/metric models and CollectorType.
  • Introduce ResetterService (list plugins + reset) and TCPService (close connection by UUID).

Reviewed changes

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

File Description
roadrunner/api/informer/v1/service.proto Defines the Informer Connect-RPC surface and state snapshot messages.
roadrunner/api/metrics/v1/service.proto Defines the Metrics Connect-RPC surface and Prometheus collector/metric DTOs.
roadrunner/api/resetter/v1/service.proto Defines the Resetter Connect-RPC surface for listing/resetting plugins.
roadrunner/api/tcp/v1/service.proto Defines the TCP Connect-RPC surface for closing connections by UUID.

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

Comment thread roadrunner/api/tcp/v1/service.proto Outdated
Comment thread roadrunner/api/informer/v1/service.proto Outdated
Comment thread roadrunner/api/informer/v1/service.proto
@rustatian rustatian self-assigned this May 12, 2026
@rustatian rustatian added the C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc.. label May 12, 2026
rustatian added 3 commits May 12, 2026 17:51
…; correct TCP PHP namespace

- informer/v1.ProcessState.pid: int64 → int32 (POSIX, matches service.v1.Status.pid)
- informer/v1.ProcessState.cpu_percent: double → float (matches service.v1.Status.cpu_percent)
- tcp/v1 PHP namespace: RoadRunner\Tcp → RoadRunner\TCP (matches HTTP/KV convention)

Surfaced by Copilot review on PR #74.
Runs `buf lint` on every pull_request and master push. Uses the official
bufbuild/buf-setup-action with the GITHUB_TOKEN to avoid GitHub API rate
limits during buf installation.
third_party/api is a submodule (temporalio/api); without it the temporal
proto's external imports don't resolve and buf lint fails.
@rustatian rustatian merged commit c607a0b into master May 12, 2026
2 checks passed
@rustatian rustatian deleted the feature/tier-c-services branch May 12, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc..

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants