alibaba / nacos

an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
https://nacos.io
Apache License 2.0
30.36k stars 12.86k forks source link

Refactor ConfigCache and related pathways ,uniformly use UTF-8 encoding for md5 fields #12876

Open Sunrisea opened 5 days ago

Sunrisea commented 5 days ago

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

What is the purpose of the change

Refactor ConfigCache and related pathways ,uniformly use UTF-8 encoding for md5 fields. Utilize the SPI mechanism in related pathways and methods to ensure extensibility for support of other types of encoding. Fix test.

Brief changelog

Create the ConfigCacheFactory interface to handle the creation of ConfigCache instances. Create the Md5PostProcessor interface to handle the md5 dump of ConfigCache. Create the Md5Comparator interface. Utilize the SPI (Service Provider Interface) mechanism in related pathways and methods to ensure extensibility for support of other types of encoding, and implement the default handling methods for UTF-8 encoded md5 values.

Verifying this change

XXXX

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

github-actions[bot] commented 5 days ago

Thanks for your this PR. :pray: Please check again for your PR changes whether contains any usage/api/configuration change such as Add new API, Add new configuration, Change default value of configuration. If so, please add or update documents(markdown type) in docs/next/ for repository nacos-group/nacos-group.github.io


感谢您提交的PR。 :pray: 请再次查看您的PR内容,确认是否包含任何使用方式/API/配置参数的变更,如:新增API新增配置参数修改默认配置等操作。 如果是,请确保在提交之前,在仓库nacos-group/nacos-group.github.io中的docs/next/目录下添加或更新文档(markdown格式)。

wuyfee commented 5 days ago

$\color{red}{FAILURE}$ DETAILS ✅ - docker: success ✅ - deploy (standalone & cluster & standalone_auth): success ✅ - e2e-java-test (standalone & cluster & standalone_auth): success ✅ - e2e-go-test (standalone & cluster): success ❌ - e2e-cpp-test (standalone & cluster): failure ✅ - e2e-csharp-test (standalone & cluster): success ✅ - e2e-nodejs-test (standalone & cluster): success ✅ - e2e-python-test (standalone & cluster): success ✅ - clean (standalone & cluster & standalone_auth): success

wuyfee commented 5 days ago

$\color{green}{SUCCESS}$ DETAILS ✅ - docker: success ✅ - deploy (standalone & cluster & standalone_auth): success ✅ - e2e-java-test (standalone & cluster & standalone_auth): success ✅ - e2e-go-test (standalone & cluster): success ✅ - e2e-cpp-test (standalone & cluster): success ✅ - e2e-csharp-test (standalone & cluster): success ✅ - e2e-nodejs-test (standalone & cluster): success ✅ - e2e-python-test (standalone & cluster): success ✅ - clean (standalone & cluster & standalone_auth): success

wuyfee commented 5 days ago

$\color{green}{SUCCESS}$ DETAILS ✅ - docker: success ✅ - deploy (standalone & cluster & standalone_auth): success ✅ - e2e-java-test (standalone & cluster & standalone_auth): success ✅ - e2e-go-test (standalone & cluster): success ✅ - e2e-cpp-test (standalone & cluster): success ✅ - e2e-csharp-test (standalone & cluster): success ✅ - e2e-nodejs-test (standalone & cluster): success ✅ - e2e-python-test (standalone & cluster): success ✅ - clean (standalone & cluster & standalone_auth): success

wuyfee commented 5 days ago

$\color{green}{SUCCESS}$ DETAILS ✅ - docker: success ✅ - deploy (standalone & cluster & standalone_auth): success ✅ - e2e-java-test (standalone & cluster & standalone_auth): success ✅ - e2e-go-test (standalone & cluster): success ✅ - e2e-cpp-test (standalone & cluster): success ✅ - e2e-csharp-test (standalone & cluster): success ✅ - e2e-nodejs-test (standalone & cluster): success ✅ - e2e-python-test (standalone & cluster): success ✅ - clean (standalone & cluster & standalone_auth): success

wuyfee commented 5 days ago

$\color{green}{SUCCESS}$ DETAILS ✅ - docker: success ✅ - deploy (standalone & cluster & standalone_auth): success ✅ - e2e-java-test (standalone & cluster & standalone_auth): success ✅ - e2e-go-test (standalone & cluster): success ✅ - e2e-cpp-test (standalone & cluster): success ✅ - e2e-csharp-test (standalone & cluster): success ✅ - e2e-nodejs-test (standalone & cluster): success ✅ - e2e-python-test (standalone & cluster): success ✅ - clean (standalone & cluster & standalone_auth): success

wuyfee commented 5 days ago

$\color{green}{SUCCESS}$ DETAILS ✅ - docker: success ✅ - deploy (standalone & cluster & standalone_auth): success ✅ - e2e-java-test (standalone & cluster & standalone_auth): success ✅ - e2e-go-test (standalone & cluster): success ✅ - e2e-cpp-test (standalone & cluster): success ✅ - e2e-csharp-test (standalone & cluster): success ✅ - e2e-nodejs-test (standalone & cluster): success ✅ - e2e-python-test (standalone & cluster): success ✅ - clean (standalone & cluster & standalone_auth): success

wuyfee commented 5 days ago

$\color{green}{SUCCESS}$ DETAILS ✅ - docker: success ✅ - deploy (standalone & cluster & standalone_auth): success ✅ - e2e-java-test (standalone & cluster & standalone_auth): success ✅ - e2e-go-test (standalone & cluster): success ✅ - e2e-cpp-test (standalone & cluster): success ✅ - e2e-csharp-test (standalone & cluster): success ✅ - e2e-nodejs-test (standalone & cluster): success ✅ - e2e-python-test (standalone & cluster): success ✅ - clean (standalone & cluster & standalone_auth): success

codecov-commenter commented 5 days ago

Codecov Report

Attention: Patch coverage is 83.07692% with 22 lines in your changes missing coverage. Please review.

Project coverage is 72.28%. Comparing base (aeaaded) to head (3042bf2). Report is 7 commits behind head on develop.

Files with missing lines Patch % Lines
...alibaba/nacos/config/server/model/ConfigCache.java 37.50% 5 Missing :warning:
...onfig/server/model/ConfigCacheFactoryDelegate.java 84.37% 3 Missing and 2 partials :warning:
...server/model/ConfigCachePostProcessorDelegate.java 79.16% 3 Missing and 2 partials :warning:
...cos/config/server/utils/Md5ComparatorDelegate.java 78.26% 3 Missing and 2 partials :warning:
...acos/config/server/service/ConfigCacheService.java 86.66% 1 Missing and 1 partial :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/alibaba/nacos/pull/12876/graphs/tree.svg?width=650&height=150&src=pr&token=l4XELZqush&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba)](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba) ```diff @@ Coverage Diff @@ ## develop #12876 +/- ## ============================================= + Coverage 72.17% 72.28% +0.11% - Complexity 9792 9855 +63 ============================================= Files 1283 1293 +10 Lines 41387 41522 +135 Branches 4374 4384 +10 ============================================= + Hits 29872 30016 +144 + Misses 9408 9398 -10 - Partials 2107 2108 +1 ``` | [Files with missing lines](https://app.codecov.io/gh/alibaba/nacos/pull/12876?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba) | Coverage Δ | | |---|---|---| | [...server/configuration/NacosConfigConfiguration.java](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree&filepath=config%2Fsrc%2Fmain%2Fjava%2Fcom%2Falibaba%2Fnacos%2Fconfig%2Fserver%2Fconfiguration%2FNacosConfigConfiguration.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba#diff-Y29uZmlnL3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvbmFjb3MvY29uZmlnL3NlcnZlci9jb25maWd1cmF0aW9uL05hY29zQ29uZmlnQ29uZmlndXJhdGlvbi5qYXZh) | `0.00% <ø> (ø)` | | | [...s/config/server/controller/ConfigServletInner.java](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree&filepath=config%2Fsrc%2Fmain%2Fjava%2Fcom%2Falibaba%2Fnacos%2Fconfig%2Fserver%2Fcontroller%2FConfigServletInner.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba#diff-Y29uZmlnL3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvbmFjb3MvY29uZmlnL3NlcnZlci9jb250cm9sbGVyL0NvbmZpZ1NlcnZsZXRJbm5lci5qYXZh) | `85.95% <100.00%> (-0.12%)` | :arrow_down: | | [...m/alibaba/nacos/config/server/model/CacheItem.java](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree&filepath=config%2Fsrc%2Fmain%2Fjava%2Fcom%2Falibaba%2Fnacos%2Fconfig%2Fserver%2Fmodel%2FCacheItem.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba#diff-Y29uZmlnL3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvbmFjb3MvY29uZmlnL3NlcnZlci9tb2RlbC9DYWNoZUl0ZW0uamF2YQ==) | `84.21% <100.00%> (ø)` | | | [...aba/nacos/config/server/model/ConfigCacheGray.java](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree&filepath=config%2Fsrc%2Fmain%2Fjava%2Fcom%2Falibaba%2Fnacos%2Fconfig%2Fserver%2Fmodel%2FConfigCacheGray.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba#diff-Y29uZmlnL3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvbmFjb3MvY29uZmlnL3NlcnZlci9tb2RlbC9Db25maWdDYWNoZUdyYXkuamF2YQ==) | `55.55% <100.00%> (+10.10%)` | :arrow_up: | | [...s/config/server/model/NacosConfigCacheFactory.java](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree&filepath=config%2Fsrc%2Fmain%2Fjava%2Fcom%2Falibaba%2Fnacos%2Fconfig%2Fserver%2Fmodel%2FNacosConfigCacheFactory.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba#diff-Y29uZmlnL3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvbmFjb3MvY29uZmlnL3NlcnZlci9tb2RlbC9OYWNvc0NvbmZpZ0NhY2hlRmFjdG9yeS5qYXZh) | `100.00% <100.00%> (ø)` | | | [...ig/server/model/NacosConfigCachePostProcessor.java](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree&filepath=config%2Fsrc%2Fmain%2Fjava%2Fcom%2Falibaba%2Fnacos%2Fconfig%2Fserver%2Fmodel%2FNacosConfigCachePostProcessor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba#diff-Y29uZmlnL3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvbmFjb3MvY29uZmlnL3NlcnZlci9tb2RlbC9OYWNvc0NvbmZpZ0NhY2hlUG9zdFByb2Nlc3Nvci5qYXZh) | `100.00% <100.00%> (ø)` | | | [...onfig/server/remote/ConfigQueryRequestHandler.java](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree&filepath=config%2Fsrc%2Fmain%2Fjava%2Fcom%2Falibaba%2Fnacos%2Fconfig%2Fserver%2Fremote%2FConfigQueryRequestHandler.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba#diff-Y29uZmlnL3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvbmFjb3MvY29uZmlnL3NlcnZlci9yZW1vdGUvQ29uZmlnUXVlcnlSZXF1ZXN0SGFuZGxlci5qYXZh) | `86.41% <100.00%> (-0.17%)` | :arrow_down: | | [...com/alibaba/nacos/config/server/utils/MD5Util.java](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree&filepath=config%2Fsrc%2Fmain%2Fjava%2Fcom%2Falibaba%2Fnacos%2Fconfig%2Fserver%2Futils%2FMD5Util.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba#diff-Y29uZmlnL3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvbmFjb3MvY29uZmlnL3NlcnZlci91dGlscy9NRDVVdGlsLmphdmE=) | `80.30% <100.00%> (-2.60%)` | :arrow_down: | | [.../nacos/config/server/utils/NacosMd5Comparator.java](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree&filepath=config%2Fsrc%2Fmain%2Fjava%2Fcom%2Falibaba%2Fnacos%2Fconfig%2Fserver%2Futils%2FNacosMd5Comparator.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba#diff-Y29uZmlnL3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvbmFjb3MvY29uZmlnL3NlcnZlci91dGlscy9OYWNvc01kNUNvbXBhcmF0b3IuamF2YQ==) | `100.00% <100.00%> (ø)` | | | [...acos/config/server/service/ConfigCacheService.java](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree&filepath=config%2Fsrc%2Fmain%2Fjava%2Fcom%2Falibaba%2Fnacos%2Fconfig%2Fserver%2Fservice%2FConfigCacheService.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba#diff-Y29uZmlnL3NyYy9tYWluL2phdmEvY29tL2FsaWJhYmEvbmFjb3MvY29uZmlnL3NlcnZlci9zZXJ2aWNlL0NvbmZpZ0NhY2hlU2VydmljZS5qYXZh) | `74.35% <86.66%> (+0.33%)` | :arrow_up: | | ... and [4 more](https://app.codecov.io/gh/alibaba/nacos/pull/12876?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba) | | ... and [15 files with indirect coverage changes](https://app.codecov.io/gh/alibaba/nacos/pull/12876/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/alibaba/nacos/pull/12876?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/alibaba/nacos/pull/12876?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba). Last update [aeaaded...3042bf2](https://app.codecov.io/gh/alibaba/nacos/pull/12876?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba).

🚨 Try these New Features:

wuyfee commented 5 days ago

$\color{green}{SUCCESS}$ DETAILS ✅ - docker: success ✅ - deploy (standalone & cluster & standalone_auth): success ✅ - e2e-java-test (standalone & cluster & standalone_auth): success ✅ - e2e-go-test (standalone & cluster): success ✅ - e2e-cpp-test (standalone & cluster): success ✅ - e2e-csharp-test (standalone & cluster): success ✅ - e2e-nodejs-test (standalone & cluster): success ✅ - e2e-python-test (standalone & cluster): success ✅ - clean (standalone & cluster & standalone_auth): success

wuyfee commented 1 day ago

$\color{green}{SUCCESS}$ DETAILS ✅ - docker: success ✅ - deploy (standalone & cluster & standalone_auth): success ✅ - e2e-java-test (standalone & cluster & standalone_auth): success ✅ - e2e-go-test (standalone & cluster): success ✅ - e2e-cpp-test (standalone & cluster): success ✅ - e2e-csharp-test (standalone & cluster): success ✅ - e2e-nodejs-test (standalone & cluster): success ✅ - e2e-python-test (standalone & cluster): success ✅ - clean (standalone & cluster & standalone_auth): success