You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/12/27 03:51:05 UTC

[GitHub] [shardingsphere] taojintianxia opened a new pull request, #23111: Refactor agent bootstrap

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

   Fixes #23049.
   
   Changes proposed in this pull request:
     - add shaded dependency in bootstrap module
     - add exclusions in plugins to make the plugin artifact smaller
     - extract the metrics-core seperately
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] 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.
   - [ ] 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


[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #23111: Refactor agent bootstrap

Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #23111:
URL: https://github.com/apache/shardingsphere/pull/23111#discussion_r1058297182


##########
agent/bootstrap/pom.xml:
##########
@@ -47,9 +52,8 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-agent-plugin-core</artifactId>
-            <version>${project.version}</version>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-transport</artifactId>
         </dependency>

Review Comment:
   > Bootstrap do not need netty
   
   need further communication. this time, there are something contradictory.



-- 
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


[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #23111: Refactor agent bootstrap

Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #23111:
URL: https://github.com/apache/shardingsphere/pull/23111#discussion_r1058296593


##########
.github/workflows/e2e.yml:
##########
@@ -219,4 +219,5 @@ jobs:
       - name: Run Integration Test
         run: |
           ./mvnw -B clean install -f test/e2e/agent/plugins/metrics/pom.xml -Dspotless.apply.skip=true -Pit.env.metrics
+          ./mvnw clean install -B -T1C -Dmaven.javadoc.skip=true -Djacoco.skip=true -Drat.skip=true -DskipITs -DskipTests -Dcheckstyle.skip=true -Prelease

Review Comment:
   > Check why metrics do not need -Prelease
   
   after communicated with you, this because of the metrics test doesn work



-- 
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


[GitHub] [shardingsphere] terrymanu merged pull request #23111: Refactor agent bootstrap

Posted by GitBox <gi...@apache.org>.
terrymanu merged PR #23111:
URL: https://github.com/apache/shardingsphere/pull/23111


-- 
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


[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #23111: Refactor agent bootstrap

Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #23111:
URL: https://github.com/apache/shardingsphere/pull/23111#discussion_r1058708422


##########
agent/bootstrap/pom.xml:
##########
@@ -47,9 +52,8 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-agent-plugin-core</artifactId>
-            <version>${project.version}</version>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-transport</artifactId>
         </dependency>

Review Comment:
   already removed from bootstrap



-- 
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


[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #23111: Refactor agent bootstrap

Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #23111:
URL: https://github.com/apache/shardingsphere/pull/23111#discussion_r1058235908


##########
agent/bootstrap/src/main/java/org/apache/shardingsphere/agent/bootstrap/path/AgentPathBuilder.java:
##########
@@ -71,7 +74,8 @@ private static File getFileInResource(final String url, final String classResour
         return new File(classLocation);
     }
     
-    private static File buildAgentPluginPath() {
-        return new File(String.join("/", agentPath.getPath(), "plugins"));
+    private static List<File> buildAgentPluginPath() {

Review Comment:
   > Rename to buildAgentPluginPaths
   
   resolved



-- 
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


[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #23111: Refactor agent bootstrap

Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #23111:
URL: https://github.com/apache/shardingsphere/pull/23111#discussion_r1058296593


##########
.github/workflows/e2e.yml:
##########
@@ -219,4 +219,5 @@ jobs:
       - name: Run Integration Test
         run: |
           ./mvnw -B clean install -f test/e2e/agent/plugins/metrics/pom.xml -Dspotless.apply.skip=true -Pit.env.metrics
+          ./mvnw clean install -B -T1C -Dmaven.javadoc.skip=true -Djacoco.skip=true -Drat.skip=true -DskipITs -DskipTests -Dcheckstyle.skip=true -Prelease

Review Comment:
   > Check why metrics do not need -Prelease
   
   after communicated with you, this because of the metrics test doesn't work



-- 
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


[GitHub] [shardingsphere] terrymanu commented on a diff in pull request #23111: Refactor agent bootstrap

Posted by GitBox <gi...@apache.org>.
terrymanu commented on code in PR #23111:
URL: https://github.com/apache/shardingsphere/pull/23111#discussion_r1058171968


##########
.github/workflows/e2e.yml:
##########
@@ -219,4 +219,5 @@ jobs:
       - name: Run Integration Test
         run: |
           ./mvnw -B clean install -f test/e2e/agent/plugins/metrics/pom.xml -Dspotless.apply.skip=true -Pit.env.metrics
+          ./mvnw clean install -B -T1C -Dmaven.javadoc.skip=true -Djacoco.skip=true -Drat.skip=true -DskipITs -DskipTests -Dcheckstyle.skip=true -Prelease

Review Comment:
   Check why metrics do not need -Prelease



##########
agent/bootstrap/pom.xml:
##########
@@ -47,9 +52,8 @@
             <scope>compile</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.shardingsphere</groupId>
-            <artifactId>shardingsphere-agent-plugin-core</artifactId>
-            <version>${project.version}</version>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-transport</artifactId>
         </dependency>

Review Comment:
   Bootstrap do not need netty



##########
agent/bootstrap/src/main/java/org/apache/shardingsphere/agent/bootstrap/plugin/loader/AgentPluginLoader.java:
##########
@@ -46,8 +48,15 @@ public final class AgentPluginLoader {
      * @throws IOException IO exception
      */
     public static Collection<PluginJar> load() throws IOException {
-        File[] jarFiles = AgentPathBuilder.getPluginPath().listFiles(each -> each.getName().endsWith(".jar"));
-        if (null == jarFiles) {
+        List<File> jarFiles = new LinkedList<>();
+        AgentPathBuilder.getPluginClassPaths().forEach(

Review Comment:
   extract one method



##########
agent/bootstrap/src/main/java/org/apache/shardingsphere/agent/bootstrap/path/AgentPathBuilder.java:
##########
@@ -71,7 +74,8 @@ private static File getFileInResource(final String url, final String classResour
         return new File(classLocation);
     }
     
-    private static File buildAgentPluginPath() {
-        return new File(String.join("/", agentPath.getPath(), "plugins"));
+    private static List<File> buildAgentPluginPath() {

Review Comment:
   Rename to buildAgentPluginPaths



-- 
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


[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #23111: Refactor agent bootstrap

Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #23111:
URL: https://github.com/apache/shardingsphere/pull/23111#discussion_r1058296593


##########
.github/workflows/e2e.yml:
##########
@@ -219,4 +219,5 @@ jobs:
       - name: Run Integration Test
         run: |
           ./mvnw -B clean install -f test/e2e/agent/plugins/metrics/pom.xml -Dspotless.apply.skip=true -Pit.env.metrics
+          ./mvnw clean install -B -T1C -Dmaven.javadoc.skip=true -Djacoco.skip=true -Drat.skip=true -DskipITs -DskipTests -Dcheckstyle.skip=true -Prelease

Review Comment:
   > Check why metrics do not need -Prelease
   
   resolved



-- 
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


[GitHub] [shardingsphere] codecov-commenter commented on pull request #23111: Refactor agent bootstrap

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #23111:
URL: https://github.com/apache/shardingsphere/pull/23111#issuecomment-1365602240

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/23111?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#23111](https://codecov.io/gh/apache/shardingsphere/pull/23111?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fba03b2) into [master](https://codecov.io/gh/apache/shardingsphere/commit/7152f64389143f2fbaba62ef1357473cefc8256f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7152f64) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   ```diff
   @@            Coverage Diff            @@
   ##             master   #23111   +/-   ##
   =========================================
     Coverage     49.95%   49.95%           
     Complexity     2433     2433           
   =========================================
     Files          4113     4113           
     Lines         57502    57502           
     Branches       9083     9083           
   =========================================
     Hits          28726    28726           
     Misses        26264    26264           
     Partials       2512     2512           
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/23111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ateShardingTableReferenceRuleStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/23111/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmVhdHVyZXMvc2hhcmRpbmcvZGlzdHNxbC9oYW5kbGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFyZGluZy9kaXN0c3FsL2hhbmRsZXIvdXBkYXRlL0NyZWF0ZVNoYXJkaW5nVGFibGVSZWZlcmVuY2VSdWxlU3RhdGVtZW50VXBkYXRlci5qYXZh) | `82.00% <ø> (ø)` | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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


[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #23111: Refactor agent bootstrap

Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #23111:
URL: https://github.com/apache/shardingsphere/pull/23111#discussion_r1058235736


##########
agent/bootstrap/src/main/java/org/apache/shardingsphere/agent/bootstrap/path/AgentPathBuilder.java:
##########
@@ -71,7 +74,8 @@ private static File getFileInResource(final String url, final String classResour
         return new File(classLocation);
     }
     
-    private static File buildAgentPluginPath() {
-        return new File(String.join("/", agentPath.getPath(), "plugins"));
+    private static List<File> buildAgentPluginPath() {

Review Comment:
   resolved



-- 
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


[GitHub] [shardingsphere] taojintianxia commented on a diff in pull request #23111: Refactor agent bootstrap

Posted by GitBox <gi...@apache.org>.
taojintianxia commented on code in PR #23111:
URL: https://github.com/apache/shardingsphere/pull/23111#discussion_r1058240778


##########
agent/bootstrap/src/main/java/org/apache/shardingsphere/agent/bootstrap/plugin/loader/AgentPluginLoader.java:
##########
@@ -46,8 +48,15 @@ public final class AgentPluginLoader {
      * @throws IOException IO exception
      */
     public static Collection<PluginJar> load() throws IOException {
-        File[] jarFiles = AgentPathBuilder.getPluginPath().listFiles(each -> each.getName().endsWith(".jar"));
-        if (null == jarFiles) {
+        List<File> jarFiles = new LinkedList<>();
+        AgentPathBuilder.getPluginClassPaths().forEach(

Review Comment:
   > extract one method
   
   resolved



-- 
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