Skip to content

release: v6 plugins api#107

Merged
rustatian merged 8 commits intomasterfrom
release/v6
Mar 12, 2026
Merged

release: v6 plugins api#107
rustatian merged 8 commits intomasterfrom
release/v6

Conversation

@rustatian
Copy link
Member

@rustatian rustatian commented Feb 28, 2026

Reason for This PR

  • Stable release cycle.

Description of Changes

  • Use updated dependencies: api-go, and api-plugins

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

    • TTL values now surface as precise timeouts for KV items.
    • Per-call contexts with tracing improve observability of storage operations.
  • Chores

    • Upgrade to v6 APIs and align dependencies/tooling.
    • Migrate RPC payloads and types to the new API surface.
    • CI coverage processing and lint configuration refinements.
  • Tests & Documentation

    • Added package-level docs and updated integration tests for KV behavior.

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

Warning

Rate limit exceeded

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

⌛ 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: 24c4e7ed-a9be-4d55-ba29-5e89bcea24e9

📥 Commits

Reviewing files that changed from the base of the PR and between f57fc97 and 00e5789.

📒 Files selected for processing (1)
  • .github/workflows/linux.yml
📝 Walkthrough

Walkthrough

Moves the kv plugin to v6: updates module manifests, migrates RPC proto types to v2/v6, threads context and OpenTelemetry tracing through storage operations, adds TTL conversion, updates tests, and adds package-level documentation.

Changes

Cohort / File(s) Summary
Module / Manifests
go.mod, tests/go.mod
Bumped module to v6; replaced v4/v5 RoadRunner API deps with v6 variants (api-go/v6, api-plugins/v6), upgraded OpenTelemetry and other indirects, adjusted replace/indirect entries.
Documentation
doc.go, tests/doc.go
Added package-level documentation for the kv plugin and integration-test notes.
Plugin Core
plugin.go
Introduced context propagation (create ctx, pass to checkAndSaveStorage, KvFromConfig, and Stop), changed checkAndSaveStorage signature to accept context.Context, updated plugin API import paths.
RPC Service
rpc.go
Migrated RPC methods to v2/v6 proto types (KvRequest/KvResponse/KvItem), added per-call tracing spans, switched storage calls to accept ctx, unified error handling, and added TTL duration conversion to responses.
Tests
tests/kv_plugin_test.go, tests/pkgs.txt
Updated test imports and proto type names to KvRequest/KvItem/KvResponse, switched to DialContext with timeout, and removed aggregated pkgs line.
CI / Workflow
.github/workflows/linux.yml
Adjusted coverage artifact naming and processing (checkout before download, merged artifact retrieval, awk-based filtering and summary adjustments).
Linters
.golangci.yml
Removed nested test-file linter rules block (dupl, funlen, gocognit, scopelint) affecting test-file-specific lint configuration.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant RPC as "kv RPC\n(server)"
    participant Tracer as "OpenTelemetry\n(span)"
    participant Storage as "Named Backend\n(memory/redis/bolt...)"

    Client->>RPC: KvRequest
    RPC->>Tracer: start span (ctx)
    RPC->>Storage: perform operation(ctx) (Has/Set/MGet/TTL/Delete/...)
    Storage-->>RPC: result (+ optional TTL duration)
    RPC->>Tracer: record error? / end span
    RPC-->>Client: KvResponse (items + ttl)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hopped through modules, tracing the trail,

Context in paw and a TTL tail,
Backends gathered, one gateway in sight,
I nibbled the bugs and padded it right,
Hooray for kv — a carrot-coded night.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'release: v6 plugins api' clearly summarizes the main objective of the PR, which is to release v6 plugins API by updating dependencies and migrating to new API versions.
Description check ✅ Passed The description provides the reason (stable release cycle), describes the changes (updated dependencies), confirms license acceptance, and marks all checklist items as complete.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release/v6
📝 Coding Plan
  • Generate coding plan for human review comments

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

🧹 Nitpick comments (1)
rpc.go (1)

33-44: Extract repeated storage validation/lookup into one helper.

The same storage presence + map lookup logic is duplicated across all handlers; centralizing it will reduce drift and keep error/trace behavior consistent.

Also applies to: 77-88, 106-117, 149-160, 178-189, 225-236, 260-271

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rpc.go` around lines 33 - 44, Extract the repeated "check storage name + map
lookup + error recording" into a helper method (e.g., on the receiver r: func (r
*RPC) resolveStorage(op string, name string, span trace.Span) (storageType,
error)) that takes the operation name, the storage key (or the request), and the
span, performs the in.GetStorage() empty check and r.storages map lookup,
records the same span.RecordError(err) and returns a properly wrapped
errors.E(op, err) on failure or the storage on success; then replace each
duplicated block (the one using in.GetStorage(), errors.Str, errors.Errorf,
span.RecordError, errors.E and r.storages) with a call to this helper (pass op
and span) and handle its returned storage/error consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@go.mod`:
- Around line 8-9: The go.mod currently pins pre-release dependencies
github.com/roadrunner-server/api-go/v5 and
github.com/roadrunner-server/api-plugins/v5 while this module is being released
as a stable v6; do not publish a stable kv/v6 against beta v5 APIs. Fix by
reverting the module to a non-stable release (e.g., keep the module as kv/v5) or
mark this repo as a pre-release (do not publish a v6 tag) until api-go/v5 and
api-plugins/v5 reach v5.0.0 GA; specifically update go.mod and the module path
declaration that corresponds to the kv/v6 release, and ensure the require lines
for github.com/roadrunner-server/api-go/v5 and
github.com/roadrunner-server/api-plugins/v5 are either changed to stable
versions or left behind until those packages publish v5.0.0.

In `@plugin.go`:
- Around line 141-149: The function checkAndSaveStorage currently returns nil
when a requested constructor key (drStr) is missing from p.constructors, causing
silent continuation and later runtime RPC failures; change this to fail fast by
returning a descriptive error when !ok. Locate checkAndSaveStorage and replace
the nil return in the missing-constructor branch with an error value (e.g.,
fmt.Errorf or errors.Errorf) that includes the requested drStr and optionally
the list of registered keys (p.constructors) so callers see why storage
registration failed instead of silently proceeding. Ensure the error is returned
and not logged-only so upstream callers can abort.

---

Nitpick comments:
In `@rpc.go`:
- Around line 33-44: Extract the repeated "check storage name + map lookup +
error recording" into a helper method (e.g., on the receiver r: func (r *RPC)
resolveStorage(op string, name string, span trace.Span) (storageType, error))
that takes the operation name, the storage key (or the request), and the span,
performs the in.GetStorage() empty check and r.storages map lookup, records the
same span.RecordError(err) and returns a properly wrapped errors.E(op, err) on
failure or the storage on success; then replace each duplicated block (the one
using in.GetStorage(), errors.Str, errors.Errorf, span.RecordError, errors.E and
r.storages) with a call to this helper (pass op and span) and handle its
returned storage/error consistently.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d09f2d and 7be179c.

⛔ 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 (7)
  • doc.go
  • go.mod
  • plugin.go
  • rpc.go
  • tests/doc.go
  • tests/go.mod
  • tests/kv_plugin_test.go

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Copilot AI review requested due to automatic review settings March 1, 2026 09:18
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.

🧹 Nitpick comments (1)
plugin.go (1)

106-106: Move context creation outside the loop.

context.Background() is created inside the loop on every iteration, which is unnecessary. Since the same context is used for all storage initializations, create it once before the loop.

♻️ Proposed fix
 	// when user requests, for example, boltdb-south, we should provide that particular pre-configured storage
+	ctx := context.Background()

 	for k, v := range p.cfg.Data {
 		// for example, if the key didn't properly format (yaml)
 		if v == nil {
 			continue
 		}
 		...
 		// at this point we know, that driver field present in the configuration
 		drName := v.(map[string]any)[driver]
-		ctx := context.Background()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugin.go` at line 106, Move the ctx := context.Background() call out of the
per-storage initialization loop: create a single context before the loop that
initializes storages and reuse that same ctx variable inside the loop (remove
the ctx creation from inside the loop). Update the code paths that call storage
initialization (the loop that references ctx in plugin.go) to use the
pre-created ctx so only one Background context is created for all storage
initializations.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@plugin.go`:
- Line 106: Move the ctx := context.Background() call out of the per-storage
initialization loop: create a single context before the loop that initializes
storages and reuse that same ctx variable inside the loop (remove the ctx
creation from inside the loop). Update the code paths that call storage
initialization (the loop that references ctx in plugin.go) to use the
pre-created ctx so only one Background context is created for all storage
initializations.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7be179c and b0865e4.

📒 Files selected for processing (1)
  • plugin.go

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 updates the KV plugin to the v6 plugin/API stack (api-go v5 kv/v2 + api-plugins v5), migrating RPC request/response types and making storage operations context-aware, along with dependency/module version bumps and small documentation additions.

Changes:

  • Bump module path to github.com/roadrunner-server/kv/v6 and update dependencies to api-go/v5 + api-plugins/v5.
  • Migrate KV RPC handlers and tests to the new kv/v2 protobuf types (KvRequest, KvResponse, KvItem) and context-aware storage calls.
  • Add package docs for kv and tests.

Reviewed changes

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

Show a summary per file
File Description
rpc.go Migrates RPC surface to kv/v2 protos, adds ctx-aware storage calls, and introduces TTL conversion logic.
plugin.go Switches to api-plugins v5 and passes context into constructor/storage lifecycle calls.
go.mod Bumps module major version to v6 and updates dependencies to api-go/api-plugins v5.
go.sum Updates dependency checksums for new API modules.
go.work.sum Workspace checksum updates from dependency graph changes.
doc.go Adds package-level documentation for kv.
tests/kv_plugin_test.go Updates integration tests to kv/v2 proto types and kv/v6 module import.
tests/go.mod Updates test module dependencies + replace to kv/v6.
tests/go.sum Updates test module checksums for new API modules.
tests/doc.go Adds package-level documentation for integration tests.

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

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/go.mod (1)

8-18: ⚠️ Potential issue | 🔴 Critical

The integration harness requires v6-major storage drivers, but none are yet released.

plugin.go now uses github.com/roadrunner-server/api-plugins/v6/kv.Constructor, which requires compatible v6-major drivers. However, tests/go.mod still imports boltdb/v5, memcached/v5, memory/v5, redis/v5, and rpc/v5. The v6 KV API contract cannot be satisfied by v5 drivers, leaving p.constructors empty at runtime. This matches the CI failure (no such constructor was registered: boltdb, registered: map[]).

As of now, v6 releases do not exist for any of these storage drivers—only v5.x is published. The test must either wait for boltdb/v6, memcached/v6, memory/v6, and redis/v6 releases, or the KV plugin versioning must be reconsidered to match currently available driver versions.

♻️ Duplicate comments (1)
go.mod (1)

8-9: ⚠️ Potential issue | 🟠 Major

Prerelease API modules still block a GA kv/v6 cut.

PR #107 is preparing a stable v6 release, but Lines 8-9 still pin the core API packages to v6.0.0-beta.1. Cutting kv/v6 as GA while its primary API contracts are still prerelease keeps downstream compatibility unstable.

Are `github.com/roadrunner-server/api-go/v6` and `github.com/roadrunner-server/api-plugins/v6` published as stable `v6.0.0` releases yet, or are the latest available v6 tags still prereleases?
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go.mod` around lines 8 - 9, The go.mod pins to prerelease tags for
github.com/roadrunner-server/api-go/v6 and
github.com/roadrunner-server/api-plugins/v6 which blocks cutting a GA kv/v6;
verify the upstream tags for those two modules and update the two entries in
go.mod to stable v6.0.0 if those v6 tags are published, otherwise revert them to
the latest published stable v5 tags (or add a temporary replace directive to a
specific commit/branch) so the module does not depend on beta releases; ensure
you update the versions for the exact module paths
github.com/roadrunner-server/api-go/v6 and
github.com/roadrunner-server/api-plugins/v6 accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/linux.yml:
- Line 54: The go test invocation missing the coverage package selector causes
tests run under tests/... to not record coverage for the KV module; update the
go test command (the line containing "go test -timeout 20m -v -race -cover
-tags=debug -failfast -coverprofile=./coverage-ci/kv.out -covermode=atomic
./...") to include the flag -coverpkg=github.com/roadrunner-server/kv/v6/... so
the generated coverage includes the KV package (which the downstream AWK filter
that matches "github.com/roadrunner-server/kv/v6/" expects).

In `@rpc.go`:
- Around line 205-210: The code currently treats malformed non-empty TTL strings
as absent by leaving item.Ttl nil; change the logic in rpc.go where you build
kvv2.KvItem so that when ret[k] != "" and time.Parse(time.RFC3339, ret[k])
returns an error you return a failed RPC (e.g., propagate an error using the RPC
error path such as status.Errorf with an appropriate codes.InvalidArgument or
codes.Internal), rather than silently ignoring the parse error; keep the
successful path that sets item.Ttl = durationpb.New(time.Until(t)) when parse
succeeds.

---

Duplicate comments:
In `@go.mod`:
- Around line 8-9: The go.mod pins to prerelease tags for
github.com/roadrunner-server/api-go/v6 and
github.com/roadrunner-server/api-plugins/v6 which blocks cutting a GA kv/v6;
verify the upstream tags for those two modules and update the two entries in
go.mod to stable v6.0.0 if those v6 tags are published, otherwise revert them to
the latest published stable v5 tags (or add a temporary replace directive to a
specific commit/branch) so the module does not depend on beta releases; ensure
you update the versions for the exact module paths
github.com/roadrunner-server/api-go/v6 and
github.com/roadrunner-server/api-plugins/v6 accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a175a90a-a5f4-4642-8be6-35a9a373b527

📥 Commits

Reviewing files that changed from the base of the PR and between b0865e4 and 7a251db.

⛔ 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 (8)
  • .github/workflows/linux.yml
  • .golangci.yml
  • go.mod
  • plugin.go
  • rpc.go
  • tests/go.mod
  • tests/kv_plugin_test.go
  • tests/pkgs.txt
💤 Files with no reviewable changes (2)
  • tests/pkgs.txt
  • .golangci.yml

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
@rustatian rustatian merged commit 13f229e into master Mar 12, 2026
3 of 4 checks passed
@rustatian rustatian deleted the release/v6 branch March 12, 2026 20:46
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