[WIP/Test Record] Redis single-endpoint cluster support with test-first approach #3
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.
Purpose
This PR serves as a development record for implementing Redis single-endpoint cluster support using a test-first approach. This is NOT intended to be merged into this fork, but rather demonstrates the complete development process before submitting to the upstream Laravel repository.
Background
PR laravel#53940 in laravel/framework only fixed
putMany()for explicit cluster connection types (PhpRedisClusterConnection,PredisClusterConnection), but did not address:many()andflexible()that also perform cross-slot operationsTest-First Development Process
1. Test Infrastructure Setup
2. Write Failing Tests First
Initial test run (before implementation): Tests: 33, Errors: 19, Failures: 1
3. Implement to Make Tests Pass
putMany(),many(), and tagged cache operations4. Verify All Tests Pass
Final test run (after implementation): Tests: 33, Assertions: 108 - All passing ✓
Implementation Details
Server-side cluster detection:
Files Modified:
src/Illuminate/Cache/RedisStore.php- Core cluster detection and fallbacksrc/Illuminate/Cache/RedisTaggedCache.php- Tagged cache flush supportTest Coverage:
tests/Integration/Cache/RedisSingleEndpointClusterTest.php- 33 tests covering all scenarios.github/workflows/redis-cluster.yml- CI workflow for cluster testingCI Results
✅ All tests passing in GitHub Actions:
Next Steps
This implementation is ready to be submitted as a PR to laravel/framework. The test-first approach ensures:
🤖 This PR demonstrates test-first development and is a preparation record for upstream contribution.