Thank you for your interest in contributing to Redis OM Spring! We welcome contributions from the community — bug fixes, new features, documentation improvements, and demo additions are all appreciated.
- Getting Started
- Development Setup
- Project Architecture
- Development Workflow
- Testing
- Code Style
- Adding a Demo
- Submitting Changes
- Reporting Issues
Before contributing, please:
- Read the README.md to understand the project
- Check existing issues and pull requests
- For significant changes, open an issue first to discuss your approach
- Java 21 or higher
- Docker (for running Redis locally)
- Gradle wrapper — no global Gradle install needed; use
./gradlew
git clone https://github.com/redis/redis-om-spring.git
cd redis-om-spring
./gradlew buildThe test suite and demos require a Redis Stack instance (includes the Redis Query Engine and RedisJSON):
docker-compose up -dThis starts redis/redis-stack on port 6379. Alternatively, most tests use Testcontainers and will spin up Redis automatically.
The repository is a multi-module Gradle project:
redis-om-spring/ # Core library module
demos/ # Runnable Spring Boot demo applications
roms-documents/
roms-hashes/
roms-vss/
... # See demos/README.md for the full list
Key packages inside redis-om-spring/src/main/java/com/redis/om/spring/:
annotations/—@Document,@Indexed,@Searchable,@Vectorize, etc.repository/—RedisDocumentRepository,RedisEnhancedRepository, and base classesops/— Entity streams and fluent query DSLindexing/— Index creation and management (RediSearch schema generation)vectorize/— Embedding providers (OpenAI, Azure OpenAI, VertexAI, Bedrock, Transformers/DJL, Ollama)metamodel/— Annotation processor that generates$-prefixed metamodel classes
Annotation processing happens at compile time via the redis-om-spring module itself configured as an annotationProcessor dependency.
git checkout -b fix/short-description
# or
git checkout -b feat/short-descriptionEdit source files under redis-om-spring/src/. Run the build:
./gradlew :redis-om-spring:buildApply the project's code style (Spotless + Eclipse formatter) before committing:
./gradlew spotlessApplyTo check without modifying files:
./gradlew spotlessCheck# Full test suite (requires Docker for Testcontainers)
./gradlew :redis-om-spring:test
# Specific test class
./gradlew :redis-om-spring:test --tests "com.redis.om.spring.search.stream.EntityStreamTest"
# Tests with verbose output
./gradlew :redis-om-spring:test --info| Command | Description |
|---|---|
./gradlew :redis-om-spring:build |
Compile and run all checks |
./gradlew :redis-om-spring:test |
Run the test suite |
./gradlew spotlessApply |
Auto-format all source files |
./gradlew spotlessCheck |
Check formatting without modifying |
./gradlew publishToMavenLocal |
Publish a snapshot for local demo testing |
./gradlew :demos:<name>:bootRun |
Run a specific demo |
Most tests use Testcontainers to spin up a redis/redis-stack container automatically. Make sure Docker is running before executing the test suite.
# All tests
./gradlew :redis-om-spring:test
# One test class
./gradlew :redis-om-spring:test --tests "*.VectorSearchTest"New features and bug fixes must include tests. Place test classes under:
redis-om-spring/src/test/java/com/redis/om/spring/
Guidelines:
- Extend
AbstractBaseDocumentTestorAbstractBaseEnhancedRedisTestas appropriate — these set up Testcontainers and application context for you. - Name test methods clearly:
givenX_whenY_thenZor a plain descriptive name. - Test both the happy path and edge cases (empty results, null fields, large payloads).
- If your change affects index creation, include a test that verifies the RediSearch schema.
We aim to keep coverage high. New public APIs should have corresponding tests. You can generate a coverage report with:
./gradlew :redis-om-spring:test jacocoTestReport
# Report at: redis-om-spring/build/reports/jacoco/test/html/index.htmlThis project uses the Spotless Gradle plugin with an Eclipse formatter configuration. Key rules:
- 2-space indentation (not 4)
- KNR brace style — opening braces at the end of the line
- 120-character line length
- Consistent import ordering:
java.*,javax.*,org.*,com.*, then others — no wildcards
Always run ./gradlew spotlessApply before pushing. CI will fail on formatting violations.
Additional style guidelines:
- Use type hints / generics consistently
- Add Javadoc to all public types and methods — at minimum a one-line summary
- Prefer constructor injection over field injection in Spring beans
- Avoid raw types and unchecked casts; suppress with
@SuppressWarningsonly when genuinely necessary and add a comment explaining why
Demos live in the demos/ directory as independent Spring Boot modules.
- Create a new subdirectory:
demos/roms-<your-feature>/ - Add a
build.gradle— copy an existing one (e.g.,roms-documents/build.gradle) as a starting point - Register it in the root
settings.gradle:include ':demos:roms-<your-feature>' - Write a
README.mdinside the demo directory describing:- What the demo demonstrates
- Prerequisites (any env vars, data files)
- How to run it:
./gradlew :demos:roms-<your-feature>:bootRun - Key endpoints or usage examples
- Add the demo to the table in demos/README.md
- Branch is based on
main - All tests pass:
./gradlew :redis-om-spring:test - Code is formatted:
./gradlew spotlessApply - New/changed public APIs have Javadoc
- Tests added for new behavior
-
demos/README.mdupdated if adding a demo
- Use a clear, descriptive title referencing the issue if applicable (e.g.,
fix: correct index creation for nested JSON arrays (#123)) - Describe what changed and why
- Include before/after examples for API changes
Follow the Conventional Commits style:
<type>: <short summary>
[optional body]
Types: feat, fix, docs, refactor, test, chore
Examples:
feat: add support for GEO_SHAPE field type
fix: correct FLAT index parameter for high-dimensional vectors
docs: add Javadoc to VectorQuery builder methods
test: add integration test for hybrid search scoring
Keep the first line under 72 characters. Reference issues with (#123) at the end.
Please include:
- Environment: Java version, Redis OM Spring version, Redis server version, OS
- Minimal reproducible example — the smaller, the better
- Expected vs. actual behavior
- Full stack trace
Describe:
- The use case you're solving
- How you envision the API looking (code example)
- Any alternatives you considered
- Redis OM Spring Documentation
- Redis Query Engine Documentation
- RedisJSON Documentation
- Spring Data Redis
- Testcontainers
- GitHub Issues: redis/redis-om-spring/issues
- GitHub Discussions: redis/redis-om-spring/discussions
- Discord: Redis Discord Server
By contributing to Redis OM Spring you agree that your contributions will be licensed under the MIT License.
Thank you for helping make Redis OM Spring better for everyone!