You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "xingfudeshi (via GitHub)" <gi...@apache.org> on 2026/03/30 03:21:57 UTC

[PR] 2.x [incubator-seata]

xingfudeshi opened a new pull request, #8029:
URL: https://github.com/apache/incubator-seata/pull/8029

   <!--
       Licensed to the Apache Software Foundation (ASF) under one or more
       contributor license agreements.  See the NOTICE file distributed with
       this work for additional information regarding copyright ownership.
       The ASF licenses this file to You under the Apache License, Version 2.0
       (the "License"); you may not use this file except in compliance with
       the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
       
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
   -->
   <!-- Please make sure you have read and understood the contributing guidelines -->
   
   - [ ] I have read the [CONTRIBUTING.md](https://github.com/apache/incubator-seata/blob/2.x/CONTRIBUTING.md) guidelines.
   - [ ] I have registered the PR [changes](https://github.com/apache/incubator-seata/tree/2.x/changes).
   
   ### Ⅰ. Describe what this PR did
   
   
   ### Ⅱ. Does this pull request fix one issue?
   <!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
   
   
   ### Ⅲ. Why don't you add test cases (unit test/integration test)? 
   
   
   ### Ⅳ. Describe how to verify it
   
   
   ### Ⅴ. Special notes for reviews
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] 2.x [incubator-seata]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8029:
URL: https://github.com/apache/incubator-seata/pull/8029#discussion_r3007328516


##########
pom.xml:
##########
@@ -289,6 +289,78 @@
                 </plugins>
             </build>
         </profile>
+
+        <!-- profile: spotless -->
+        <profile>
+            <id>jdk9-jdk11-spotless</id>
+            <activation>
+                <jdk>[1.8, 11)</jdk>
+            </activation>
+            <properties>
+                <palantirJavaFormat.version>1.1.0</palantirJavaFormat.version>
+            </properties>
+        </profile>
+
+        <profile>
+            <id>jdk11-jdk21-spotless</id>
+            <activation>
+                <jdk>[11, 21)</jdk>
+            </activation>

Review Comment:
   The JDK activation range contains an extra space (`[11, 21)`). For consistency with the rest of the POM and to avoid parsing ambiguities, please format it without whitespace (e.g., `[11,21)`).



##########
pom.xml:
##########
@@ -289,6 +289,78 @@
                 </plugins>
             </build>
         </profile>
+
+        <!-- profile: spotless -->
+        <profile>
+            <id>jdk9-jdk11-spotless</id>
+            <activation>
+                <jdk>[1.8, 11)</jdk>
+            </activation>
+            <properties>
+                <palantirJavaFormat.version>1.1.0</palantirJavaFormat.version>
+            </properties>
+        </profile>
+
+        <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>
+        <profile>
+            <id>java11+</id>
+            <activation>
+                <jdk>[11,)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.diffplug.spotless</groupId>
+                        <artifactId>spotless-maven-plugin</artifactId>
+                        <version>${spotless-maven-plugin.version}</version>
+                        <configuration>
+                            <java>
+                                <excludes>
+                                    <exclude>**/script/**</exclude>
+                                    <exclude>**/generated/**</exclude>
+                                    <exclude>**/antlr/mysql/parser/*.*</exclude>
+                                    <exclude>**/antlr/mysql/antlr/*.*</exclude>
+                                    <exclude>**/antlr/mysql/stream/ANTLRNoCaseStringStream.java</exclude>
+                                </excludes>
+                                <ratchetFrom>origin/2.x</ratchetFrom>
+                                <palantirJavaFormat>
+                                    <version>${palantirJavaFormat.version}</version>
+                                </palantirJavaFormat>
+                                <removeUnusedImports/>
+                                <trimTrailingWhitespace/>
+                                <endWithNewline/>
+                            </java>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>apply</goal>

Review Comment:
   This binds `spotless:apply` to the normal build lifecycle (`process-sources`) whenever JDK >= 11, which will mutate working-tree sources during every build/CI run. Typically CI should use `spotless:check` (to fail on formatting issues) and keep `apply` as an explicit/manual goal to avoid unexpected source rewrites and non-reproducible builds.
   ```suggestion
                                       <goal>check</goal>
   ```



##########
changes/zh-cn/2.x.md:
##########
@@ -17,6 +17,7 @@
 - [[#7182](https://github.com/apache/incubator-seata/pull/7182)] 采用peerId的ip作为raft节点的host
 - [[#7181](https://github.com/apache/incubator-seata/pull/7181)] raft实现域名解析并选择peerId
 - [[#7213](https://github.com/apache/incubator-seata/pull/7213)] support kingbase xa mode
+- [[#7223](https://github.com/apache/incubator-seata/pull/7223)] 使用 Palantir java 格式应用 Spotless

Review Comment:
   Minor wording/capitalization: “Palantir java” should be “Palantir Java”.
   ```suggestion
   - [[#7223](https://github.com/apache/incubator-seata/pull/7223)] 使用 Palantir Java 格式应用 Spotless
   ```



##########
pom.xml:
##########
@@ -289,6 +289,78 @@
                 </plugins>
             </build>
         </profile>
+
+        <!-- profile: spotless -->
+        <profile>
+            <id>jdk9-jdk11-spotless</id>
+            <activation>
+                <jdk>[1.8, 11)</jdk>
+            </activation>
+            <properties>
+                <palantirJavaFormat.version>1.1.0</palantirJavaFormat.version>
+            </properties>
+        </profile>
+
+        <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>
+        <profile>
+            <id>java11+</id>
+            <activation>
+                <jdk>[11,)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.diffplug.spotless</groupId>
+                        <artifactId>spotless-maven-plugin</artifactId>
+                        <version>${spotless-maven-plugin.version}</version>
+                        <configuration>
+                            <java>
+                                <excludes>
+                                    <exclude>**/script/**</exclude>
+                                    <exclude>**/generated/**</exclude>
+                                    <exclude>**/antlr/mysql/parser/*.*</exclude>
+                                    <exclude>**/antlr/mysql/antlr/*.*</exclude>
+                                    <exclude>**/antlr/mysql/stream/ANTLRNoCaseStringStream.java</exclude>
+                                </excludes>
+                                <ratchetFrom>origin/2.x</ratchetFrom>

Review Comment:
   `ratchetFrom` points to `origin/2.x`, but the repo’s GitHub Actions workflows use `actions/checkout` with the default shallow fetch (no `fetch-depth: 0` / no explicit fetch of `2.x`). In that environment `origin/2.x` is typically not present, which can make Spotless fail when it tries to resolve the ratchet ref. Consider removing `ratchetFrom`, or switching it to a ref that is guaranteed to exist in CI, or updating CI checkout to fetch the base branch ref.
   ```suggestion
   
   ```



##########
build/pom.xml:
##########
@@ -109,6 +109,8 @@
         <license-maven-plugin.version>4.0</license-maven-plugin.version>
         <mojo-license-maven-plugin.version>1.20</mojo-license-maven-plugin.version>
         <maven-checkstyle-plugin.version>3.1.1</maven-checkstyle-plugin.version>
+        <spotless-maven-plugin.version>2.44.3</spotless-maven-plugin.version>
+        <palantirJavaFormat.version>2.38.0</palantirJavaFormat.version>

Review Comment:
   `palantirJavaFormat.version` is now set here, but in the root `pom.xml` it is overridden by JDK-activated profiles for all supported JDKs. If the intent is for the root profiles to control the version, consider removing this default to avoid confusion, or ensure the default value matches the intended baseline.
   ```suggestion
   
   ```



##########
pom.xml:
##########
@@ -289,6 +289,78 @@
                 </plugins>
             </build>
         </profile>
+
+        <!-- profile: spotless -->
+        <profile>
+            <id>jdk9-jdk11-spotless</id>
+            <activation>
+                <jdk>[1.8, 11)</jdk>
+            </activation>
+            <properties>
+                <palantirJavaFormat.version>1.1.0</palantirJavaFormat.version>
+            </properties>
+        </profile>

Review Comment:
   The profile id `jdk9-jdk11-spotless` doesn’t match its activation range (`[1.8, 11)`) and, as written, it only sets a property while the Spotless plugin itself is only enabled in the `java11+` profile. This makes the profile confusing/ineffective—either align the id/range with the intended JDKs and wire it into the Spotless profile, or remove it.
   ```suggestion
   
   ```



##########
pom.xml:
##########
@@ -289,6 +289,78 @@
                 </plugins>
             </build>
         </profile>
+
+        <!-- profile: spotless -->
+        <profile>
+            <id>jdk9-jdk11-spotless</id>
+            <activation>
+                <jdk>[1.8, 11)</jdk>
+            </activation>

Review Comment:
   The JDK activation range contains an extra space (`[1.8, 11)`). Elsewhere in this POM (e.g., `checkstyle` profile) ranges are written without spaces. Please remove the whitespace for consistency and to avoid any Maven version-range parsing edge cases.



##########
changes/en-us/2.x.md:
##########
@@ -17,6 +17,7 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7182](https://github.com/apache/incubator-seata/pull/7182)] use the ip of the peerId as the host of the raft node
 - [[#7181](https://github.com/apache/incubator-seata/pull/7181)] raft implements domain name resolution and selects peerId
 - [[#7213](https://github.com/apache/incubator-seata/pull/7213)] support kingbase xa mode
+- [[#7223](https://github.com/apache/incubator-seata/pull/7223)] apply Spotless with Palantir java format

Review Comment:
   Minor wording/capitalization: “Palantir java format” should be “Palantir Java format”.
   ```suggestion
   - [[#7223](https://github.com/apache/incubator-seata/pull/7223)] apply Spotless with Palantir Java format
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] 2.x [incubator-seata]

Posted by "xingfudeshi (via GitHub)" <gi...@apache.org>.
xingfudeshi closed pull request #8029: 2.x
URL: https://github.com/apache/incubator-seata/pull/8029


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org