Skip to content

Conversation

@mercyblitz
Copy link
Contributor

This pull request introduces several improvements and fixes across the codebase, primarily focusing on enhancing metadata handling for Redis methods, updating documentation and badges, and improving the Maven publish workflow. The most significant changes include the addition of method parameter names to metadata, updates to the generator to support this, and various improvements to string representations and tests.

Enhancements to Redis Method Metadata:

  • Added a new parameterNames field to the MethodMetadata class, along with corresponding getter and setter methods, and updated equals, hashCode, and toString to include this new field. [1] [2] [3]
  • Updated tests in MethodMetadataTest to set and assert the new parameterNames field for improved test coverage. [1] [2] [3]

Generator and Metadata Extraction Improvements:

  • Enhanced the SpringDataRedisMetadataGenerationDoclet to extract and store method parameter names in addition to parameter types, including a new metadata key and logic for resolving parameter names and types. [1] [2] [3]
  • Refactored parameter type resolution to use a new approach and cleaned up related imports. [1] [2] [3] [4]

String Representation Improvements:

  • Modified the toString methods in Parameter and ParameterMetadata to use shared symbol constants for formatting, ensuring consistency across metadata classes. [1] [2] [3] [4]

Documentation and Badge Updates:

  • Fixed the Maven Central badge in README.md to point to the correct artifact and updated the license section to reference "Microsphere Redis" instead of "Microsphere Spring". [1] [2]

Maven Publish Workflow Improvements:

  • Enhanced the Maven publish GitHub Actions workflow by adding Docker Compose setup and teardown steps, and clarified the workflow dispatch input description. [1] [2] [3] [4]

Changed the Maven badge in README.md to reference microsphere-redis instead of microsphere-gateway for accuracy.
Imported DefaultRedisConfig and included it in the @ContextConfiguration classes for KafkaRedisReplicatorModuleInitializerIntegrationTest to ensure proper Redis configuration during integration testing.
Adjusted the order of import statements for better organization and consistency in RedisMethodContext.java.
Moved the import of io.microsphere.redis.metadata.Parameter to group it with other imports for better organization and readability.
Included DefaultRedisConfig in the @ContextConfiguration classes for RedisCommandReplicatorIntegrationTest to ensure proper Redis configuration during integration testing.
Deleted static @bean methods for RedisTemplate, StringRedisTemplate, and RedisConnectionFactory from AbstractRedisReplicatorTest. These definitions are likely unnecessary for the test context or have been moved elsewhere.
Updated the resolvableType method to use ResolvableType.forClass instead of forType for obtaining the generic type. This change improves type resolution for the AbstractSerializer class.
Deleted the trailing newline at the end of BoundarySerializer.java to conform to file formatting standards.
Deleted the trailing newline at the end of ByteArraySerializer.java to conform to file formatting standards.
Deleted the trailing newline at the end of DoubleSerializer.java to conform to file formatting standards.
Deleted the trailing newline at the end of GeoLocationSerializer.java to conform to file formatting standards.
Deleted the trailing newline at the end of IntegerSerializer.java to conform to file formatting standards.
Deleted the trailing newline at the end of LongSerializer.java to conform to file formatting standards.
Deleted the trailing newline at the end of PointSerializer.java to conform to file formatting standards.
Deleted the trailing newline at the end of RangeSerializer.java to conform to file formatting standards.
Deleted the trailing newline at the end of RedisZSetCommandsRangeSerializer.java to conform to file formatting standards.
Deleted an unnecessary blank line at the end of ShortSerializer.java to improve code formatting.
Deleted the trailing newline at the end of WeightsSerializer.java to conform to file formatting standards.
Replaced references to 'delegate' with 'this.delegate' in HoldingValueRedisSerializerWrapper for clarity and consistency.
Introduces the RangeModel class to adapt between RedisZSetCommands.Range and Spring's Range, supporting serialization and deserialization. This utility facilitates interoperability and externalization of range objects.
Simplifies RangeSerializer by delegating Range to RangeModel conversion to static methods. Removes manual extraction and assignment of Range bounds, improving code maintainability and readability.
Replaces the use of range.toRange() with RangeModel.from(range) in RedisZSetCommandsRangeSerializer to improve serialization consistency.
Deleted the trailing newline at the end of EnableRedisInterceptorTest.java to conform to file formatting standards.
Replaced usage of 'integer' with 'index' variable for clarity and consistency in assertions within testInitializeParameters. This improves readability and avoids potential confusion in parameter handling.
Annotated RedisTemplate and StringRedisTemplate fields with @qualifier to ensure correct bean injection in AbstractRedisTest. This improves reliability when multiple beans of the same type exist.
Introduced a new field 'parameterNames' with corresponding getter and setter methods in the MethodMetadata class. Updated equals, toString, and related logic to include parameterNames for more detailed method metadata representation.
Extended MethodMetadataTest to include assertions and setup for the parameterNames property, ensuring correct behavior for 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.
Added explicit parameterNames for all method entries in spring-data-redis-metadata.yaml to improve clarity and support for reflection or code generation. This enhances documentation and tooling around Redis command interfaces.
Updated Parameter and ParameterMetadata toString methods to use symbol constants for formatting. Refactored SpringRedisMetadataRepository to remove Spring's ParameterNameDiscoverer and use method metadata for parameter names, simplifying parameter metadata construction.
Replaces direct call to buildParameterMetadataList with a new getParameterMetadataList method that considers parameter names from MethodMetadata. Updates method to use redisCommandMethod when parameter names are unavailable, improving flexibility and correctness in parameter metadata construction.
Introduced a unit test to verify that getParameterMetadataList returns the expected parameter metadata for Redis command methods by comparing it with buildParameterMetadataList.
Changed the project name from 'Microsphere Spring' to 'Microsphere Redis' in the license section to accurately reflect the repository.
Introduces Docker Compose setup, startup, and teardown steps to the maven-publish GitHub Actions workflow. This allows test services defined in docker/test-services.yml to be started before publishing and stopped after, improving the workflow's environment setup.
Workflow improvements and Docker Compose integration
@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Dec 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

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> (ø)
...e/redis/spring/interceptor/RedisMethodContext.java 100.00% <ø> (ø) 59.00 <0.00> (ø)
...spring/metadata/SpringRedisMetadataRepository.java 99.28% <100.00%> (+0.01%) 48.00 <3.00> (+1.00)
...re/redis/spring/serializer/AbstractSerializer.java 100.00% <100.00%> (ø) 13.00 <1.00> (ø)
...re/redis/spring/serializer/BoundarySerializer.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
...e/redis/spring/serializer/ByteArraySerializer.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
...here/redis/spring/serializer/DoubleSerializer.java 100.00% <ø> (ø) 5.00 <0.00> (ø)
...redis/spring/serializer/GeoLocationSerializer.java 100.00% <ø> (ø) 4.00 <0.00> (ø)
... and 9 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mercyblitz mercyblitz merged commit 60a5454 into main Dec 26, 2025
21 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