NihalJain commented on PR #122:
URL: https://github.com/apache/hbase-connectors/pull/122#issuecomment-1699672530

   Ran spotless locally and ensured it failed with a bad patch
   ```
   | Vote |    Subsystem |  Runtime   | Comment
   ============================================================================
   +---------------------------------------------------------------------------
   |      |              |            | Prechecks
   +---------------------------------------------------------------------------
   +---------------------------------------------------------------------------
   |      |              |            | HBASE-28054 Compile Tests
   +---------------------------------------------------------------------------
   |   0  |      mvndep  |   0m 10s   | Maven dependency ordering for branch
   |  +1  |    spotless  |   0m 19s   | branch has no errors when running
   |      |              |            | spotless:check.
   +---------------------------------------------------------------------------
   |      |              |            | Patch Compile Tests
   +---------------------------------------------------------------------------
   |   0  |      mvndep  |   0m 09s   | Maven dependency ordering for patch
   |  -1  |    spotless  |   0m 19s   | patch has 26 errors when running
   |      |              |            | spotless:check, run spotless:apply to 
fix.
   +---------------------------------------------------------------------------
   |      |              |            | Other Tests
   +---------------------------------------------------------------------------
   |      |              |   1m 25s   |
   ```
   
   Output of spotless run file:
   ```
   ➜  hbase-connectors git:(HBASE-28054) ✗ cat 
/private/tmp/yetus-21136.6492/patch-spotless.txt
   Thu Aug 31 00:09:40 IST 2023
   cd /Users/nihaljain/code/os/hbase-connectors
   mvn --offline --batch-mode spotless:check
   [INFO] Scanning for projects...
   [INFO] 
------------------------------------------------------------------------
   [INFO] Reactor Build Order:
   [INFO]
   [INFO] Apache HBase Connectors                                            
[pom]
   [INFO] Apache HBase - Kafka                                               
[pom]
   [INFO] Apache HBase - Model Objects for Kafka Proxy                       
[jar]
   [INFO] Apache HBase - Kafka Proxy                                         
[jar]
   [INFO] Apache HBase - Spark                                               
[pom]
   [INFO] Apache HBase - Spark Protocol                                      
[jar]
   [INFO] Apache HBase - Spark Protocol (Shaded)                             
[jar]
   [INFO] Apache HBase - Spark Connector                                     
[jar]
   [INFO] Apache HBase - Spark Integration Tests                             
[jar]
   [INFO] Apache HBase Connectors - Assembly                                 
[pom]
   [INFO]
   [INFO] ------------< org.apache.hbase.connectors:hbase-connectors 
>------------
   [INFO] Building Apache HBase Connectors 1.0.1-SNAPSHOT                   
[1/10]
   [INFO] --------------------------------[ pom 
]---------------------------------
   [INFO]
   [INFO] --- spotless-maven-plugin:2.27.2:check (default-cli) @ 
hbase-connectors ---
   [INFO] Sorting file 
/var/folders/xb/j3j5fp5153g06gh5sdkmhf7c0000gq/T/pom2175271538862894342.xml
   [INFO] Pom file is already sorted, exiting
   [INFO]
   [INFO] -----------------< org.apache.hbase.connectors:kafka 
>------------------
   [INFO] Building Apache HBase - Kafka 1.0.1-SNAPSHOT                      
[2/10]
   [INFO] --------------------------------[ pom 
]---------------------------------
   [INFO]
   [INFO] --- spotless-maven-plugin:2.27.2:check (default-cli) @ kafka ---
   [INFO] Sorting file 
/var/folders/xb/j3j5fp5153g06gh5sdkmhf7c0000gq/T/pom4621269930024559741.xml
   [INFO] Pom file is already sorted, exiting
   [INFO]
   [INFO] --------< org.apache.hbase.connectors.kafka:hbase-kafka-model 
>---------
   [INFO] Building Apache HBase - Model Objects for Kafka Proxy 1.0.1-SNAPSHOT 
[3/10]
   [INFO] --------------------------------[ jar 
]---------------------------------
   [INFO]
   [INFO] --- spotless-maven-plugin:2.27.2:check (default-cli) @ 
hbase-kafka-model ---
   [INFO] Sorting file 
/var/folders/xb/j3j5fp5153g06gh5sdkmhf7c0000gq/T/pom503402107018101105.xml
   [INFO] Pom file is already sorted, exiting
   [INFO]
   [INFO] --------< org.apache.hbase.connectors.kafka:hbase-kafka-proxy 
>---------
   [INFO] Building Apache HBase - Kafka Proxy 1.0.1-SNAPSHOT                
[4/10]
   [INFO] --------------------------------[ jar 
]---------------------------------
   [INFO]
   [INFO] --- spotless-maven-plugin:2.27.2:check (default-cli) @ 
hbase-kafka-proxy ---
   [INFO] Sorting file 
/var/folders/xb/j3j5fp5153g06gh5sdkmhf7c0000gq/T/pom677669518756705814.xml
   [INFO] Pom file is already sorted, exiting
   [INFO]
   [INFO] -----------------< org.apache.hbase.connectors:spark 
>------------------
   [INFO] Building Apache HBase - Spark 1.0.1-SNAPSHOT                      
[5/10]
   [INFO] --------------------------------[ pom 
]---------------------------------
   [INFO]
   [INFO] --- spotless-maven-plugin:2.27.2:check (default-cli) @ spark ---
   [INFO] Sorting file 
/var/folders/xb/j3j5fp5153g06gh5sdkmhf7c0000gq/T/pom7109549005648937715.xml
   [INFO] Pom file is already sorted, exiting
   [INFO]
   [INFO] -------< org.apache.hbase.connectors.spark:hbase-spark-protocol 
>-------
   [INFO] Building Apache HBase - Spark Protocol 1.0.1-SNAPSHOT             
[6/10]
   [INFO] --------------------------------[ jar 
]---------------------------------
   [INFO]
   [INFO] --- spotless-maven-plugin:2.27.2:check (default-cli) @ 
hbase-spark-protocol ---
   [INFO] Sorting file 
/var/folders/xb/j3j5fp5153g06gh5sdkmhf7c0000gq/T/pom6296127495647823376.xml
   [INFO] Pom file is already sorted, exiting
   [INFO]
   [INFO] ---< org.apache.hbase.connectors.spark:hbase-spark-protocol-shaded 
>----
   [INFO] Building Apache HBase - Spark Protocol (Shaded) 1.0.1-SNAPSHOT    
[7/10]
   [INFO] --------------------------------[ jar 
]---------------------------------
   [INFO]
   [INFO] --- spotless-maven-plugin:2.27.2:check (default-cli) @ 
hbase-spark-protocol-shaded ---
   [INFO] Sorting file 
/var/folders/xb/j3j5fp5153g06gh5sdkmhf7c0000gq/T/pom2799991780908287063.xml
   [INFO] Pom file is already sorted, exiting
   [INFO]
   [INFO] -----------< org.apache.hbase.connectors.spark:hbase-spark 
>------------
   [INFO] Building Apache HBase - Spark Connector 1.0.1-SNAPSHOT            
[8/10]
   [INFO] --------------------------------[ jar 
]---------------------------------
   [INFO]
   [INFO] --- spotless-maven-plugin:2.27.2:check (default-cli) @ hbase-spark ---
   [INFO] 
------------------------------------------------------------------------
   [INFO] Reactor Summary for Apache HBase Connectors 1.0.1-SNAPSHOT:
   [INFO]
   [INFO] Apache HBase Connectors ............................ SUCCESS [  2.091 
s]
   [INFO] Apache HBase - Kafka ............................... SUCCESS [  0.116 
s]
   [INFO] Apache HBase - Model Objects for Kafka Proxy ....... SUCCESS [  0.118 
s]
   [INFO] Apache HBase - Kafka Proxy ......................... SUCCESS [  2.238 
s]
   [INFO] Apache HBase - Spark ............................... SUCCESS [  0.178 
s]
   [INFO] Apache HBase - Spark Protocol ...................... SUCCESS [  0.087 
s]
   [INFO] Apache HBase - Spark Protocol (Shaded) ............. SUCCESS [  0.064 
s]
   [INFO] Apache HBase - Spark Connector ..................... FAILURE [  9.008 
s]
   [INFO] Apache HBase - Spark Integration Tests ............. SKIPPED
   [INFO] Apache HBase Connectors - Assembly ................. SKIPPED
   [INFO] 
------------------------------------------------------------------------
   [INFO] BUILD FAILURE
   [INFO] 
------------------------------------------------------------------------
   [INFO] Total time:  14.427 s
   [INFO] Finished at: 2023-08-31T00:09:56+05:30
   [INFO] 
------------------------------------------------------------------------
   [ERROR] Failed to execute goal 
com.diffplug.spotless:spotless-maven-plugin:2.27.2:check (default-cli) on 
project hbase-spark: The following files had format violations:
   [ERROR]     
src/main/scala/org/apache/hadoop/hbase/spark/example/datasources/DataType.scala
   [ERROR]         @@ -30,10 +30,8 @@
   [ERROR]
   [ERROR]          @InterfaceAudience.Private
   [ERROR]          object·UserCustomizedSampleException·{
   [ERROR]         -··def
   [ERROR]         -··message(message:·String,·cause:·Throwable)·=
   [ERROR]         -····if
   [ERROR]         -····(message·!=·null)·message
   [ERROR]         +··def·message(message:·String,·cause:·Throwable)·=
   [ERROR]         +····if·(message·!=·null)·message
   [ERROR]          ····else·if·(cause·!=·null)·cause.toString()
   [ERROR]          ····else·null
   [ERROR]          }
   [ERROR] Run 'mvn spotless:apply' to fix these violations.
   [ERROR] -> [Help 1]
   [ERROR]
   [ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
   [ERROR] Re-run Maven using the -X switch to enable full debug logging.
   [ERROR]
   [ERROR] For more information about the errors and possible solutions, please 
read the following articles:
   [ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
   [ERROR]
   [ERROR] After correcting the problems, you can resume the build with the 
command
   [ERROR]   mvn <args> -rf :hbase-spark
   ```
   Content of bad patch: 
   ```
   ➜  hbase-connectors git:(HBASE-28054) ✗ cat 0001-test-spotless.patch
   From 28ee398fe71b154875acab508ce64bf6c8440585 Mon Sep 17 00:00:00 2001
   From: "Jain, Nihal" <[email protected]>
   Date: Wed, 30 Aug 2023 22:25:34 +0530
   Subject: [PATCH] test spotless
   
   ---
    .../hadoop/hbase/spark/IntegrationTestSparkBulkLoad.java    | 4 +++-
    .../hadoop/hbase/spark/example/datasources/DataType.scala   | 6 ++++--
    2 files changed, 7 insertions(+), 3 deletions(-)
   
   diff --git 
a/spark/hbase-spark-it/src/test/java/org/apache/hadoop/hbase/spark/IntegrationTestSparkBulkLoad.java
 
b/spark/hbase-spark-it/src/test/java/org/apache/hadoop/hbase/spark/IntegrationTestSparkBulkLoad.java
   index 0766915..9299926 100644
   --- 
a/spark/hbase-spark-it/src/test/java/org/apache/hadoop/hbase/spark/IntegrationTestSparkBulkLoad.java
   +++ 
b/spark/hbase-spark-it/src/test/java/org/apache/hadoop/hbase/spark/IntegrationTestSparkBulkLoad.java
   @@ -119,7 +119,9 @@ public class IntegrationTestSparkBulkLoad extends 
IntegrationTestBase {
       */
      public void runLoad() throws Exception {
        setupTable();
   -    int numImportRounds = getConf().getInt(BULKLOAD_IMPORT_ROUNDS, 
DEFAULT_BULKLOAD_IMPORT_ROUNDS);
   +    int numImportRounds
   +            =
   +            getConf().getInt(BULKLOAD_IMPORT_ROUNDS, 
DEFAULT_BULKLOAD_IMPORT_ROUNDS);
        LOG.info("Running load with numIterations:" + numImportRounds);
        for (int i = 0; i < numImportRounds; i++) {
          runLinkedListSparkJob(i);
   diff --git 
a/spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/example/datasources/DataType.scala
 
b/spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/example/datasources/DataType.scala
   index d314dc8..be2bf33 100644
   --- 
a/spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/example/datasources/DataType.scala
   +++ 
b/spark/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/example/datasources/DataType.scala
   @@ -30,8 +30,10 @@ class UserCustomizedSampleException(message: String = 
null, cause: Throwable = n
   
    @InterfaceAudience.Private
    object UserCustomizedSampleException {
   -  def message(message: String, cause: Throwable) =
   -    if (message != null) message
   +  def
   +  message(message: String, cause: Throwable) =
   +    if
   +    (message != null) message
        else if (cause != null) cause.toString()
        else null
    }
   --
   2.33.0
   ```
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to