Repository navigation
build: move to Java 21 - #161
Conversation
The @ScriptAssert on TesInput needs a JavaScript engine, which Java 15 and later no longer have: on Java 21, every task with inputs failed with 500. An @AssertTrue method checks the same (a url that isn't blank, or content that isn't empty), so the message now names the field inputs[N].urlOrContentGiven. Tests for blank URLs and empty content added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build, test and run on Java 21 (Eclipse Temurin 21 in the image, CI job Test on Java 21), with Spring Boot 2.7 as before: the first step of the move to Spring Boot 3 and later (#66). The new base image has the fixed apt, so the upgrade step goes. The unit tests open java.util and java.lang for system-rules' EnvironmentVariables. Lint stays on Java 8, as google-java-format 1.7 doesn't run on Java 21 and newer versions reformat the code. Docs and upgrade notes updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Say that .env.example is the only committed env file, that all settings are read on the server at runtime, that the image holds no env files and takes no build settings, and how to pass settings to a container. Replace the stale VITE_HOST_URI note and fix the link to the deployment guide. Closes #53 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideAPIReplace JavaScript-based input validation with a Java-compatible check while preserving the API’s source requirements and documenting the resulting validation message change.
ConfigurationMove the build, test job, and container images to Java 21 while retaining Java 8 for linting and removing the obsolete apt upgrade step.
DocumentationExplain the Java 21 development and deployment requirements, the retained Java 8 lint constraint, and upgrade considerations for JVM options and input-validation messages.
TestsAdd unit and API regression coverage for missing, blank, and empty input sources, including JavaScript-compatible whitespace behavior.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #161 +/- ##
==========================================
+ Coverage 75.02% 75.07% +0.05%
==========================================
Files 71 71
Lines 3267 3274 +7
Branches 385 386 +1
==========================================
+ Hits 2451 2458 +7
Misses 663 663
Partials 153 153 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Linked issuesChecked at commit 14fa65f #162 build: move to Java 21 · 5 of 6 met · 1 to check by hand
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/main/java/uk/ac/ebi/tsc/tesk/tes/model/TesInput.java" line_range="203" />
<code_context>
+ @JsonIgnore
+ @AssertTrue(message = "URL or content required")
+ public boolean isUrlOrContentGiven() {
+ return (url != null && !url.isBlank()) || (content != null && !content.isEmpty());
+ }
+
</code_context>
<issue_to_address>
**Whitespace-only URLs pass validation**
When the URL contains only characters such as NBSP or BOM that JavaScript `trim()` removes but `String.isBlank()` does not, and content is null or empty, `isUrlOrContentGiven()` accepts the URL as a source, so validation passes and task creation proceeds with an unusable input instead of returning 400; fetching the input then fails.
Check the URL using whitespace trimming that matches JavaScript `trim()` before treating it as present.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and java 21 may reject JVM options that worked on Java 8, preventing the application from starting and causing an outage; reverting the image restores service, but cannot undo the outage that already occurred.
Blocking findings: src/main/java/uk/ac/ebi/tsc/tesk/tes/model/TesInput.java:203
Match the white space that JavaScript's trim removed (NBSP, BOM, U+2007, U+202F and the other ECMAScript WhiteSpace and LineTerminator characters) when checking an input's URL, so such URLs fail validation as before. Raised by Sourcery on #161. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in #161, #174, #175, #176, #178, #181, #183 and #184. The conflict in docs/upgrading.md is resolved by merging both lists under "To 1.3.0": the upgrade order for filer labels and Java 21 come first, and the TES 1.1 fields item no longer says that ignore_error: true is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lists the changes merged into dev since the notes were written: Java 21 (#161), ignore_error (#174), the resource server (#175), output file logs (#176), the Kubernetes client (#178), Dependabot labels (#181), the executor job selector (#183) and full test coverage (#184). Adds a Breaking changes section, as in the 1.2.0 notes, and sets date-released to the planned tag date, 2026-11-16. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
First step of the move to Spring Boot 3 and later (#66): TESK API builds, tests and runs on Java 21, still on Spring Boot 2.7 (which supports Java 21).
java.version21; Eclipse Temurin 21 JDK and JRE in theDockerfile(pinned by digest); the CI jobTeston Java 21. The new base image (Ubuntu 26.04.1) already has the fixed apt (3.2.1ubuntu0.1), so the upgrade step for CVE-2026-109518 goes.TesInputchecked "URL or content required" with@ScriptAssert(lang = "javascript"). Java 15 and later have no JavaScript engine, so every task with inputs failed with500. An@AssertTruemethod (asTesOutputalready uses) checks the same; the message now names the field (Field 'inputs[0].urlOrContentGiven' URL or content requiredinstead ofField 'inputs[0]' URL or content required, checked on Java 8). Blank URLs are checked withisBlank(Unicode white space, as JavaScript'strimdid). Regression tests for blank URLs and empty content added, plus unit tests of the check. The development docs say that this check is hand-written in the generatedTesInput.java.utilandjava.lang(argLine) for system-rules'EnvironmentVariables, until the tests move to JUnit 5.Lintstays on Java 8 (so code must stay parsable by Java 8 for now, as the docs say): google-java-format 1.7 doesn't run on Java 21, and newer versions reformat about 30 files; that reformat gets its own PR (so it can go into.git-blame-ignore-revs), after the open PRs that change Java code.JAVA_OPTSoptions that Java 21 removed stop the JVM; the changed validation message). Dependabot comments updated (Temurin stays on 21).Closes #162
How it was verified
JAVA_HOME=<JDK 21> ./mvnw clean verify: 18404 unit tests and 99 integration tests pass, coverage checks met. Before the fix: 4 failures (500on task creation) and 34 errors (InaccessibleObjectExceptionfrom system-rules).JAVA_HOME=<JDK 8> ./mvnw spotless:check checkstyle:check: passes.TesInput:Field 'inputs[0]' URL or content required(test passed with that expectation).docker buildand the CI smoke script (Check responsesofci.yml) against the Java 21 image: pass (both profiles, arbitrary UID, read-only root file system, Swagger UI on).mkdocs build --strictand actionlint: pass.Overlaps
docs/upgrading.md("To the next release"): whichever merges second needs a small merge.Declined review findings
@AssertTruemethods for such checks (TesOutput), messages are for people, and the change is in the upgrade notes.--add-opensfor Failsafe too: no integration test needs it; it goes with the move to JUnit 5.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Move TESK API builds, tests, and runtime containers to Java 21 while preserving input validation behavior and compatibility with existing lint tooling.
Bug Fixes:
Enhancements:
Build:
CI:
Documentation:
Tests:
Chores: