chore(deps): bump redis/go-redis/v9 9.21.0 → 9.22.0 (+ mock regen) - #4051
Conversation
go-redis 9.22.0 adds new methods to redis.Cmdable (BLMoveM, LMoveM, ClientTracking*, HImport*, InfoMap, SDiffCard, SUnionCard, TS* time-series, etc.). GoFr's container.Redis interface embeds redis.Cmdable, so MockRedis no longer satisfies it until regenerated. - go.mod/go.sum: redis/go-redis/v9 9.21.0 -> 9.22.0 - pkg/gofr/container/mock_datasources.go: regenerated via 'go generate' (go.uber.org/mock/mockgen). Pure additions (0 deletions) — the new Cmdable methods only. Separated from the minor/patch consolidation (#4048) because it requires this generated-source change. 'go build ./...' green on root + all pkg/ modules; all pkg/ submodules pass 'go mod tidy -diff'. Closes: #3987 Co-Authored-By: claude-flow <ruv@ruv.net>
aryanmehrotra
left a comment
There was a problem hiding this comment.
Approving — splitting this out of #4048 was the right call, and the regeneration is sound. But there
is a behaviour change riding along that isn't in the description and should reach the release notes.
What I verified
The mock is genuinely generated, not hand-edited. I re-ran it myself:
go run go.uber.org/mock/mockgen -source=datasources.go -destination=mock_datasources.go -package=container
and the committed file is byte-identical to the output. The +319/-0 is itself good evidence:
a purely additive regenerated mock proves redis.Cmdable only gained methods and changed none.
Also checked, since a go.work workspace makes version skew easy to miss:
- Root module builds;
pkg/gofr/containerandpkg/gofr/datasource/redistests pass; root
go.mod/go.sumstay tidy. redisotelandrediscmdstay at 9.21.0 against go-redis 9.22.0 — they compile fine, theHook
interface is unchanged.- Standalone submodule builds are unaffected: they require published
gofr.dev v1.57.0rather than
replacing to the local tree, so they keep resolving 9.21.0 until the next release. - The
WaitAOFreturn-type change upstream flags as breaking does not apply to us — it is a
method on the concretecmdablestruct and is not declared in theCmdableinterface we embed.
That is also why the regenerated mock shows zero deletions.
The part that needs recording
The 9.22.0 notes flag a second upgrade concern: "Default configuration values changed (#3918) …
Explicitly configured values are unaffected."
We do not configure them. pkg/gofr/datasource/redis/config.go:62-77 sets only Addr, Username,
Password, DB and optionally TLSConfig, so we inherit every default:
| default | 9.21.0 | 9.22.0 |
|---|---|---|
ReadTimeout |
3s | 5s |
WriteTimeout |
follows ReadTimeout, 3s | follows ReadTimeout, 5s |
MinRetryBackoff |
8ms | 10ms |
DialTimeout |
5s | unchanged |
MaxRetries |
3 | unchanged |
So after this merges, a handler hitting a stalled Redis blocks 5s instead of 3s before erroring —
a 67% increase in worst-case latency on that path. It compiles, it tests green, and it surfaces only
as requests breaching an upstream timeout in production.
There is no escape hatch either: the config surface is REDIS_HOST/PORT/USER/PASSWORD/DB/TLS_*/ PUBSUB_*/STREAMS_*, with no REDIS_READ_TIMEOUT or equivalent, so an application cannot override it.
Nothing here changes the verdict — the bump is right and holding it helps nobody. Two asks:
- Add the timeout change to the release notes for whichever version carries this.
- Worth exposing these as
REDIS_*config in their own change, so the defaults stop being something
we inherit silently on every go-redis bump. Happy to file that separately.
redis/go-redis/v9 9.21.0 → 9.22.0
Split out of the minor/patch consolidation (#4048) because it needs a generated-source change, not just manifests.
Why the mock changes
go-redis9.22.0 adds new methods toredis.Cmdable(BLMoveM,LMoveM,ClientTracking*,HImport*,InfoMap,SDiffCard,SUnionCard, and theTS*time-series calls). GoFr'scontainer.Redisinterface embedsredis.Cmdable, so the generatedMockRedisstops satisfying the interface until regenerated — the build fails with*MockRedis does not implement Redis (missing method BLMoveM)otherwise.Changes
go.mod/go.sum:github.com/redis/go-redis/v99.21.0 → 9.22.0.pkg/gofr/container/mock_datasources.go: regenerated viago generate(go.uber.org/mock/mockgen -source=datasources.go). Diff is pure additions (319 insertions, 0 deletions) — only the newCmdablemethods.Verification
go build ./...green on root + all 26pkg/library modules.pkg/submodules passgo mod tidy -diff(CI tidiness gate).Closes #3987
🤖 Generated with claude-flow