Skip to content

docs: add Valkey compatibility notes and CI coverage for redis-backed plugins - #13760

Open
daric93 wants to merge 4 commits into
apache:masterfrom
daric93:feat/valkey-compat-docs-ci
Open

docs: add Valkey compatibility notes and CI coverage for redis-backed plugins#13760
daric93 wants to merge 4 commits into
apache:masterfrom
daric93:feat/valkey-compat-docs-ci

Conversation

@daric93

@daric93 daric93 commented Jul 29, 2026

Copy link
Copy Markdown

Description

Valkey is a Linux Foundation, BSD-licensed fork of Redis that is protocol (RESP) compatible. APISIX's redis-backed plugins (limit-count, limit-req, limit-conn, graphql-limit-count, ai-rate-limiting, ai-cache exact-match layer, and openid-connect session storage) therefore already work against Valkey unmodified — and users already run this in production. Until now the repository had no mention of Valkey in docs, tests, or CI, so there was no official signal that this combination is supported. This PR makes the compatibility official. No plugin code changes — documentation + test infrastructure only.

Docs — added a "Valkey Compatibility" note to each redis-backed plugin doc:

  • limit-count, limit-req, limit-conn, graphql-limit-count, ai-rate-limiting: point the existing redis_host / redis_port / redis_password attributes at a Valkey deployment.
  • ai-cache: Valkey works as a drop-in for the exact (L1) layer; the note calls out that the semantic (L2) layer requires the RediSearch module (Redis Stack), which Valkey does not provide, so Valkey should be used only when layers is ["exact"].
  • openid-connect: the note references the session.redis.* attributes this Plugin actually uses (not the flat redis_* fields used by the limit plugins).

Each note includes a JSON connection example.

CI — turns "should work because RESP-compatible" into "verified in CI":

  • Added an apisix_valkey service (valkey/valkey:8) on host port 6381 to ci/pod/docker-compose.common.yml, placed next to the existing apisix_redis service.
  • Added t/plugin/limit-count-valkey.t, mirroring the non-auth subset of t/plugin/limit-count-redis.t against the Valkey service. Auth/ACL/TLS tests are intentionally omitted since the Valkey service is configured without a password (kept minimal). The file lands in the existing t/plugin/[l-z]*.t matrix group, so no new CI matrix group is needed.
  • Added port 6381 to the test_redis helper's default flush list so counters don't survive CI re-runs.

Which issue(s) this PR fixes:

Closes #13738

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (docs + test infrastructure only; no plugin code changed)

daric93 added 4 commits July 23, 2026 13:09
… plugins

Valkey is RESP-compatible, so the redis-backed plugins (limit-count,
limit-req, limit-conn, graphql-limit-count, ai-rate-limiting, ai-cache,
and openid-connect session storage) already work against it unmodified.
This makes the compatibility official:

- Add a "Valkey Compatibility" note to each redis-backed plugin doc.
  The ai-cache note calls out that the semantic (L2) layer needs the
  RediSearch module, which Valkey does not provide. The openid-connect
  note references the session.redis.* attributes it actually uses.
- Add an apisix_valkey service (valkey/valkey:8) on port 6381 to
  ci/pod/docker-compose.common.yml.
- Add t/plugin/limit-count-valkey.t, mirroring the non-auth subset of
  limit-count-redis.t against the Valkey service.
- Flush port 6381 in the test_redis helper's default port list.

Ref apache#13738
Each Valkey Compatibility note now includes a JSON connection example.
The flat-schema plugins (limit-count, limit-req, limit-conn,
graphql-limit-count, ai-rate-limiting) show the redis_* fields; ai-cache
shows an L1-only ("exact") example; openid-connect shows the nested
session.redis.* form it actually uses.

Ref apache#13738
Place apisix_valkey directly after apisix_redis so the two data-store
services sit together. Add a comment noting the Valkey service omits the
TLS/ACL command and cert volume that apisix_redis carries, because the
Valkey tests only exercise the plaintext, non-auth path.
- Check return values of SCRIPT FLUSH / FLUSHALL in TEST 9 so TEST 10's
  NOSCRIPT-fallback assertion can't pass vacuously on a failed flush
- Rename TEST 6 to reflect it only proves rate limiting with the flag set,
  not degradation behavior (unreachable Valkey is never exercised)
- Document why no_shuffle() is required (order-dependent tests)
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. doc Documentation things labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Documentation things size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: As a user, I want official documentation and CI coverage for using Valkey with the redis-backed plugins, so that I can rely on it with confidence

1 participant