Skip to content

Commit

Permalink
Upgrade dependency to reduce conflicts and add leak UT coverage files. (
Browse files Browse the repository at this point in the history
#11396)

* Remove custom jackson version and jackson-core-asl.

* Upgrade protobuf relative version to reduce conflict with grpc.

* 补充提交遗漏单测覆盖率的模块。
  • Loading branch information
KomachiSion authored Nov 17, 2023
1 parent 167630e commit 0398733
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- name: "Codecov"
uses: codecov/[email protected]
with:
files: ./address/target/site/jacoco/jacoco.xml,./api/target/site/jacoco/jacoco.xml,./auth/target/site/jacoco/jacoco.xml,./client/target/site/jacoco/jacoco.xml,./common/target/site/jacoco/jacoco.xml,./consistency/target/site/jacoco/jacoco.xml,./console/target/site/jacoco/jacoco.xml,./core/target/site/jacoco/jacoco.xml,./naming/target/site/jacoco/jacoco.xml,./plugin-default-impl/target/site/jacoco/jacoco.xml,./plugin/auth/target/site/jacoco/jacoco.xml,./plugin/encryption/target/site/jacoco/jacoco.xml,./sys/target/site/jacoco/jacoco.xml
files: ./address/target/site/jacoco/jacoco.xml,./api/target/site/jacoco/jacoco.xml,./auth/target/site/jacoco/jacoco.xml,./client/target/site/jacoco/jacoco.xml,./common/target/site/jacoco/jacoco.xml,./consistency/target/site/jacoco/jacoco.xml,./console/target/site/jacoco/jacoco.xml,./core/target/site/jacoco/jacoco.xml,./naming/target/site/jacoco/jacoco.xml,./persistence/target/site/jacoco/jacoco.xml,./plugin-default-impl/nacos-default-auth-plugin/target/site/jacoco/jacoco.xml,./plugin/auth/target/site/jacoco/jacoco.xml,./plugin/config/target/site/jacoco/jacoco.xml,./plugin/control/target/site/jacoco/jacoco.xml,./plugin/datasource/target/site/jacoco/jacoco.xml,./plugin/encryption/target/site/jacoco/jacoco.xml,./plugin/environment/target/site/jacoco/jacoco.xml,./plugin/trace/target/site/jacoco/jacoco.xml,./prometheus/target/site/jacoco/jacoco.xml,./sys/target/site/jacoco/jacoco.xml
4 changes: 0 additions & 4 deletions naming/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package com.alibaba.nacos.naming.push;

import com.alibaba.nacos.naming.misc.UtilsAndCommons;
import com.alibaba.nacos.common.utils.StringUtils;
import org.codehaus.jackson.Version;
import org.codehaus.jackson.util.VersionUtil;
import com.alibaba.nacos.naming.misc.UtilsAndCommons;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.core.util.VersionUtil;

/**
* Client info.
Expand Down Expand Up @@ -49,7 +49,7 @@ private Version parseVersion(String versionStr) {
if (versionStartIndex < 0) {
return Version.unknownVersion();
}
return VersionUtil.parseVersion(versionStr.substring(versionStartIndex + 2));
return VersionUtil.parseVersion(versionStr.substring(versionStartIndex + 2), null, null);
}

public enum ClientType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
import com.alibaba.nacos.naming.pojo.Subscriber;
import com.alibaba.nacos.naming.remote.udp.AckEntry;
import com.alibaba.nacos.naming.remote.udp.UdpConnector;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.core.util.VersionUtil;
import org.apache.commons.collections.MapUtils;
import org.codehaus.jackson.util.VersionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -153,25 +154,29 @@ public boolean canEnablePush(String agent) {
ClientInfo clientInfo = new ClientInfo(agent);

if (ClientInfo.ClientType.JAVA == clientInfo.type
&& clientInfo.version.compareTo(VersionUtil.parseVersion(switchDomain.getPushJavaVersion())) >= 0) {
&& clientInfo.version.compareTo(parseVersion(switchDomain.getPushJavaVersion())) >= 0) {
return true;
} else if (ClientInfo.ClientType.DNS == clientInfo.type
&& clientInfo.version.compareTo(VersionUtil.parseVersion(switchDomain.getPushPythonVersion())) >= 0) {
&& clientInfo.version.compareTo(parseVersion(switchDomain.getPushPythonVersion())) >= 0) {
return true;
} else if (ClientInfo.ClientType.C == clientInfo.type
&& clientInfo.version.compareTo(VersionUtil.parseVersion(switchDomain.getPushCVersion())) >= 0) {
&& clientInfo.version.compareTo(parseVersion(switchDomain.getPushCVersion())) >= 0) {
return true;
} else if (ClientInfo.ClientType.GO == clientInfo.type
&& clientInfo.version.compareTo(VersionUtil.parseVersion(switchDomain.getPushGoVersion())) >= 0) {
&& clientInfo.version.compareTo(parseVersion(switchDomain.getPushGoVersion())) >= 0) {
return true;
} else if (ClientInfo.ClientType.CSHARP == clientInfo.type
&& clientInfo.version.compareTo(VersionUtil.parseVersion(switchDomain.getPushCSharpVersion())) >= 0) {
&& clientInfo.version.compareTo(parseVersion(switchDomain.getPushCSharpVersion())) >= 0) {
return true;
}

return false;
}

private Version parseVersion(String version) {
return VersionUtil.parseVersion(version, null, null);
}

private static byte[] compressIfNecessary(byte[] dataBytes) throws IOException {
// enable compression when data is larger than 1KB
int maxDataSizeUncompress = 1024;
Expand Down
30 changes: 2 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,11 @@

<mysql-connector-java.version>8.0.28</mysql-connector-java.version>
<derby.version>10.14.2.0</derby.version>
<jackson-core.version>2.12.6</jackson-core.version>
<jackson-databind.version>2.12.7.1</jackson-databind.version>
<jackson.annotations.version>2.12.6</jackson.annotations.version>
<jackson-core-asl.version>1.9.13</jackson-core-asl.version>
<jjwt.version>0.11.2</jjwt.version>
<javatuples.version>1.2</javatuples.version>
<grpc-java.version>1.57.2</grpc-java.version>
<proto-google-common-protos.version>2.7.1</proto-google-common-protos.version>
<protobuf-java.version>3.21.11</protobuf-java.version>
<proto-google-common-protos.version>2.17.0</proto-google-common-protos.version>
<protobuf-java.version>3.22.3</protobuf-java.version>
<protoc-gen-grpc-java.version>${grpc-java.version}</protoc-gen-grpc-java.version>
<hessian.version>4.0.63</hessian.version>
<mockito-all.version>1.10.19</mockito-all.version>
Expand Down Expand Up @@ -901,28 +897,6 @@
</dependency>

<!-- Third-party libs -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-core.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.annotations.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>${jackson-core-asl.version}</version>
</dependency>

<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
Expand Down
10 changes: 3 additions & 7 deletions sys/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand All @@ -53,20 +53,16 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-custom-environment-plugin</artifactId>
Expand Down

0 comments on commit 0398733

Please sign in to comment.