Skip to content

Conversation

@mercyblitz
Copy link
Contributor

This pull request introduces several improvements and updates across the codebase, focusing on enhancing metadata handling, improving code clarity, updating documentation, and refining CI workflows. The main highlights include the addition of parameter names to method metadata, conversion of the RawValue record to a class for better extensibility, and comprehensive updates to the project documentation and workflows.

Enhancements to Metadata and Utility Classes:

  • Added parameterNames field to MethodMetadata, updated its constructor, accessors, equals, hashCode, and toString methods, and updated related tests to ensure parameter names are handled and compared correctly. [1] [2] [3] [4] [5] [6]
  • Converted RawValue from a Java record to a class, added equals, hashCode, and getData methods, and updated usages to use getData() instead of the previous accessor. [1] [2] [3]

Documentation and Community:

  • Significantly expanded and updated the README.md with project overview, badges, module descriptions, getting started instructions, contributing guidelines, and links to documentation resources.
  • Added a CODE_OF_CONDUCT.md to establish contributor guidelines and promote a welcoming community.

Workflow and Build Process Updates:

  • Updated GitHub Actions workflows to target new branch patterns (dev-1.x, release-1.x) and to support a wider range of Java and Spring Boot versions for builds and publishing. [1] [2]

Code Consistency and Style:

  • Standardized the toString methods in metadata classes to use shared symbol constants for formatting, improving code consistency. [1] [2] [3] [4]
  • Fixed a minor bug in the equals method of RedisMetadata by correcting the instance check and variable assignment.

Introduce a Contributor Code of Conduct to outline expected behavior and reporting procedures, fostering an open and welcoming community. Adapted from the Contributor Covenant v1.3.0.
Expanded the README to include project purpose, module descriptions, setup instructions, build steps, contribution guidelines, and documentation links. Added badges for build status and documentation hosts to improve project visibility and onboarding.
Introduces RedisCommandReplicatedEventTest to verify the getDomain and getSourceEvent methods of RedisCommandReplicatedEvent.
The redundant Maven Central version badge was removed from the README to reduce clutter and avoid duplication.
Corrected the formatting of the zread badge in the README to ensure proper display and alignment with other badges.
Included a Maven Central badge to display the latest published version of the microsphere-gateway artifact, improving project visibility and providing users with quick access to version information.
Updated build and publish workflows to target Spring Boot 2.x and JDK 8+, and revised Maven profiles accordingly. Refactored RawValue from a record to a class with explicit equals/hashCode, updated usages and tests. Adjusted SpringRedisCommandUtils to return redisConnection for certain interfaces, and made minor dependency and module changes in parent and root POMs.
Replaces the jakarta.servlet-api dependency with javax.servlet-api in the pom.xml. This may improve compatibility with projects expecting the older javax namespace.
Replaced jakarta.servlet imports with javax.servlet equivalents in DynamicRedisConnectionFactoryCleanerListener to improve compatibility with environments using javax.servlet.
Updated RangeSerializer and its RangeModel to use Comparable types for lower and upper bound values instead of Object. This change improves type safety and clarifies the expected types for range bounds.
Replaces the deprecated import of Aggregate from org.springframework.data.redis.connection.zset with the correct import from org.springframework.data.redis.connection.RedisZSetCommands.
Refactored RangeSerializer to relax type constraints and added a method to serialize RangeModel directly. Updated RedisZSetCommandsRangeSerializer to use RangeModel for serialization. Adjusted imports and test assertions to align with recent API changes and removed unnecessary code in tests.
Introduced a new RangeModel class to encapsulate serialization logic for Range and RedisZSetCommands.Range. Updated RangeSerializer and RedisZSetCommandsRangeSerializer to use RangeModel, improving code reuse and maintainability.
The @deprecated annotation was removed from RedisZSetCommandsRangeSerializer. No other functional changes were made; other modifications are formatting-only (removal of trailing newlines).
Corrects the resolution of the Redis key commands interface by using redisConnection.keyCommands() instead of the connection itself. Updates related tests to use assertSameType for more accurate type checking and adjusts expected interface names in assertions.
Added @qualifier annotations to the redisTemplate and stringRedisTemplate fields in AbstractRedisTest to ensure correct bean injection when multiple RedisTemplate beans are present.
Deleted the trailing newline at the end of EnableRedisInterceptorTest.java to maintain consistent file formatting.
Included RedisConfig.class in the @ContextConfiguration classes for RedisInterceptorModuleInitializerTest to ensure proper test context setup.
Updated the KafkaProducerRedisCommandEventListener to use the completable() method on the send operation, ensuring the returned CompletableFuture is properly handled for asynchronous processing.
Eliminated calls to setObservationEnabled and afterSingletonsInstantiated on redisReplicatorKafkaTemplate in KafkaProducerRedisReplicatorConfiguration, as they are no longer needed.
Deleted static @bean methods for RedisTemplate, StringRedisTemplate, and RedisConnectionFactory from AbstractRedisReplicatorTest as they are no longer needed in the test setup.
Imported and included DefaultRedisConfig in the @ContextConfiguration classes for KafkaRedisReplicatorModuleInitializerIntegrationTest to ensure proper Redis configuration during integration testing.
Imported DefaultRedisConfig and included it in the @ContextConfiguration classes for RedisCommandReplicatorIntegrationTest to ensure proper Redis configuration during integration testing.
The assertion checking that commandMethodIds is empty has been commented out in SpringRedisMetadataLoaderTest. This may be to temporarily disable a failing or unnecessary test check.
Replaces assertNotEquals with assertFalse for hashCode comparison in ParameterMetadataTest to improve test clarity.
Updated testHashCode in ParameterTest to use assertFalse with equality checks instead of assertNotEquals for hash code comparisons. This change improves clarity and consistency in the test assertions.
Replaces direct references to RedisStreamCommands and ReactiveStreamCommands with dynamic class loading to avoid test failures when these interfaces are absent. This improves compatibility with different Spring Data Redis versions.
Introduces package-info.java to document that classes in this package are forked from Spring Data Redis 2.7.18 for compatibility with lower versions.
Changed the case for REDIS_STREAM_COMMANDS_INTERFACE_NAME to return the redisConnection itself instead of calling streamCommands(). Also added @SInCE tags to interface name constants for better documentation.
Deleted the package-info.java file from org.springframework.data.redis. This file contained licensing and package documentation, and its removal may indicate a cleanup or restructuring of package-level documentation.
Deleted the Weights.java class from org.springframework.data.redis.connection.zset. This may be part of a refactor or cleanup to remove unused or relocated code.
Deleted the pom.xml for the microsphere-redis-spring-compatible module, indicating removal or deprecation of this module from the project.
Downgraded the metadata version from 3.5.6 to 2.7.18 and updated method definitions to match the 2.7.18 API. This includes removing methods not present in 2.7.18, renaming or changing method parameters, and aligning command mappings with the older version.
Uncommented the assertion to ensure that all Redis command method IDs are configured. This change enforces the test to fail if there are any unconfigured command method IDs.
Eliminated the initRedisConnectionInterfaces and related methods from SpringRedisMetadataRepository as they are no longer used. Corresponding test code for these methods was also removed to clean up the codebase.
Changed the Maven badge in README.md to reference microsphere-redis instead of microsphere-gateway for accuracy.
Introduced junit.version property and added JUnit BOM to dependencyManagement for consistent JUnit version management across modules.
Updated the hashCode test in ParameterMetadataTest to use assertNotEquals instead of assertFalse for improved clarity and correctness.
Updated ParameterTest to use assertNotEquals instead of assertFalse for hashCode comparisons, improving clarity and intent of the assertions.
Moved closing brace to a new line in the @SpringBootTest 'classes' array for improved readability and consistency.
Deleted the trailing newline at the end of DoubleSerializer.java to conform to file formatting standards.
Replaced fully qualified class names with simple class names in Javadoc references for improved readability in RangeModel.
Deleted an unnecessary blank line at the end of the pom.xml file to maintain consistent formatting.
Added explicit parameterNames fields to all method entries in spring-data-redis-metadata.yaml for improved clarity and introspection of Redis command interfaces.
Introduced a new field 'parameterNames' with corresponding getter and setter in MethodMetadata. Updated equals, toString, and related logic to include parameterNames for more detailed method metadata representation.
Updated the toString method in Parameter to use symbol constants for comma and square brackets from SymbolConstants, improving consistency and maintainability.
Updated ParameterMetadata.toString() to use COMMA, LEFT_SQUARE_BRACKET, and RIGHT_SQUARE_BRACKET from SymbolConstants for improved consistency and maintainability.
Extended MethodMetadataTest to include assertions and setup for the parameterNames property, improving test coverage for MethodMetadata's equality and getter/setter methods.
Introduces collection and storage of method parameter names in the generated metadata for Spring Data Redis command methods. Refactors parameter type resolution and updates the metadata map to include both parameter names and types.
Updated getParameterMetadataList to use parameter names from MethodMetadata when available, falling back to buildParameterMetadataList if not. Removed unused Parameter import and related code for improved clarity.
Introduced a unit test to verify that getParameterMetadataList returns the expected parameter metadata for Redis command methods, matching the output of buildParameterMetadataList.
Updated the test to use the parameter name from metadata if the reflection-based name is not present. This ensures compatibility with environments where parameter names are not retained at runtime.
Changed the project name from 'Microsphere Spring' to 'Microsphere Redis' in the license section to accurately reflect the repository.
@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Dec 26, 2025

Codecov Report

❌ Patch coverage is 96.36364% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...cer/KafkaProducerRedisReplicatorConfiguration.java 62.50% 1 Missing and 2 partials ⚠️
...crosphere/redis/spring/serializer/Serializers.java 91.30% 0 Missing and 2 partials ⚠️
...mer/KafkaConsumerRedisReplicatorConfiguration.java 50.00% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ Complexity Δ
.../io/microsphere/redis/metadata/MethodMetadata.java 100.00% <100.00%> (ø) 27.00 <3.00> (+3.00)
.../java/io/microsphere/redis/metadata/Parameter.java 100.00% <100.00%> (ø) 16.00 <1.00> (ø)
.../microsphere/redis/metadata/ParameterMetadata.java 100.00% <100.00%> (ø) 12.00 <1.00> (ø)
...a/io/microsphere/redis/metadata/RedisMetadata.java 100.00% <100.00%> (ø) 13.00 <4.00> (ø)
.../main/java/io/microsphere/redis/util/RawValue.java 100.00% <100.00%> (ø) 7.00 <6.00> (+5.00)
...in/java/io/microsphere/redis/util/ValueHolder.java 100.00% <100.00%> (ø) 10.00 <0.00> (ø)
...oducer/KafkaProducerRedisCommandEventListener.java 100.00% <100.00%> (ø) 21.00 <0.00> (ø)
...rosphere/redis/spring/beans/WrapperProcessors.java 100.00% <100.00%> (ø) 12.00 <0.00> (ø)
.../DynamicRedisConnectionFactoryCleanerListener.java 100.00% <ø> (ø) 2.00 <0.00> (ø)
...e/redis/spring/interceptor/RedisMethodContext.java 100.00% <ø> (ø) 59.00 <0.00> (ø)
... and 20 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@mercyblitz mercyblitz merged commit 7521367 into release-1.x Dec 26, 2025
57 of 58 checks 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.

2 participants