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

fix:add param for ConfigInfoMapperByMySql#findAllConfigInfoBaseFetchRows #11883

Merged
merged 4 commits into from
Apr 2, 2024

Conversation

Tangmingyao1998
Copy link
Contributor

Please do not create a Pull Request without creating an issue first.

What is the purpose of the change

link #11859

Brief changelog

XX

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.

Copy link
Collaborator

@KomachiSion KomachiSion left a comment

Choose a reason for hiding this comment

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

wrong fix way, please keep the ? to avoid SQL security problem.

@publicize-y
Copy link
Contributor

I have found SQL security issues elsewhere, and I will fix them together

@publicize-y
Copy link
Contributor

微信截图_20240401150249
Do I need to deal with SQL security issues in all these places @KomachiSion

@publicize-y
Copy link
Contributor

other mapper class all have this problem

@publicize-y
Copy link
Contributor

For pagination parameters, basically no ? are retained to avoid SQL security problem

@KomachiSion
Copy link
Collaborator

These implementation all has problem, we should add a new issue to mark the problem and fix them together.

First to fix this issue, and please @publicize-y to create new issue to describe this after PR merged.

@KomachiSion
Copy link
Collaborator

@publicize-y CI and IT can't pass, maybe some check can't pass.

And more thing which you shou add some UT for your change codes.

@publicize-y
Copy link
Contributor

ok,i get it

@publicize-y
Copy link
Contributor

@publicize-y CI and IT can't pass, maybe some check can't pass.

And more thing which you shou add some UT for your change codes.

There is already a unit test, do I need to write another one
微信截图_20240401175449

@publicize-y
Copy link
Contributor

@publicize-y CI and IT can't pass, maybe some check can't pass.
And more thing which you shou add some UT for your change codes.

There is already a unit test, do I need to write another one 微信截图_20240401175449

and the logic seems to not require modification

@KomachiSion
Copy link
Collaborator

@publicize-y CI and IT can't pass, maybe some check can't pass.
And more thing which you shou add some UT for your change codes.

There is already a unit test, do I need to write another one 微信截图_20240401175449

and the logic seems to not require modification

If UT has exist and covered your method, UT might can't pass, because your code change the return value for this method.

@KomachiSion
Copy link
Collaborator

@publicize-y CI and IT can't pass, maybe some check can't pass.
And more thing which you shou add some UT for your change codes.

There is already a unit test, do I need to write another one 微信截图_20240401175449

and the logic seems to not require modification

If UT has exist and covered your method, UT might can't pass, because your code change the return value for this method.

Ignore it , I found you has change the UT case.

plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySqlTest.java

@KomachiSion
Copy link
Collaborator

CI still not pass

you can use mvn -B clean package apache-rat:check findbugs:findbugs -DskipTests -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn do check in local env first.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.58%. Comparing base (a7d9ef2) to head (3390c0e).
Report is 8 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop   #11883      +/-   ##
=============================================
+ Coverage      68.42%   68.58%   +0.15%     
- Complexity      8989     9031      +42     
=============================================
  Files           1239     1239              
  Lines          40573    40613      +40     
  Branches        4317     4322       +5     
=============================================
+ Hits           27761    27853      +92     
+ Misses         10821    10760      -61     
- Partials        1991     2000       +9     
Files Coverage Δ
...datasource/impl/mysql/ConfigInfoMapperByMySql.java 68.93% <100.00%> (+0.47%) ⬆️

... and 22 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a1f0c2...3390c0e. Read the comment docs.

@KomachiSion KomachiSion merged commit facf4c8 into alibaba:develop Apr 2, 2024
7 checks passed
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.

4 participants