-
Notifications
You must be signed in to change notification settings - Fork 5
Rebrand Spring Data Code from Redis to Valkey #9
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
Conversation
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
- Updated ValkeyGlideServerCommands to use the new invocation system - Updated ValkeyGlideConnectionServerCommandsIntegrationTests to cover all APIs in all invocation modes Signed-off-by: ikolomi <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
| xmlns:task="http://www.springframework.org/schema/task" | ||
| xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd | ||
| http://www.springframework.org/schema/task https://www.springframework.org/schema/task/spring-task.xsd | ||
| http://www.springframework.org/schema/valkey https://www.springframework.org/schema/valkey/spring-valkey-1.0.xsd"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until we publish the schema to a specific location some tooling, such as IDEs, will complain that this file cannot be downloaded. The tests still run since we have a schema mapping at src/main/resources/META-INF/spring.schemas.
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
| @@ -543,6 +544,7 @@ void testHStrLen() { | |||
| // ==================== Field Expiration Operations ==================== | |||
|
|
|||
| @Test | |||
| @EnabledOnCommand("HEXPIRE") | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This annotation makes sure we don't run hash expiry commands on server versions that don't support them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List of classes that were updated to avoid running tests against a server that does not support that functionality:
ValkeyGlideConnectionHashCommandsIntegrationTestsValkeyGlideConnectionFactoryIntegrationTestsValkeyGlideConnectionKeyCommandsIntegrationTestsValkeyGlideConnectionScriptingCommandsIntegrationTests
The guards are either on functionality (e.g., @EnabledOnCommand("HEXPIRE")) or server version (e.g., @EnabledOnValkeyVersion("7.0")).
| @@ -718,7 +722,7 @@ void testHExpireAt() { | |||
| assertThat(expireResults.get(0)).isEqualTo(1); | |||
|
|
|||
| // Test hExpire (seconds) - Test GT by setting a shorter expiry first | |||
| expireResults = connection.hashCommands().hExpireAt(keyBytes, expiredTimestamp, | |||
| expireResults = connection.hashCommands().hExpireAt(keyBytes, shorterTimestamp, | |||
| ExpirationOptions.Condition.GT, field1); | |||
| assertThat(expireResults).hasSize(1); | |||
| assertThat(expireResults.get(0)).isEqualTo(0); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HEXSPIREAT and HPEXSPIREAT GT and LT were failing on Valkey, so updated test to pass, not 100% if this is correct.
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
| - name: Start engine | ||
| run: | | ||
| make start | ||
| make start PROJECT=${{ matrix.engine }} VERSION=${{ matrix.version }} GH_ORG=${{ matrix.engine == 'redis' && 'redis' || 'valkey-io' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the CI always started the default in the Makefile (Redis 7.4.0), so I commented out the installation of the engine and just use the Makefile to start the desired engine. I also update the default in the Makefile to be Valkey 8.1.1.
If this is good we can remove commented out steps and action.yml since we will just be relying on Makefile to install and start engine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we should have have less Makefile and more github CI.
Since I started with switching from jenkis to github workflows, we should continue with this trend.
In the context of this fix - I would remove the work/$(PROJECT)/bin/$(PROJECT)-cli and work/$(PROJECT)/bin/$(PROJECT)-server steps from the Makefile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will merge this PR for now since it fixes the issue where CI was only testing Redis 7.4.0, and look at streamlining the build process later.
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
31dd19d to
cc1b0ad
Compare
| @@ -1587,7 +1589,7 @@ void testPTtlTimeUnitConversionPipeline() { | |||
| // Verify conversion relationships | |||
| if (actualPTtlHours != null && actualPTtlHours > 0) { | |||
| double hoursToMillisecondsRatio = (double) actualPTtlMilliseconds / actualPTtlHours; | |||
| assertThat(hoursToMillisecondsRatio).isBetween(3500000.0, 3700000.0); // ~3600000 ms per hour | |||
| assertThat(hoursToMillisecondsRatio).isBetween(3500000.0, 3800000.0); // ~3600000 ms per hour | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was failing for Redis 7.2.0:
Error: ValkeyGlideConnectionKeyCommandsIntegrationTests.testPTtlTimeUnitConversionPipeline:1592
Expecting actual:
3756521.695652174
to be between:
[3500000.0, 3700000.0]
So I increased the range by 1 second.
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
Signed-off-by: Jeremy Parr-Pearson <[email protected]>
src/main/java/io/valkey/springframework/data/valkey/connection/convert/package-info.java
Show resolved
Hide resolved
src/main/java/io/valkey/springframework/data/valkey/core/StringValkeyTemplate.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check if this new file is required
src/main/java/io/valkey/springframework/data/valkey/core/query/package-info.java
Show resolved
Hide resolved
src/main/java/io/valkey/springframework/data/valkey/support/collections/ValkeySet.java
Show resolved
Hide resolved
ikolomi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending the following:
- Double engine spin - we should use the workflow functionality, not the Makefile
- There are new and deleted files. Theoretically we should have only the renames. Please verify that these additions and deletions are indeed needed.
Summary
This PR rebrands the code for Spring Data Redis to Spring Data Valkey. This does not update the docs (
src/main/antora) or CI files (Jenkinsfile,ci/).This PR closes #12.
Key changes:
RedistoValkey(this includes within Java, Kotlin, resource files (schemas, config, properties, URIs, logging, etc), and project files)org.springframework.data.redistoio.valkey.springframework.data.valkeySpring Data RedistoSpring Data Valkeyorg.springframework.datatoio.valkey.springframework.dataspring-data-redistospring-data-valkeyNotable exceptions:
redis.clients.jedis.*)RedisClusterCommands,RedisClusterConnection, etc) and URI scheme (redis://)redis.call)DATAREDIS)Also updated the build (
Makefile,ci.yml) to install and start the correct version of Redis/Valkey to test, and added guards toValkeyGlideConnectionHashCommandsIntegrationTestsand other tests so hash expiry tests are only run when supported by the server (plus updated logic of HEXPIREAT and HPEXPIREAT GT and LT tests).Testing
Also ran the tests locally against Valkey 9.0.0-rc2 and they all passed:
Next Steps
Need to apply the same rebranding to the docs, or at least whatever docs will be kept (at a minimum the README and other root-level docs need to be updated). Since rebranding is a breaking change, a migration guide and examples will also be needed to document the migration steps to move from Spring Data Redis to Spring Data Valkey.
Minor issues to address:
pom.xmlonce final repo is knownJenkinsfile,ci/) once we confirm only GitHub actions will be used for CI