Skip to content

Migrate from Google Guice to Spring Framework for dependency injection#1825

Draft
velo wants to merge 9 commits intomainfrom
migrate-guice-to-spring
Draft

Migrate from Google Guice to Spring Framework for dependency injection#1825
velo wants to merge 9 commits intomainfrom
migrate-guice-to-spring

Conversation

@velo
Copy link
Collaborator

@velo velo commented Jan 27, 2026

Summary

  • Replaces Google Guice 7.0.0 with Spring Framework 6.2.3 for dependency injection
  • Updates all @Inject annotations to use jakarta.inject package (JSR-330)
  • Converts Guice modules to Spring @Configuration classes with @Bean methods
  • Updates entry points to use Spring's ApplicationContext instead of Guice Injector

Changes

POM Updates

  • Root POM: Added spring-framework.version and jakarta.inject.version properties, removed Guice properties
  • sqrl-planner: Replaced Guice dependencies with spring-context and jakarta.inject-api
  • sqrl-cli: Added createDependencyReducedPom=false to shade plugin to preserve transitive dependencies

Code Changes

  • SqrlInjector: Converted from Guice AbstractModule to Spring @Configuration
  • MockSqrlInjector: Same conversion for tests
  • AbstractCompileCmd: Changed from Guice.createInjector() to AnnotationConfigApplicationContext
  • BaseCmd: Changed exception handling from ProvisionException to BeanCreationException
  • ExecutionEnginesHolder: Uses AutowireCapableBeanFactory for dynamic engine instantiation
  • ~35 files: Updated imports from com.google.inject.* to jakarta.inject.*

Test plan

  • Unit tests pass (sqrl-planner: 183 tests, sqrl-cli: 82 tests)
  • Major integration tests pass (DAGPlannerTest, DAGWriterJsonTest, PredicatePushdownTest)
  • Full integration test suite (some tests have pre-existing file permission issues)

🤖 Generated with Claude Code

Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
@velo velo marked this pull request as draft January 27, 2026 14:32
velo added 8 commits January 27, 2026 13:08
…ad of explicit @bean definitions

Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
…ping

Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

❌ Patch coverage is 0% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.20%. Comparing base (368d861) to head (53b9074).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...main/java/com/datasqrl/cli/AbstractCompileCmd.java 0.00% 12 Missing ⚠️
...rl-cli/src/main/java/com/datasqrl/cli/BaseCmd.java 0.00% 6 Missing ⚠️
.../src/main/java/com/datasqrl/util/SqrlInjector.java 0.00% 6 Missing ⚠️
...va/com/datasqrl/config/ExecutionEnginesHolder.java 0.00% 2 Missing ⚠️
...main/java/com/datasqrl/config/PipelineFactory.java 0.00% 2 Missing ⚠️
...n/java/com/datasqrl/config/SqrlConfigPipeline.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1825      +/-   ##
============================================
+ Coverage     13.19%   13.20%   +0.01%     
  Complexity      734      734              
============================================
  Files           545      545              
  Lines         15982    15967      -15     
  Branches       1874     1875       +1     
============================================
  Hits           2109     2109              
+ Misses        13681    13666      -15     
  Partials        192      192              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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