]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Minor] Migrate lua_redis.lua to lua_shape with mixin tracking
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 17 Nov 2025 21:12:29 +0000 (21:12 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 17 Nov 2025 21:12:29 +0000 (21:12 +0000)
commit2913c2fa7bf33dc96deaf2bda2851774eebaf195
treefcc9667fd097cfef16824785cc9c2947c2ac387a
parent0529c7c98456502bfc21d1ee669bb48c4829632a
[Minor] Migrate lua_redis.lua to lua_shape with mixin tracking

Replace tableshape with lua_shape using first-class mixin system
to preserve origin tracking for documentation and better error reporting.

Key changes:
- common_schema: Now a proper T.table() schema (not plain table)
- Schema composition: Uses T.mixin() instead of lutil.table_merge()
- enrich_schema: Returns T.one_of() with 6 named variants, each using
  mixins for redis_common and external fields
- All tables use { open = true } to allow additional fields
- Transform patterns: T.transform(T.number(), tostring) for type conversions
- Union types: T.one_of({...}) for alternatives like string | array

Benefits:
- Mixin origin tracking preserved in field metadata
- Documentation generation can show field sources
- Better error messages with mixin context
- Consistent with lua_shape design philosophy
lualib/lua_redis.lua