Repository navigation
Spring Boot 2.7 → 3.5 (Kotlin 2.2, Gradle 8.14, Hibernate 6, Security 6) - #1574
fellipeale wants to merge 21 commits into
Conversation
Init-script based, so no build.gradle.kts changes are needed. Recipes are untested: the dry run could not be executed in the authoring session. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… run got right The official UpgradeSpringBoot_3_5 composite produced invalid Kotlin and broken build files on Zally. Replace it with an explicit subset and exclude the library modules and buildSrc. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Run CI on pull requests that target boot4/** branches so stacked PRs are checked, and reword decision 6: stages 0-3 merge together and ship Boot 3.5, Boot 4.0 follows. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Every other test uses HSQLDB. Pins the timestamp storage (including the Boot 2.7 quirk that created is written in the JVM time zone), UUID columns, the statistics query and reading rows written by the current build. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Run the app with the production profile against a stub tokeninfo endpoint and pin the access rules as they behave on Boot 2.7, including the unexpected 500 for a missing token. RestCorsWithOAuthTest now runs with OAuth enabled. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
82 requests covering success paths, every error type, YAML negotiation, path suffixes, trailing slashes and the management port, plus tests that pin the error body shape and the actuator exposure. Regenerate with GOLDEN_UPDATE=true. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…age gaps Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Replace the deprecated buildDir getter. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Library modules keep languageVersion/apiVersion 1.8 so that consumers on an older Kotlin compiler can still read the published metadata. Dokka 2 has no dokkaJavadoc task: the javadoc jar now uses dokkaGeneratePublicationJavadoc. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The old ktlint cannot run on Kotlin 2.2. Configure the import-ordering exemption the ktlint 1.x way, and fix the two findings that ktlint cannot auto-fix: constant naming in JsonSchemaValidator and a block comment in ReverseAstBuilder. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Trailing commas, blank lines and similar. No behaviour change. Listed in .git-blame-ignore-revs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Use with: git config blame.ignoreRevsFile .git-blame-ignore-revs (GitHub reads it automatically). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… property renames) Dry run read first. One result corrected by hand: enabled-by-default: true became access.default: read-only, which would restrict every actuator endpoint; the equivalent is unrestricted. The build does not compile yet, the manual steps follow. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- ApiReview.created: native OffsetDateTime stored as UTC (hibernate.jdbc.time_zone=UTC) instead of Jadira. Unlike Boot 2.7 this no longer depends on the JVM time zone; existing rows stay valid because the container ran in UTC. The Postgres test now checks four JVM zones. - ApiReviewRepository: HQL for Hibernate 6 (boolean literal, qualified property names, no aliases). - Drop the Jackson, snakeyaml, Mockito, Flyway and driver pins in the server so Boot manages them. Flyway 11 needs flyway-database-postgresql and flyway-database-hsqldb. - swagger-parser 1.0.76 constraint: 1.0.64 calls SafeConstructor() which snakeyaml 2 removed. - zally-core: an extension method no longer appends an empty pointer segment; Jackson 2.19 keeps the trailing slash that 2.14 dropped. - Remove dead legacy keys from application*.yml. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…er, MVC 6
- OAuthConfiguration/NoSecurityConfiguration as SecurityFilterChain beans with the built-in opaque
token resource server and a TokenInfoOpaqueTokenIntrospector for the tokeninfo endpoint (public
libraries only, replaces stups-spring-oauth2-server).
- ExceptionHandling on ResponseEntityExceptionHandler emits {title,status,detail} as
application/problem+json, replacing problem-spring-web. Unmapped routes keep Boot's error body.
- SchemaController replaces twintip-spring-web (/api and /.well-known/schema-discovery).
- Remove favorPathExtension (decision 3); path matchers simplified to slash-less paths.
- Tests: production security tests adjusted for the announced differences, PathMatchersTest on
PathPatternRequestMatcher, golden master regenerated.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Log unexpected errors in ExceptionHandling (the catch-all swallowed them) and 5xx framework errors. - Tokeninfo: only 400/401/403 mean a bad token. 5xx, timeouts, 404 and 429 are an outage of the endpoint and answer 503 (TokenInfoOutageFilter), not 401 or a bare 500. Tests with a stub that fails in each way. - 401/403 bodies use fixed texts instead of echoing the exception message. - Register the problem handlers once; bind the schema path to twintip.mapping; remove the dead @ResponseStatus; move the Jackson/snakeyaml pins of the library modules out of the zally-server special case. - Comment on the sendError/ERROR-dispatch coupling; tidy ApiReview imports. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2.1.12 calls SafeConstructor() like io.swagger:swagger-parser 1.0.64 did, so every YAML definition logged 'Error snake-parsing yaml content' and only worked through a fallback. New test fails without the constraint. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Manual verification on
|
| Check | Result |
|---|---|
CLI integration tests (cli/zally/test.sh integration, Go 1.22, against the 3.5 server on :8000) |
47 tests pass, 0 failures |
| Docker smoke test (Postgres 13.23) | Flyway V001 to V007 migrate on an empty DB. /health is UP. POST /api-violations returns 200 and the review is read back by /review-statistics. The jar is /zally-server.jar. |
Upgrade: Boot 2.7 (main image) writes 4 reviews, then the 3.5 image starts on the same DB (containers in UTC) |
Flyway validates the 7 existing migrations, no checksum or migration changes. All 4 reviews read back with API JSON identical to the 2.7 responses. /review-statistics identical. api_review rows unchanged (created, external_id, day, definition checksum). |
| Rollback: 3.5 writes a review, then the 2.7 image starts on the same DB | Flyway validates. All 5 reviews return 200. The 4 original reads are identical to the first 2.7 reads. |
production profile from the packaged image, stub tokeninfo server |
No token: 401 + WWW-Authenticate: Bearer. Valid uid token: 200 on /supported-rules, /review-statistics and POST /api-violations. Token without uid: 401. Token rejected by tokeninfo: 401. Tokeninfo returning 500: 503. Valid token on an unknown path: 403. OPTIONS without a token: 200. Management port: /health 200 without a token, /metrics 401 without and 200 with a token. |
🤖 Generated with Claude Code
Client compatibilityThe clients that live in this repo, read from source and run against the 3.5 server:
Neither uses trailing slashes. Findings
|
Lint output comparisonThe 25 fixtures in
The only difference is the order of violations that tie on severity and title: two rules both titled Limits: 26 specs is a small sample, none of them triggered a lint error, and 🤖 Generated with Claude Code |
Dependency vulnerability scan:
|
main (Boot 2.7) |
this PR (Boot 3.5) | |
|---|---|---|
| Distinct CVE/GHSA ids | 149 | 28 |
| Critical findings | 19 | 7 |
| High findings | 66 | 11 |
| Medium findings | 50 | 9 |
| Low findings | 16 | 1 |
- Closed: 126 ids (14 critical, 57 high, 42 medium, 15 low findings). Mostly
tomcat-embed-core(37),spring-webmvc(16),undertow-core(14),logback-core(7),spring-expression(7),spring-web(6). - Introduced: 5 ids (CVE-2026-47890, CVE-2026-54291, CVE-2026-65637, CVE-2026-89407, GHSA-mhm7-754m-9p8w). They are gone again in Spring Boot 3.5 → 4.0 (Jackson 3, Tomcat 11, Hibernate 7, Security 7) #1575.
Caveats: this counts vulnerable library versions in the jar, not whether Zally's code reaches the vulnerable path. It is a snapshot of one day's database. Reproduce with trivy rootfs --scanners vuln <dir containing zally-server.jar> (a plain trivy fs skips JARs).
🤖 Generated with Claude Code
Summary
Four stages, one commit group each (236 files). Review commit by commit; the ktlint reformat is isolated in
a280692aand listed in.git-blame-ignore-revs.Stage 3 replaces libraries that do not exist for Boot 3:
Evidence
After (Boot 3.5.16): 1463 tests, 0 failed, 1 skipped (the old
@Disabledmatcher test went away with thePathMatchersTestrewrite)Also passing:
./gradlew build(spotless, Dokka),cli/zally/test.sh integration, Docker smoke test (Postgres 13,devprofile).GoldenMasterTestpins 90 request/response cases from Boot 2.7. Intended differences:/api-violations/, ...)production)detailwordingdetailwhen fetchingapi_definition_urlfails (status unchanged)401 Unauthorized: "<body>" while retrieving api definition url401 Unauthorized on GET request for "<url>": "<body>" while retrieving api definition urlUse Standard HTTP Status Codesrules); same violations, stable per versionAccept: application/yaml(theapplication/x-yamltype is unchanged)application/yamlApiReview.createdMerge Danger
Door: one-way for API clients, two-way for the code.
The database schema is unchanged and no Flyway migration is added, so rolling the deployment back works. Clients that adapted to the new behaviour would not follow a rollback.
Blast Radius: API consumers
ApiReview.createdis now read as UTC. Existing rows are valid, but this has only been tested against Postgres 13 under four JVM time zones, not against production data.productionprofile was run from the packaged image against a stub tokeninfo server (see the verification comment). The real tokeninfo endpoint is untested.🤖 Generated with Claude Code