Skip to content

Final Cleanup for v1.0.0 #641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Aug 9, 2025
Merged

Conversation

bsbodden
Copy link
Collaborator

@bsbodden bsbodden commented Aug 9, 2025

No description provided.

bsbodden added 22 commits August 7, 2025 11:15
Migrate from deprecated RedisZSetCommands.Range to org.springframework.data.domain.Range
in all lexicographic query implementations to fix deprecation warnings marked for removal
in Spring Data Redis 3.4.5.
enabled. Also added lombok.config to configure Lombok behavior for the tests module.

- Fixed text-blocks trailing whitespace warning in MetamodelGeneratorTest
- Added AutoService dependency to test annotation processor classpath to
  resolve "Cannot find annotation method" warning
- Updated lombok.config documentation to clarify that @nonnull warnings on
  primitives are intentional for constructor generation in test fixtures
Add missing Javadoc comments for public constructors and methods in lexicographic
query classes. Update Spring Boot Javadoc URL to prevent redirect warning.

- Add Javadoc for constructors and getters in marker classes
- Document constructor parameters in LexicographicIndexer and LexicographicQueryExecutor
- Fix Spring Boot docs URL from /docs/current/api/ to /api/java/
Configure build to skip Javadoc tasks for all demo modules since they are
example applications not part of the published API. This reduces build time
and avoids generating unnecessary documentation for non-library code.

- Add condition in root build.gradle to skip Javadoc for :demos: modules
- Skip both javadoc and javadocJar tasks using onlyIf { false }
- Keep Javadoc enabled for main library modules (redis-om-spring, redis-om-spring-ai)
Upgrade Antora documentation generator and resolve all build warnings for cleaner
documentation builds.

- Update Antora CLI and site generator from 3.1.4 to 3.1.12
- Update Node.js to 20.17.0 LTS and npm to 10.9.2
- Fix deprecated npm package warnings (inflight, glob, gulp-vinyl-zip)
- Replace deprecated {attachmentsdir} with modern Antora 3.x attachment syntax
- Update api-reference.adoc to use xref:attachment$ instead of link:{attachmentsdir}
- Change javadoc-base-url to use relative path instead of deprecated attribute
Replaced deprecated project.buildDir and project.projectDir with
layout.buildDirectory and layout.projectDirectory to avoid execution-time
access. This fixes Gradle 8.x deprecation warnings and ensures compatibility
with future Gradle versions that will enforce configuration cache.
…#639)

Fixes ClassCastException when count() method receives "num_docs" as a String
from Redis FT.INFO command instead of a numeric type. The method now properly
handles both String and Number types by parsing or converting them to long.

- Parse String values using Long.parseLong()
- Convert Number values using longValue()
- Return 0 for null or unexpected types
- Added test case to verify fix in EntityStreamsIssuesTest

Closes redis#639
…icts (redis#637)

Added @ConditionalOnMissingBean to the default redisEnhancedMappingContext bean
configuration, allowing users to provide their own custom mapping context with
a custom keyspace resolver without encountering bean definition override issues.

The fix maintains @primary on the default bean for backward compatibility while
allowing users to override it by providing their own bean with the same name
and @primary annotation.

Example usage:
```java
@bean(name = "redisEnhancedMappingContext")
@primary
public RedisEnhancedMappingContext customMappingContext() {
    RedisEnhancedMappingContext context = new RedisEnhancedMappingContext();
    context.setKeySpaceResolver(type -> "tenant:prefix:" + type.getSimpleName());
    return context;
}
```

- Added @ConditionalOnMissingBean(name = "redisEnhancedMappingContext")
- Maintained @primary for backward compatibility
- Added comprehensive test demonstrating custom keyspace resolver
- Verified backward compatibility with existing tests

Closes redis#637
Enhanced the indexExistsFor method in RediSearchIndexer to handle different
error messages across Redis versions when checking for non-existent indexes.

The method now recognizes multiple error message patterns:
- "Unknown index name" - Redis Stack / Redis 7.x
- "no such index" - Redis 8.0 (reported in issue)
- "index does not exist" - Alternative format
- "not found" - Generic pattern

Also fixed NPE when checking existence for unmapped entity classes by
adding null check for index name.

- Made error detection case-insensitive for robustness
- Added comprehensive test coverage for different error patterns

Closes redis#636

style: apply code formatting
…xception (redis#622)

Both RediSearchQuery and RedisEnhancedQuery were returning entity objects
for existsBy* query methods, causing ClassCastException when the repository
method expected a boolean return type.

Modified executeQuery methods in both query classes to detect when the
return type is boolean/Boolean and return the result of checking if
any documents were found (searchResult.getTotalResults() > 0) instead
of attempting to return the entity object.

Added tests to verify existsBy* methods work correctly for both
@document and @RedisHash entities.
)

Added throwOnSaveAllFailure configuration property to control whether
saveAll operations throw exceptions on failures or just log warnings.

Changes:
- Added redis.om.spring.repository.throw-on-save-all-failure property
  (defaults to false for backward compatibility)
- Modified SimpleRedisEnhancedRepository to use syncAndReturnAll()
  instead of sync() to capture operation responses
- Both repositories now check pipeline responses for JedisDataException
  and either throw RuntimeException or log warnings based on config
- Added tests to verify saveAll error handling works correctly

This allows applications to detect and handle bulk save failures
programmatically when Redis encounters issues like memory limits.
…different types (redis#342)

Added new methods to SearchFieldPredicate interface to allow combining
predicates with different field types, solving the generic type
incompatibility issue when building complex queries.

The existing and() and or() methods require compatible types due to
Java's type system constraints. The new andAny() and orAny() methods
use wildcards to allow combining predicates regardless of their field
types, enabling queries like:
- NAME_SPACE.eq("PERSONAL").andAny(RELATE_ID.eq(100L))
- Add detailed Jedis pool configuration documentation
- Include examples for property-based and Java-based configuration
- Document JedisClientConfigurationBuilderCustomizer approach
- Add pool monitoring examples and common configuration scenarios
- Provide imports for all code examples to improve clarity
…entities (redis#595)

- Document the existing partial update functionality for JSON documents
- Add examples for single entity updates using Query by Example
- Include bulk update operations and ExampleMatcher usage
- Explain how JSON.SET with path specifications enables atomic field updates
- Clarify that this feature is already implemented and tested
- Update early-access workflow to handle Release Candidate (RC) versions
- Change version check from SNAPSHOT-only to include RC versions
- Configure JReleaser to mark RC and SNAPSHOT versions as prereleases
- Fix workflow conditional to use EARLY_ACCESS flag instead of SNAPSHOT
…ployment (redis#625)

- Modified early-access workflow to automatically append -SNAPSHOT to versions
- Skip snapshot releases for already-released versions (with git tags)
- Skip snapshot releases for RC and existing SNAPSHOT versions
- Configure JReleaser to mark SNAPSHOT versions as prereleases
- Enable continuous deployment for every push to main branch

Fixes redis#625
- Add ClassLoaderAwareKeyspaceResolver to handle cross-class-loader entity lookups
- Store keyspace settings by class name for compatibility with RestartClassLoader
- Update SimpleRedisDocumentRepository and RedisJSONKeyValueAdapter to use resolver
- Ensure TTL settings work correctly in @PostConstruct and when devtools is active

The issue occurred because spring-boot-devtools uses a different class loader
(RestartClassLoader) which caused entity classes to not be recognized by the
KeyspaceConfiguration when comparing Class instances directly. This fix stores
and retrieves settings by fully qualified class name as a fallback.

Fixes redis#458
Implement full Map<String, T> field support for Redis JSON documents with:
- Support for all value types: String, Boolean, numeric types, temporal types, UUID, Ulid, enums, and Point
- Automatic indexing using JSONPath expressions ($.fieldName.*)
- Repository query methods using MapContains pattern
- EntityStream support for Map field queries
- Metamodel generation for Map VALUES fields
- Custom Gson serializers for Boolean values (1/0 format)
- Comprehensive test coverage for all Map value types
- Complete documentation with examples and best practices

Note: Boolean values in Map fields are indexed as NUMERIC fields for consistency with Redis JSON serialization
Fix documentation that incorrectly described Redis OM Spring hash mapping as using
Spring Data Redis' basic Set-based indexing. Redis OM Spring actually creates
RediSearch indexes using FT.CREATE commands for Hash entities.

Key corrections:
- Clarify that Redis OM Spring uses RediSearch indexes, not Redis Sets
- Add comparison table showing differences from Spring Data Redis
- Show actual Redis commands (FT.CREATE ON HASH) generated
- Explain O(log N) index-based query performance vs O(N) scans
- Add migration guide from Spring Data Redis
- Update examples to show RediSearch field types (TEXT, TAG, NUMERIC, GEO, VECTOR)
Fix JReleaser configuration to show actual commit authors instead of
incorrectly parsed Java annotations as contributors.

Issues fixed:
- Enable contributor extraction from git history (was disabled)
- Escape Java annotations (@reference, @RedisKey, etc.) in changelog
  to prevent GitHub from treating them as user mentions
- Filter out bot accounts (GitHub Actions) from contributor list
- Add regex replacer to wrap all @annotations in backticks

This ensures releases show real contributors instead of fake users
like "reference" and "RedisKey" that were being parsed from
annotation mentions in the changelog.
Fix ClassCastException when retrieving document count from Redis index info.
Redis can return num_docs as either String or Long depending on version/config.

Applied robust type checking to all occurrences:
- RedisJSONKeyValueAdapter.count()
- RedisEnhancedKeyValueAdapter.count()
- RedisFluentQueryByExample (already fixed in SearchStreamImpl)

The fix handles:
- String values: parse to Long
- Number values: convert to long
- Null/unexpected: return 0L safely

This is more robust than PR redis#640's approach as it:
- Handles multiple Redis return types
- Avoids NullPointerException
- Prevents unnecessary String conversions
- Provides safe fallback for unexpected types
@bsbodden bsbodden self-assigned this Aug 9, 2025
@bsbodden bsbodden merged commit 3dc12d6 into redis:main Aug 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant