Skip to content

Migration to Spring Boot 4.0#38

Merged
crazyrokr merged 5 commits into
developfrom
feature/spring-boot-4
Jun 16, 2026
Merged

Migration to Spring Boot 4.0#38
crazyrokr merged 5 commits into
developfrom
feature/spring-boot-4

Conversation

@crazyrokr

Copy link
Copy Markdown
Owner

Summary

This PR executes the migration of the Tickonomics core from Spring Boot 3.5.0 to Spring Boot 4.0.0 (Spring Framework 7.0, Spring Security 7, Jakarta EE 11).
This is a significant framework-level upgrade that introduces native resilience, moves to Jackson 3 as the default JSON library, and updates the test suite for Groovy 5 compatibility.
The migration follows the strategy outlined in ADR-032 and the comprehensive Spring Boot 4 Migration Plan included in this PR.

Key Changes

  1. Framework & Infrastructure
    • BOM Upgrade: Bumped spring-boot-dependencies to 4.0.0.
    • Jakarta EE 11: Baseline shifted to Jakarta EE 11 / Servlet 6.1.
    • OpenTelemetry: Added OpenTelemetryConfig to provide OTel beans that were removed from Spring Boot 4's auto-configuration.
    • Gradle: Updated plugin versions and coordinates to align with SB4 requirements.
  2. Jackson 3 Migration
    • Package Rename: Migrated all com.fasterxml.jackson.databind/core imports to tools.jackson.*.
    • Immutable Mappers: Transitioned from mutable ObjectMapper to the builder-based JsonMapper (specifically in FileOverflowBuffer).
    • Serialization Defaults: Adapted test cases to Jackson 3's new defaults (alphabetical key sorting and ISO-8601 date serialization).
  3. Resilience Refactoring (Hybrid Approach)
    • Native Retry: Replaced Resilience4j @Retry with Spring 7's native @retryable and programmatic RetryTemplate.
    • Semantic Adjustment: Updated maxRetries counts across 10+ clients to reflect the new semantic (retries after the initial attempt).
    • Bulkhead Retention: Kept Resilience4j @bulkhead for ingestion and computation pools to preserve the custom BulkheadPressureMonitor metrics (per ADR-032).
  4. Test Suite Modernization
    • Spock 2.4: Updated to spock-bom:2.4-groovy-5.0 to support Spring Framework 7.
    • Groovy 5: Moved all Groovy tests to the Groovy 5 toolchain.
    • JUnit 5: Updated to the SB4-managed version.
  5. Documentation
    • Added docs/adr/ADR-032-spring-boot-4-migration.md.
    • Added docs/spring-boot-4-migration-plan.md.

Pre-Merge Verification

  • ./gradlew build -x :integration-tests:test passes (Clean build + all unit tests).
  • All 69 Spock specs pass under Groovy 5.
  • All 94 JUnit tests pass.
  • spring-boot-properties-migrator verified at runtime (no property warnings remain).

Technical Notes

  • Breaking Change: Any external clients relying on specific JSON key ordering may see changes due to Jackson 3's alphabetical sorting.
  • Metrics: Retry metrics have shifted from Resilience4j-tagged format to standard Spring Micrometer observation tags. Bulkhead metrics remain unchanged.

- Bump Spring Boot from 3.5.0 to 4.0.0 and Spring Framework to 7.0.
- Update Spock to 2.4-groovy-5.0 for Groovy 5 compatibility.
- Replace Resilience4j retry/circuitbreaker with spring-boot4 starter.
- Add OpenTelemetryConfig for OTel beans removed in Spring Boot 4.
- Include ADR-032 and the comprehensive migration plan.
- Add SpotBugs exclusion for Spock-generated feature methods.
- Update all Jackson core and databind imports to tools.jackson.*.
- Preserve com.fasterxml.jackson.annotation imports for compatibility.
- Replace ObjectMapper with JsonMapper.builder() in FileOverflowBuffer.
- Update AlphaVantageClient to use JsonNode.properties() instead of fields().
- Adjust Spock specs to reflect Jackson 3 type and serialization changes.
- Replace Resilience4j @Retry with Spring native @retryable across clients.
- Adopt programmatic RetryTemplate for FinnhubEquityClient and YahooFinanceClient.
- Adjust retry counts (maxRetries) to match Spring's semantic (retries after initial).
- Enable native resilience via @EnableResilientMethods in TickonomicsApplication.
- Update tests to verify native @retryable and RetryTemplate behavior.
- Add braces to single-line if/else blocks for improved readability.
- Remove unused imports and optimize remaining ones across computation and ingestion.
- Update JUnit and Mockito static imports to be more specific.
- Perform minor structural cleanup in KpiProcessor and RegimeDetector.
@github-actions

Copy link
Copy Markdown

Benchmark Regression Report

Engine: same-runner A/B (base 6e388ca vs head 29f09d0 on a single job), gated by compare_benchmarks.py at >10% mean regression. See ADR-030.

benchmark base mean (us) head mean (us) delta status
test_fama_french_capm 146.215 144.967 -0.85% ok

Runner: base = AMD EPYC 9V74 80-Core Processor; head = AMD EPYC 9V74 80-Core Processor; same runner = True.
Result: NO REGRESSION (0 of 1 benchmark(s) exceeded +10.00% on mean).

@crazyrokr
crazyrokr merged commit bd21f08 into develop Jun 16, 2026
12 checks passed
@crazyrokr
crazyrokr deleted the feature/spring-boot-4 branch June 16, 2026 13:43
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