Skip to content

chore(tests): migrate goridge rpc + api/v4 → connectrpc + api-go/v6#259

Merged
rustatian merged 7 commits into
masterfrom
chore/connectrpc-migration
May 25, 2026
Merged

chore(tests): migrate goridge rpc + api/v4 → connectrpc + api-go/v6#259
rustatian merged 7 commits into
masterfrom
chore/connectrpc-migration

Conversation

@rustatian
Copy link
Copy Markdown
Member

Summary

Migrate all goridge net/rpc + pkg/rpc callsites in tests/ to connectrpc, matching the amqp/sqs/kafka reference. Proto bumps:

  • api/v4/build/jobs/v1api-go/v6/jobs/v2
  • api/v4/plugins/v1/jobsapi-plugins/v6/jobs

Helpers (tests/helpers/helpers.go)

  • NewJobsClient (h2c factory) replaces per-call goridge dial+codec
  • Single-job Push uses PushRequest{Job:one}
  • Proxy admin (EnableProxy/DisableProxy/DeleteProxy) uses http.NewRequestWithContext for noctx. Extracted shared setProxy.
  • CleanupNats keeps context.Background() (called from t.Cleanup, where t.Context() is already canceled)
  • Behavior improvements inherited: DestroyPipelines last-error reporting, Stats non-empty guard + emptypb.Empty{} request.

Test file (tests/jobs_nats_test.go)

  • declareNATSPipe migrated to helpers.NewJobsClient + client.Declare
  • Drop net, net/rpc, goridgeRpc imports

Dep bumps in tests/go.mod

  • drop direct goridge/v4 (transitive bump beta.1 → beta.2)
  • api-go/v6 beta.4 → beta.12
  • rpc/v6 beta.3 → beta.4
  • add connectrpc.com/connect v1.20.0 + golang.org/x/net

Test plan

  • go build ./... clean
  • go vet ./... clean
  • gofmt -l . clean / goimports clean
  • golangci-lint run ./... — 0 issues
  • CI: go test -race -count=1 ./... against live NATS JetStream + toxiproxy

…o/v6

Migrate all goridge net/rpc + pkg/rpc callsites in tests to
connectrpc, matching the amqp/sqs/kafka reference. Proto bumps:
- api/v4/build/jobs/v1 → api-go/v6/jobs/v2
- api/v4/plugins/v1/jobs → api-plugins/v6/jobs

Helpers (tests/helpers/helpers.go):
- NewJobsClient (h2c factory) replaces per-call goridge dial+codec
- Single-job Push uses PushRequest{Job:one}
- Proxy admin uses http.NewRequestWithContext for noctx
- CleanupNats keeps context.Background() (called from t.Cleanup)
- DestroyPipelines reports last error after 10 failed attempts
- Stats requires non-empty stats slice before indexing
- Stats request fixed to emptypb.Empty (matches server handler)

Test file (tests/jobs_nats_test.go):
- declareNATSPipe migrated to helpers.NewJobsClient + client.Declare
- Drop net, net/rpc, goridgeRpc imports

- drop direct goridge/v4 dep (transitive bump beta.1 → beta.2)
- bump api-go/v6 beta.4 → beta.12
- bump rpc/v6 beta.3 → beta.4
- add connectrpc.com/connect v1.20.0 + golang.org/x/net for http2
Copilot AI review requested due to automatic review settings May 25, 2026 08:53
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Warning

Review limit reached

@rustatian, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 35 minutes and 42 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, 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 trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c90eb8ac-ad94-4c50-b862-89f416670423

📥 Commits

Reviewing files that changed from the base of the PR and between 1f58ff2 and 94d3464.

⛔ Files ignored due to path filters (1)
  • tests/go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • .github/workflows/linux.yml
  • .github/workflows/linux_durability.yml
  • go.mod
  • tests/configs/.rr-nats-otel.yaml
  • tests/go.mod
  • tests/helpers/helpers.go
  • tests/jobs_nats_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/connectrpc-migration

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

Migrates the tests/ suite’s Jobs RPC usage from the legacy goridge net/rpc client to ConnectRPC clients generated from the newer api-go/v6 protos, aligning the NATS tests with the other driver test patterns and removing goridge-specific callsites.

Changes:

  • Replaced goridge net/rpc dial+codec usage with a shared ConnectRPC Jobs client helper (NewJobsClient) and updated callsites accordingly.
  • Updated proto imports from api/v4 to api-go/v6 / api-plugins/v6, including request/response shape changes (e.g., PushRequest, header types, emptypb.Empty).
  • Updated tests/go.mod and tests/go.sum to add ConnectRPC + HTTP/2 support deps and bump relevant RR module versions.

Reviewed changes

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

File Description
tests/jobs_nats_test.go Switches pipeline declaration in NATS tests from goridge net/rpc to ConnectRPC JobsServiceClient.
tests/helpers/helpers.go Introduces an h2c-capable HTTP/2 client factory + ConnectRPC Jobs client helper; migrates helper RPC call wrappers and improves stats/destroy/proxy helpers.
tests/go.mod Adds ConnectRPC + x/net/http2, bumps RR API/RPC deps, removes direct api/v4 requirement.
tests/go.sum Updates module checksums consistent with the dependency changes.

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

rustatian added 6 commits May 25, 2026 11:11
…th GreaterOrEqual

The "job processing was started" log line fires once per job pulled
by the listener (jobs/listener.go:60), not once per worker startup.
The PQ tests previously asserted exact equality with 4 (= 2 pipelines
× 2 workers each), but the listener's poll loop can pull more jobs
in the 3s window before DestroyPipelines than the workers can hold,
so the actual count consistently exceeds 4 (5-9 observed across
runs on master since 2026-05-09).

Pre-existing test bug, unrelated to the Connect-RPC migration; fixing
here since it blocks CI green-light for these PRs.
… OTEL tests

Two regressions surfaced by the assert.GreaterOrEqual fix unblocking
-failfast past the PQ test:

1. DestroyPipelines previously silently passed when all 10 retries
   failed (legacy behavior); my "behavior improvement" assert.NoError(
   t, lastErr) broke negative tests that intentionally destroy
   non-existent pipelines (e.g. TestKafkaJobsError).
   Reverted to the original silent-after-retry semantics.

2. otel/v6 (≥beta.3) hard-rejects the zipkin exporter at Init
   (plugin.go:89). Existing OTEL test configs still target zipkin
   (exporter: zipkin, endpoint /api/v2/spans), and the test
   verification fetches from the zipkin REST API — switching the
   exporter alone would break verification. Skipped TestSQSOTEL /
   TestNATSOTEL / TestKafkaOTEL / TestBoltDBOTEL pending the
   otel team's decision to restore zipkin or migrate the test
   verification to OTLP+jaeger.

Pre-existing on master; surfaced only because the GreaterOrEqual
fix lets -failfast progress past the PQ test.
otel/v6 (≥beta.3) hard-rejects the zipkin exporter at Init, so the
previous OTEL test was skipped. Migrate to the in-memory tracer
pattern used by http/v6 and grpc/v6:

- inMemoryTracer struct implementing jobs.Tracer (Tracer() returns
  an sdktrace.TracerProvider backed by tracetest.InMemoryExporter
  with WithSyncer for immediate span availability)
- Register the test tracer in endure instead of otel.Plugin
- Verify spans via tracer.exp.GetSpans() — no zipkin REST API
- Drop "otel:" block from the test config YAML
- Loosen exact-set match to "contains all expected names" since
  some optional spans (e.g. *_stop) may be emitted in flight and
  vary between runs

Removes the zipkin/jaeger docker dependencies for the OTEL test
path and aligns with the rest of the plugin test infra.
@rustatian rustatian self-assigned this May 25, 2026
@rustatian rustatian merged commit 0cbeb11 into master May 25, 2026
9 checks passed
@rustatian rustatian deleted the chore/connectrpc-migration branch May 25, 2026 12:30
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