feat(java): add Spring Boot 3 starter module#347
Conversation
📝 WalkthroughWalkthroughThis PR adds a new ChangesTaskito Spring Boot Starter
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant ComponentA
participant ComponentB
ComponentA->>ComponentB: observable interaction
Related PRs: None found. Suggested labels: enhancement, java, spring Suggested reviewers: None found. 🐰 A starter hops into the build, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
sdks/java/spring/src/test/java/org/byteveda/taskito/spring/TaskitoAutoConfigurationTest.java (2)
23-23: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuePrefer
assertNullfor clarity.♻️ Suggested fix
- assertTrue(ctx.getStartupFailure() == null); + assertNull(ctx.getStartupFailure());🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@sdks/java/spring/src/test/java/org/byteveda/taskito/spring/TaskitoAutoConfigurationTest.java` at line 23, The assertion in TaskitoAutoConfigurationTest is using a manual null comparison instead of the clearer assertion helper. Update the startup failure check to use assertNull on ctx.getStartupFailure() so the test intent is explicit and consistent with the other assertions in this class.
14-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMissing test for user-bean override / back-off behavior.
The PR objectives state tests should cover "bean creation from properties and override behavior," and
TaskitoAutoConfigurationrelies on@ConditionalOnMissingBeanto back off when a user defines their ownTaskitobean — but only the property-driven creation path is tested here. Consider adding a test that registers a user-definedTaskitobean via a@Configurationclass and asserts the auto-configured bean does not override it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@sdks/java/spring/src/test/java/org/byteveda/taskito/spring/TaskitoAutoConfigurationTest.java` around lines 14 - 27, Add a second test in TaskitoAutoConfigurationTest to cover back-off behavior for TaskitoAutoConfiguration. Register a user-provided Taskito bean through a nested `@Configuration` (or similar test config) in the ApplicationContextRunner, then assert the context contains that bean and the auto-configured Taskito does not replace it. Use the existing TaskitoAutoConfiguration and Taskito symbols to keep the test aligned with the `@ConditionalOnMissingBean` behavior.sdks/java/spring/build.gradle.kts (1)
9-11: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winHardcoded version duplicates root project version.
version = "0.18.0"is a separate literal from the root project's version. This can silently drift out of sync when the root SDK version is bumped but this module's build file isn't updated in lockstep.♻️ Suggested fix
-group = "org.byteveda" - -version = "0.18.0" +group = "org.byteveda" + +version = rootProject.version🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@sdks/java/spring/build.gradle.kts` around lines 9 - 11, The Spring build script is hardcoding a module version that can drift from the root project version. Update the version assignment in the build logic to derive from the root project’s version instead of a string literal, and keep the existing group setup intact. Use the build script’s version configuration in this module so it stays synchronized with the root version automatically.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@sdks/java/spring/build.gradle.kts`:
- Around line 9-11: The Spring build script is hardcoding a module version that
can drift from the root project version. Update the version assignment in the
build logic to derive from the root project’s version instead of a string
literal, and keep the existing group setup intact. Use the build script’s
version configuration in this module so it stays synchronized with the root
version automatically.
In
`@sdks/java/spring/src/test/java/org/byteveda/taskito/spring/TaskitoAutoConfigurationTest.java`:
- Line 23: The assertion in TaskitoAutoConfigurationTest is using a manual null
comparison instead of the clearer assertion helper. Update the startup failure
check to use assertNull on ctx.getStartupFailure() so the test intent is
explicit and consistent with the other assertions in this class.
- Around line 14-27: Add a second test in TaskitoAutoConfigurationTest to cover
back-off behavior for TaskitoAutoConfiguration. Register a user-provided Taskito
bean through a nested `@Configuration` (or similar test config) in the
ApplicationContextRunner, then assert the context contains that bean and the
auto-configured Taskito does not replace it. Use the existing
TaskitoAutoConfiguration and Taskito symbols to keep the test aligned with the
`@ConditionalOnMissingBean` behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c48c3c13-8164-4cfa-a6c1-69b5e85ba6d1
📒 Files selected for processing (7)
sdks/java/settings.gradle.ktssdks/java/spring/build.gradle.ktssdks/java/spring/src/main/java/org/byteveda/taskito/spring/TaskitoAutoConfiguration.javasdks/java/spring/src/main/java/org/byteveda/taskito/spring/TaskitoProperties.javasdks/java/spring/src/main/java/org/byteveda/taskito/spring/package-info.javasdks/java/spring/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.importssdks/java/spring/src/test/java/org/byteveda/taskito/spring/TaskitoAutoConfigurationTest.java
What
Adds
taskito-spring— a Spring Boot 3 starter (separate Gradle module:spring) that auto-configures aTaskitobean from application properties.TaskitoAutoConfiguration—@AutoConfigurationgated on@ConditionalOnClass(Taskito.class); contributes a singleTaskitobean (@ConditionalOnMissingBean,destroyMethod = "close"so it closes with the context). Define your ownTaskitobean to override.TaskitoProperties—@ConfigurationPropertiesforurl/poolSize/namespace; unset values fall through to builder defaults.META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports.Test
TaskitoAutoConfigurationTest—ApplicationContextRunnerasserts the bean is created from properties and that a user-definedTaskitobean overrides the auto-config../gradlew buildgreen (JDK 17 build leg + 21/25 test legs).Summary by CodeRabbit
New Features
Taskitobean fromtaskito.*settings when included on the classpath.Tests
Taskitobean successfully.