Skip to content

style: update google-java-format - #201

Merged
uniqueg merged 3 commits into
devfrom
style/163-google-java-format
Nov 17, 2026
Merged

uniqueg merged 3 commits into
devfrom
style/163-google-java-format

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves formatting and linting to current tool versions, so that they run on Java 21 like the build:

  • spotless-maven-plugin 2.30.0 → 3.11.0, google-java-format 1.7 → 2.0.0 (AOSP style, unchanged), maven-checkstyle-plugin 3.3.1 → 3.6.0, Checkstyle 9.3 → 14.4.0 (pom.xml). These are the plugin versions of Dependabot's build(deps): bump the maven group across 1 directory with 4 updates #189; its remaining Maven 3.10.1 wrapper bump is left to Dependabot (a rebase of build(deps): bump the maven group across 1 directory with 4 updates #189 after this merge).
  • The CI job Lint runs on Java 21 instead of Java 8.
  • The Java 8 notes are gone from pom.xml, ci.yml, README.md and docs/development.md (including the advice to write code that Java 8 can parse).
  • ./mvnw spotless:apply: 32 files reformatted, and a stray }; after two methods in TaskmasterEnvProperties.java becomes } (one-line Javadoc expanded, blank lines between documented fields, lambdas on the line of their call, Javadoc rewrapped).
  • The only change that spotless:apply didn't make: @author Ania Niewielska <[email protected]> becomes &lt;[email protected]&gt; in 36 files. Checkstyle 14 parses Javadoc (for UnusedImports) and reports the address as malformed HTML; it then also misses the imports used only in {@link} (2 false "unused import" findings). The rendered Javadoc is unchanged.

After the merge, a follow-up PR adds the squash commit to .git-blame-ignore-revs (as for #109).

Closes #163

Verification

  • ./mvnw spotless:apply on Java 21, then ./mvnw spotless:check checkstyle:check on Java 21: no changes left, 0 Checkstyle violations, BUILD SUCCESS.
  • ./mvnw clean verify in eclipse-temurin:21-jdk: all unit and integration tests pass (142 integration tests), all coverage checks met, BUILD SUCCESS.
  • git diff --word-diff -w of the reformat commit: only line breaks and indentation, plus the escaped author addresses.
  • CI: all checks pass (Lint on Java 21, Test, Smoke test, Scan image, Docs, CodeQL, Codecov; CI passed).

Declined review findings

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Modernize formatting and linting tooling so the project’s code quality checks run consistently on Java 21.

Enhancements:

  • Update Java formatting and linting tools to versions compatible with Java 21 while preserving the existing AOSP formatting style.
  • Reformat the Java sources and correct malformed Javadoc author markup exposed by the newer Checkstyle version.

Build:

  • Remove the remaining Java 8 requirements and document Java 21 as the environment for formatting, linting, building, and testing.

CI:

  • Run the CI lint job on Java 21 instead of Java 8.

Documentation:

  • Update the README and development documentation to reflect Java 21-only development tooling.

uniqueg and others added 3 commits November 17, 2026 01:29
Update spotless-maven-plugin (2.30.0 to 3.11.0), google-java-format
(1.7 to 2.0.0, AOSP style), maven-checkstyle-plugin (3.3.1 to 3.6.0)
and Checkstyle (9.3 to 14.4.0). They run on Java 21, so the CI job
Lint does too, and the Java 8 notes in pom.xml, ci.yml, the README and
docs/development.md are gone.

Refs #163

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only the output of ./mvnw spotless:apply, plus the author e-mail
addresses in Javadoc escaped (&lt; and &gt;): Checkstyle 14 parses
Javadoc and reports <name@host> as malformed HTML.

Refs #163

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #163

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Reformat application code with google-java-format 2.0.0 and escape author email addresses in Javadocs to satisfy Checkstyle 14.

  • src/main/java/uk/ac/ebi/tsc/tesk/TeskApplication.java L10
  • src/main/java/uk/ac/ebi/tsc/tesk/config/CustomErrorHandler.java L44
  • src/main/java/uk/ac/ebi/tsc/tesk/config/GsonConfig.java L8-10
  • src/main/java/uk/ac/ebi/tsc/tesk/config/TraceInterceptorConfiguration.java L18
  • src/main/java/uk/ac/ebi/tsc/tesk/config/security/AuthorisationProperties.java L31-34, L63-66, L105-123 (+3 small edits)
  • src/main/java/uk/ac/ebi/tsc/tesk/config/security/CustomAuthenticationEntryPoint.java L38
  • src/main/java/uk/ac/ebi/tsc/tesk/config/security/ElixirPrincipalExtractor.java L18, L26-29, L130-152
  • src/main/java/uk/ac/ebi/tsc/tesk/config/security/GroupNamesSecurityExtractor.java L16
  • src/main/java/uk/ac/ebi/tsc/tesk/config/security/NoAuthConfiguration.java L14
  • src/main/java/uk/ac/ebi/tsc/tesk/config/security/ResourceServerConfiguration.java L33, L100-118, L123-125
  • src/main/java/uk/ac/ebi/tsc/tesk/config/security/ServiceClientTokenServices.java L143-144, L343
  • src/main/java/uk/ac/ebi/tsc/tesk/config/security/User.java L23, L35-38
  • src/main/java/uk/ac/ebi/tsc/tesk/config/swagger/ApiDocsConfiguration.java L35-38
  • src/main/java/uk/ac/ebi/tsc/tesk/config/swagger/OAuth2ClientProperties.java L18, L31, L40
  • src/main/java/uk/ac/ebi/tsc/tesk/config/swagger/SwaggerConfigAuth.java L20
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/config/KubernetesClientConfig.java L14-16
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/constant/Constants.java L10, L30-36, L143
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/constant/K8sConstants.java L6, L43-46
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/JobNameGenerator.java L11-13
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/KubernetesObjectsSupplier.java L29, L164-183
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/TaskStateResolver.java L132-135 (+3 small edits)
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/TaskmasterEnvProperties.java L12-133 (6 small edits)
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverter.java L137-144, L301-317 (+3 small edits)
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/data/Job.java L12
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/data/SingleTaskStrategy.java L20
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/data/Task.java L16, L21, L27
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/data/TaskBuilder.java L23
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/convert/data/TaskListStrategy.java L24
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/exception/KubernetesException.java L10
  • src/main/java/uk/ac/ebi/tsc/tesk/k8s/service/KubernetesClientWrapper.java L36-38, L286-288
  • src/main/java/uk/ac/ebi/tsc/tesk/tes/exception/CancelNotRunningTask.java L9
  • src/main/java/uk/ac/ebi/tsc/tesk/tes/exception/TaskNotFoundException.java L9
  • src/main/java/uk/ac/ebi/tsc/tesk/tes/model/TaskView.java L7
  • src/main/java/uk/ac/ebi/tsc/tesk/tes/service/TesService.java L16
  • src/main/java/uk/ac/ebi/tsc/tesk/tes/service/TesServiceImpl.java L327-330, L416-421 (+3 small edits)

Reformat integration-test source and escape the author email addresses in its Javadocs.

  • src/integration-test/java/uk/ac/ebi/tsc/tesk/AuthIT.java L37
  • src/integration-test/java/uk/ac/ebi/tsc/tesk/NoAuthIT.java L48

Configuration

Upgrade the formatter and Checkstyle toolchain and run the CI lint job on Java 21.

  • .github/workflows/ci.yml L94 (removed lines), L100
  • pom.xml L391-395 (+3 small edits)

Documentation

Remove the Java 8 formatter caveat and document that formatting and linting need Java 21.

  • README.md L62-63
  • docs/development.md L120

Tests

Reformat test code with google-java-format 2.0.0 and escape author email addresses in test Javadocs.

  • src/test/java/uk/ac/ebi/tsc/tesk/UrlConstants.java L14-20
  • src/test/java/uk/ac/ebi/tsc/tesk/config/security/CorsConfigTest.java L165-173, L180-183, L197-204
  • src/test/java/uk/ac/ebi/tsc/tesk/config/security/ServiceClientTokenServicesTest.java L762-765
  • src/test/java/uk/ac/ebi/tsc/tesk/config/swagger/SwaggerConfigAuthTest.java L30-32
  • src/test/java/uk/ac/ebi/tsc/tesk/k8s/convert/TaskStateResolverTest.java L79, L84, L316-325
  • src/test/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverterMinimalTest.java L71-73, L751-754
  • src/test/java/uk/ac/ebi/tsc/tesk/k8s/convert/TesKubernetesConverterTest.java L59-61, L746-749
  • src/test/java/uk/ac/ebi/tsc/tesk/tes/api/TasksApiControllerTest.java L92-96, L200-201
  • src/test/java/uk/ac/ebi/tsc/tesk/tes/service/TaskFilterTest.java L145-147, L155-157
  • src/test/java/uk/ac/ebi/tsc/tesk/tes/service/TesServiceImplCancelTest.java L80-89, L422-425
  • src/test/java/uk/ac/ebi/tsc/tesk/tes/service/TesServiceImplCreateTest.java L75-92, L163-171, L252-256 (+2 small edits)
  • src/test/java/uk/ac/ebi/tsc/tesk/tes/service/TesServiceImplSystemLogsTest.java L138-143

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9d73a31) to head (26b7a7c).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #201   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           54        54           
  Lines         2351      2342    -9     
  Branches       275       274    -1     
=========================================
- Hits          2351      2342    -9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 17, 2026 00:56
@sourcery-ai

sourcery-ai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit 26b7a7c

#163 style: update google-java-format · 2 of 4 met · 1 to check by hand

# Requirement Status Notes
1 Update the formatter and lint tools, and reformat the Java code without unrelated code changes. ✅ Met The Maven plugin, formatter, and Checkstyle versions are updated, and the Java changes are formatting-only apart from the documented Javadoc escaping.
2 Run the Lint job on Java 21 and remove the Java 8 notes. ✅ Met CI sets up Java 21 for Lint, and the Java 8 notes are removed from the listed files.
3 Merge when #159 and #160 no longer change Java code, or update them right after. 👀 Check by hand (external system) Check the status of #159 and #160 at merge time and confirm the stated condition is followed.
4 Add the squash commit to .git-blame-ignore-revs after merge. ❌ Not addressed The PR description defers this to a follow-up after merge; the current .git-blame-ignore-revs contains only the entry for #109.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@uniqueg
uniqueg merged commit debc4b5 into dev Nov 17, 2026
43 checks passed
@uniqueg
uniqueg deleted the style/163-google-java-format branch November 17, 2026 01:01
uniqueg added a commit that referenced this pull request Nov 17, 2026
uniqueg added a commit that referenced this pull request Nov 18, 2026
Bring in #201 (google-java-format update), #202 and #206 (removal of
the /v2/api-docs alias).

Conflicts:
- docs/upgrading.md: both PRs add items to "To 2.1.0"; the removal of
  /v2/api-docs goes first in the list of changes for all deployments.
- KubernetesClientWrapper: #201 only reformatted the creator filter
  that this branch moved into listAllTaskmasterJobsForUser; kept the
  moved version.

Files of this branch reformatted with spotless:apply for #201.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

style: update google-java-format

1 participant