You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "linghengqian (via GitHub)" <gi...@apache.org> on 2024/08/04 07:09:05 UTC

[PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

linghengqian opened a new pull request, #32389:
URL: https://github.com/apache/shardingsphere/pull/32389

   Fixes #32377 .
   
   Changes proposed in this pull request:
     - Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules.
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have self-reviewed the commit code.
   - [x] I have (or in comment I request) added corresponding labels for the pull request.
   - [x] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [x] I have added corresponding unit tests for my changes.
   


-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703254605


##########
infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json:
##########
@@ -2794,8 +2782,5 @@
   "bundles":[{
     "name":"com.microsoft.sqlserver.jdbc.SQLServerResource",
     "locales":["zh-CN"]
-  }, {
-    "name":"sun.text.resources.cldr.FormatData",
-    "locales":["en"]
   }]
 }

Review Comment:
   @linghengqian Should we keep blank line at the end of JSON file?



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703914408


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   > Yes. Because if we do not exclude the test scope logback globally, after a module introduces Hiveserver2 JDBC Driver, multiple slf4j adapters including Reload4j, Log4j2, Logback, Jakarta Commons Logging, etc. will still appear in the classpath of the unit test at the same time, which violates https://www.slf4j.org/codes.html#multiple_bindings . I think a better solution is to explicitly declare Logback in the module that needs to use Logback. What do you think?
   
   If we use \<exclusion> to exclude incompatible dependencies when introducing new dependency, such as log4j introduced by hive, to ensure the simplicity of ShardingSphere itself, is this possible?
   



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703838406


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   I agree with your point. How do you know that these modules need to depend on logback? (There are quite a lot of them)



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703857170


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   - For the current PR, this involves 3 steps. 
   
     - Step 1, remove Logback under `pom.xml`, and add provided scope Logback for modules that directly use the Logback Java API. 
   
     - Step 2, globally search for `.xml` files containing `logback` text under the `**/main/**` directory in the project, and ensure that provided scope Logback already exists in the corresponding module. 
   
     - Step 3, globally match `.xml` files containing logback text under the `**/test/**` directory in the project, and ensure that test scope Logback already exists in the corresponding module.
   
   - I would say that the logback community doesn't seem to provide any cli tools or AI tools to simplify this seemingly weird process. This process is carried out through the Find window of IntelliJ IDEA 2024.1. On the shardingsphere side, it looks like we only configure Logback via Java API and xml, there is no `logback.properties` or `logback.yaml`



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1704276177


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   @linghengqian Thank you!



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703767408


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   Yes. Because if we do not exclude the test scope logback globally, after a module introduces Hiveserver2 JDBC Driver, multiple slf4j adapters including Reload4j, Log4j2, Logback, Jakarta Commons Logging, etc. will still appear in the classpath of the unit test at the same time, which violates https://www.slf4j.org/codes.html#multiple_bindings . I think a better solution is to explicitly declare Logback in the module that needs to use Logback. What do you think?



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703758568


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   @linghengqian Yes, I found the difference, in this PR you removed logback from the root pom and added it to specific modules, just to make logback not appear in the test scope downstream?



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703502276


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   - See https://github.com/apache/shardingsphere/pull/32389#discussion_r1703490403 . After I removed the declaration of `ch.qos.logback:logback-classic` here, I didn't see any logback dependencies. Without explicit declaration, the `parser/sql/dialect/doris/src/test/resources/logback-test.xml` of this module will be useless. Where does this picture come from?
   - ![image](https://github.com/user-attachments/assets/f1eaf8f1-2036-45aa-9b3c-26c5dd4d8788)
   



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703258183


##########
infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json:
##########
@@ -2794,8 +2782,5 @@
   "bundles":[{
     "name":"com.microsoft.sqlserver.jdbc.SQLServerResource",
     "locales":["zh-CN"]
-  }, {
-    "name":"sun.text.resources.cldr.FormatData",
-    "locales":["en"]
   }]
 }

Review Comment:
   - This is what the GraalVM Tracing Agent ( under GraalVM CE For JDK 22.0.2 ) does after executing `./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C clean test native:metadata-copy` to fix nativeTest. 
   
   - As discussed earlier, the entire JSON file in the same folder is automatically generated and is considered to be unchangeable by https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-jdbc/graalvm-native-image/ . CC @terrymanu .
   
   - Do you think we need to add checkstyle or spotless rules to automatically detect and add blank lines?



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1704037794


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   - Done.



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703969434


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   - This is actually what I asked you at https://github.com/apache/shardingsphere/pull/32389#discussion_r1703174856 . We have 2 options, one is to keep the test scope Logback globally, the other is to remove the test scope Logback globally. We can of course limit unit tests to use only Logback. If you think the test scope Log should be kept globally, another commit will be pushed.
   ```xml
           <dependency>
               <groupId>org.apache.hive</groupId>
               <artifactId>hive-jdbc</artifactId>
               <version>4.0.0</version>
           </dependency>
           <!-- See https://issues.apache.org/jira/browse/HIVE-28308 -->
           <dependency>
               <groupId>org.apache.hive</groupId>
               <artifactId>hive-service</artifactId>
               <version>4.0.0</version>
               <exclusions>
                   <!-- See https://issues.apache.org/jira/browse/HIVE-28429 -->
                   <exclusion>
                       <groupId>org.apache.hadoop</groupId>
                       <artifactId>hadoop-client-api</artifactId>
                   </exclusion>
                   <exclusion>
                       <groupId>org.apache.logging.log4j</groupId>
                       <artifactId>log4j-api</artifactId>
                   </exclusion>
                   <exclusion>
                       <groupId>org.apache.logging.log4j</groupId>
                       <artifactId>log4j-slf4j-impl</artifactId>
                   </exclusion>
                   <exclusion>
                       <groupId>org.slf4j</groupId>
                       <artifactId>slf4j-log4j12</artifactId>
                   </exclusion>
               </exclusions>
           </dependency>
           <dependency>
               <groupId>org.apache.hadoop</groupId>
               <artifactId>hadoop-client-api</artifactId>
               <version>3.3.6</version>
           </dependency>
   ```



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703480454


##########
infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json:
##########
@@ -2794,8 +2782,5 @@
   "bundles":[{
     "name":"com.microsoft.sqlserver.jdbc.SQLServerResource",
     "locales":["zh-CN"]
-  }, {
-    "name":"sun.text.resources.cldr.FormatData",
-    "locales":["en"]
   }]
 }

Review Comment:
   I'm just curious if this is an omission. If it is confirmed to be unchangeable, we can just keep it as it is.



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703557145


##########
mode/type/standalone/repository/provider/jdbc/pom.xml:
##########
@@ -61,5 +61,10 @@
             <artifactId>mysql-connector-j</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   It looks like you are looking at the dependencies of the master branch. On the master branch, logback in test scope is pulled into all modules, as I pointed out in https://github.com/apache/shardingsphere/pull/32389#discussion_r1703174856.



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703557584


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   It looks like you are looking at the dependencies of the master branch. On the master branch, logback in test scope is pulled into all modules, as I pointed out in https://github.com/apache/shardingsphere/pull/32389#discussion_r1703174856 .



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703490403


##########
mode/type/standalone/repository/provider/jdbc/pom.xml:
##########
@@ -61,5 +61,10 @@
             <artifactId>mysql-connector-j</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   - After I removed the declaration of `ch.qos.logback:logback-classic` here, I didn't see any logback dependencies. Without explicit declaration, the `mode/type/standalone/repository/provider/jdbc/src/test/resources/logback-test.xml` of this module will be useless. Where does this picture come from?
   - ![image](https://github.com/user-attachments/assets/102c2525-787f-445b-8d69-4be2da99f724)
   



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703548278


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   <img width="1643" alt="image" src="https://github.com/user-attachments/assets/94e81ea4-25d9-4c11-b351-6d8a6de02136">
   



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703174856


##########
pom.xml:
##########
@@ -987,10 +987,6 @@
             <groupId>org.slf4j</groupId>
             <artifactId>jcl-over-slf4j</artifactId>
         </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-        </dependency>

Review Comment:
   @RaigorJiang What do you think about removing the test dependency of logback globally? Or keeping it?



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703253534


##########
pom.xml:
##########
@@ -987,10 +987,6 @@
             <groupId>org.slf4j</groupId>
             <artifactId>jcl-over-slf4j</artifactId>
         </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-        </dependency>

Review Comment:
   @linghengqian  I'm in favor of removing it from the global, and temporarily disabling the logging rule, since it now binds to logback, and users don't know how to configure the rule.
   
   #23856 provides a good idea, but before we implement the logging rule well, it is better not to let it affect users.



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703994181


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   > * This is actually what I asked you at [Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modulesĀ #32389 (comment)](https://github.com/apache/shardingsphere/pull/32389#discussion_r1703174856) . We have 2 options, one is to keep the test scope Logback globally, the other is to remove the test scope Logback globally. We can of course limit unit tests to use only Logback. If you think the test scope Log should be kept globally, another commit will be pushed.
   > 
   
   Sorry, I misunderstood your intention. I thought we were going to remove the logback dependency introduced by the logging rule.
   
   For scenarios like hive, the \<exclusion> method is more acceptable, and ShardingSphere developers can still focus on logback.
   
   



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703914408


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   > Yes. Because if we do not exclude the test scope logback globally, after a module introduces Hiveserver2 JDBC Driver, multiple slf4j adapters including Reload4j, Log4j2, Logback, Jakarta Commons Logging, etc. will still appear in the classpath of the unit test at the same time, which violates https://www.slf4j.org/codes.html#multiple_bindings . I think a better solution is to explicitly declare Logback in the module that needs to use Logback. What do you think?
   
   If we use <exclusion> to exclude incompatible dependencies when introducing new dependency, such as log4j introduced by hive, to ensure the simplicity of ShardingSphere itself, is this possible?
   



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703485494


##########
mode/type/standalone/repository/provider/jdbc/pom.xml:
##########
@@ -61,5 +61,10 @@
             <artifactId>mysql-connector-j</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   I see from the dependency analyzer that the `shardingsphere-standalone-mode-repository-jdbc` module's dependency on `logback-classic` is already in `test` scope. Can you please help check it?
   
   <img width="533" alt="image" src="https://github.com/user-attachments/assets/3aed0ec9-40ea-4ddb-9f76-a2d14f0fa369">
   
   



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703485999


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   Similar to the situation in `shardingsphere-standalone-mode-repository-jdbc`, it is already in `test` scope.
   
   <img width="530" alt="image" src="https://github.com/user-attachments/assets/c36ab618-6891-4aff-aef0-8717a7049185">
   



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703547614


##########
mode/type/standalone/repository/provider/jdbc/pom.xml:
##########
@@ -61,5 +61,10 @@
             <artifactId>mysql-connector-j</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   My screenshot is from here
   
   <img width="1643" alt="image" src="https://github.com/user-attachments/assets/51654d18-558a-4ed7-856a-2044c0bbfcc3">
   



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703259887


##########
pom.xml:
##########
@@ -987,10 +987,6 @@
             <groupId>org.slf4j</groupId>
             <artifactId>jcl-over-slf4j</artifactId>
         </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-        </dependency>

Review Comment:
   So far, the current PR seems to be ready for the next review. In the current PR, Shardingsphere Proxy uses Logback with runtime scope, while ShardingSphere JDBC only provides Logback with provided scope.



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389#discussion_r1703904700


##########
parser/sql/dialect/doris/pom.xml:
##########
@@ -36,5 +36,11 @@
             <artifactId>shardingsphere-infra-database-doris</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>test</scope>

Review Comment:
   Yes, the Java API may be introduced by logging rule, and the others are all in logback.xml
   
   Thanks for your clarification.



-- 
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@shardingsphere.apache.org

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


Re: [PR] Block `shardingsphere-logging-core` from passing `logback-classic` dependencies to downstream modules [shardingsphere]

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang merged PR #32389:
URL: https://github.com/apache/shardingsphere/pull/32389


-- 
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@shardingsphere.apache.org

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