Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded third-party dependencies to the latest versions and fixed CVE vulnerabilities #34409

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

JoshuaChen
Copy link
Contributor

@JoshuaChen JoshuaChen commented Jan 20, 2025

Upgraded third-party dependencies to the latest versions and fixed CVE vulnerabilities


Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct 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.
  • I have updated the Release Notes of the current development version. For more details, see Update Release Note

Copy link
Member

@linghengqian linghengqian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed a bunch of suspicious issues. However, there are no separate issues for the related topics.

db-protocol/core/pom.xml Outdated Show resolved Hide resolved
@@ -38,7 +40,7 @@ class EncryptInsertSelectSupportedCheckerTest {
@Test
void assertIsCheck() {
InsertStatementContext sqlStatementContext = mock(InsertStatementContext.class, RETURNS_DEEP_STUBS);
when(sqlStatementContext.getSqlStatement().getInsertSelect().isPresent()).thenReturn(true);
when(sqlStatementContext.getSqlStatement().getInsertSelect()).thenReturn(Optional.of(mock(SubquerySegment.class)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Why does updating some third-party dependencies cause a large number of unit tests to change? Where is the original issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new version of mock will prompt that the thenReturn type is wrong, and Optional.of(mock(SubquerySegment.class)) is required to return

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This involves a problem. The new version of mockito does not support JDK8, so it makes no sense to do so.

pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
@JoshuaChen JoshuaChen marked this pull request as draft January 20, 2025 10:52
Copy link
Member

@linghengqian linghengqian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +126 to +129
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>*</artifactId>
</exclusion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<dependency>
            <groupId>org.apache.seata</groupId>
            <artifactId>seata-all</artifactId>
            <version>${seata.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.antlr</groupId>
                    <artifactId>antlr4-runtime</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-lang</groupId>
                    <artifactId>commons-lang</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-pool2</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-webmvc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Comment on lines +73 to +91
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>${commons-compress.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<dependency>
            <groupId>io.etcd</groupId>
            <artifactId>jetcd-test</artifactId>
            <version>${jetcd.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-compress</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>provided</scope>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <scope>provided</scope>
            <optional>true</optional>
</dependency>
  • The core reason is that MySQL JDBC Driver is a standard GPL. The FOSS exception clause of MySQL JDBC Driver is actually not paid attention to by ASF.

<zookeeper.version>3.9.2</zookeeper.version>
<audience-annotations.version>0.12.0</audience-annotations.version>
<audience-annotations.version>0.15.0</audience-annotations.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • org.apache.yetus:audience-annotations:0.12.0 is actually just a transitive dependency of org.apache.zookeeper:zookeeper:3.9.2.
  • And since org.apache.yetus:audience-annotations:0.14.0, the metadata provided by this dependency is invalid on JDK8, refer to https://issues.apache.org/jira/browse/YETUS-1132 . Why do you need to change the version of org.apache.yetus:audience-annotations?

<jetcd.version>0.7.7</jetcd.version>
<vertx.version>4.5.1</vertx.version>
<vertx.version>4.5.11</vertx.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Shardingsphere doesn't actually use vertx. io.vertx:vertx-grpc:4.5.1 is a transitive dependency of io.etcd:jetcd-grpc:0.7.7, why do we need to change the dependency tree of jetcd?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants