chore: allow @adonisjs/redis v11 in peer dependencies - #103
Open
DavideCarvalho wants to merge 3 commits into
Open
DavideCarvalho wants to merge 3 commits into
DavideCarvalho wants to merge 3 commits into
Conversation
Member
|
Can you check why the tests are failing? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Widens the
@adonisjs/redispeer dependency range to also accept v11:Today apps that have moved to
@adonisjs/redis@11can't install@adonisjs/sessionwithout a package manager override, even though the two work together fine.No source changes. The second commit adds CI coverage so that both ends of the declared range are actually exercised (see CI coverage below).
Why no code change is needed
@adonisjs/redis@11is a major only because it upgradesioredis^5→^6and raisesengines.nodeto>=24. The release notes call out that "packages that consumeioConnectionmust be on the same ioredis major".Session does not consume
ioConnection, and does not import fromioredisat all (neither types nor runtime). The complete redis surface it touches is:src/stores/redis.ts—import type { Connection } from '@adonisjs/redis/types'src/types.ts—import { type RedisConnections } from '@adonisjs/redis/types'src/define_config.ts—/// <reference types="@adonisjs/redis/redis_provider" />andapp.container.make('redis')→.connection(name)…and these methods on the
Connectionwrapper:get,setex,del,expire,sadd,srem,smembers, andpipeline()→pipeline.get()/pipeline.exec().ioredis 5 → 6 impact on those symbols
The two behaviours worth checking are the RESP3 default (v6 negotiates RESP3 unless
protocol: 2is set) and thepipeline.exec()result shape, sinceRedisStore#fetchSessionContentsreadsresult[1].Verified against a real server with
@adonisjs/redis@11.0.0/ioredis@6.0.0, with RESP3 confirmed active (ioConnection.options.protocol === 3):smembersArray(not a JSSet) —["a","b"]getstring/nullpipeline().exec()[[null,"v1"],[null,null]]—[error, result]tuples unchangedexpire/srem/del/saddsetexSo every shape the redis store relies on is unchanged.
The
engines.node: >=24bump in redis v11 is a no-op here:@adonisjs/sessionalready declares"engines": { "node": ">=24.0.0" }, and ioredis 6 itself only requires Node >= 20.CI coverage
A peer range that CI never exercises is just a claim, so
test_linuxnow runs against both majors via a new matrix dimension:matrix: node-version: [latest] db: [sqlite, postgres, mysql] + redis-version: [10, 11]- name: Install run: npm install + - name: Install @adonisjs/redis v${{ matrix.redis-version }} + run: npm install --no-save @adonisjs/redis@${{ matrix.redis-version }}devDependenciesstays at^10.0.0, so the default local/dev experience is unchanged and the lower bound keeps its coverage; the extra leg installs the upper bound with--no-save, so neitherpackage.jsonnorpackage-lock.jsonis touched by the step.^10.0.0resolves to.test_windowsis untouched — it already runs withNO_REDIS: true.This takes
test_linuxfrom 3 to 6 jobs. If you'd rather not double the matrix, I'm happy to collapse it to a single extra leg withinclude(e.g.db: sqlite+redis-version: 11) — just say the word.How it was tested
Both majors were run locally against a real Redis server before pushing:
redis:alpine, percompose.yml),DB_CONNECTION=sqlite,NO_REDISunset so the redis store tests really execute@adonisjs/redis@10.0.2→ 208 passed, 14 skipped (222)@adonisjs/redis@11.0.0(pullingioredis@6.0.0) → 208 passed, 14 skipped (222) — identical; the 14 skips are the DynamoDB specs, which I have no local endpoint for (they run in CI)tests/stores/redis_store.spec.ts→ 19 passed on both, including thetagged/untagtests that exercisesmembers,sremand the pipeline pathtests/concurrent_session.spec.ts→ 9 passed on bothnpm run typecheck→ clean on v11 (i.e. theConnection/RedisConnectionstypes from v11 still satisfy the store)npm run lint→ clean