Skip to content

[3.3] Support spotless on jdk8, correct palantirJavaFormat version on jdk11, update palantirJavaFormat version on jdk21 #15388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.3
Choose a base branch
from

Conversation

zrlw
Copy link
Contributor

@zrlw zrlw commented May 15, 2025

What is the purpose of the change?

  1. for the convenience of fixing major formatting issues by running mvn spotless:apply on jdk8 with palantirJavaFormat 1.1.0
  2. correct palantirJavaFormat version to 2.28.0 on jdk11
  3. update palantirJavaFormat version to 2.57.0 on jdk21

refer to JVM_SUPPORT in PalantirJavaFormatStep.java at https://github.com/diffplug/spotless

private static final Jvm.Support<String> JVM_SUPPORT = Jvm.<String> support(NAME).add(8, "1.1.0").add(11, "2.28.0").add(21, "2.57.0");

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

@codecov-commenter
Copy link

codecov-commenter commented May 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.91%. Comparing base (d6b11cf) to head (6bd2dc1).
Report is 28 commits behind head on 3.3.

Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #15388      +/-   ##
============================================
+ Coverage     60.73%   60.91%   +0.18%     
- Complexity    10920    11440     +520     
============================================
  Files          1886     1889       +3     
  Lines         86162    86310     +148     
  Branches      12913    12935      +22     
============================================
+ Hits          52328    52577     +249     
+ Misses        28374    28288      -86     
+ Partials       5460     5445      -15     
Flag Coverage Δ
integration-tests ?
integration-tests-java17 33.11% <ø> (?)
integration-tests-java8 33.14% <ø> (?)
samples-tests ?
samples-tests-java17 31.46% <ø> (?)
samples-tests-java8 29.38% <ø> (?)
unit-tests 58.84% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@oxsean
Copy link
Contributor

oxsean commented May 15, 2025

I’m concerned whether the formatting output of different versions of Spotless is exactly the same. Since this is an ancient version, perhaps it’s sufficient to just maintain runtime support.

@zrlw
Copy link
Contributor Author

zrlw commented May 16, 2025

Actually, this PR is just for the convenience of contributors to fix major formatting errors.
The result of the repair depends on the contributor‘s JDK version, It's difficult to achieve completely consistent results due to different palantirJavaFormat.version.

   <profile>
      <id>jdk11-jdk21-spotless</id>
      <activation>
        <jdk>[11, 21)</jdk>
      </activation>
      <properties>
        <palantirJavaFormat.version>2.28.0</palantirJavaFormat.version>
      </properties>
    </profile>

    <profile>
      <id>jdk21-spotless</id>
      <activation>
        <jdk>[21,)</jdk>
      </activation>
      <properties>
        <palantirJavaFormat.version>2.39.0</palantirJavaFormat.version>
      </properties>
    </profile>

@zrlw
Copy link
Contributor Author

zrlw commented May 17, 2025

Unless spotless:apply is performed on github PR action, it is difficult to ensure that the spotless:apply results from contributors are consistent with GitHub spotless:check action.
#15391 but it seemed that we could not grant GITHUB_TOKEN write permission on all apache repos.

@zrlw zrlw force-pushed the 3.3-Feature-supportSpotlessWithJdk8 branch from c39ee66 to d64131c Compare June 7, 2025 11:35
@zrlw zrlw force-pushed the 3.3-Feature-supportSpotlessWithJdk8 branch from d64131c to 6bd2dc1 Compare June 7, 2025 12:35
@zrlw zrlw changed the title [3.3] add support for running sportless with jdk8,9,10,11 [3.3] Support spotless on jdk8, correct palantirJavaFormat version on jdk11, update palantirJavaFormat version on jdk21 Jun 7, 2025
@zrlw zrlw added the type/discussion Everything related with code discussion or question label Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/discussion Everything related with code discussion or question
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants