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

[ISSUE #8622] Properties has transformed NacosClientProperties #9356

Closed
wants to merge 7 commits into from

Conversation

onewe
Copy link
Collaborator

@onewe onewe commented Oct 20, 2022

relate: #8622

  • Support client logging read properties from the NacosClientProperties

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.

…Properties

- add NacosClientPropertiesLookup for log4j2
- add NacosClientPropertyAction for logback
- add a new constructor method to adapt NacosClientProperties for NacosNamingMaintainService
- add a new constructor method to adapt NacosClientProperties for NacosNamingService
- add a new constructor method to adapt NacosClientProperties for NacosConfigService
@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2022

Codecov Report

Merging #9356 (bbfc723) into develop (0bd589c) will decrease coverage by 0.11%.
The diff coverage is 66.09%.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #9356      +/-   ##
=============================================
- Coverage      44.07%   43.95%   -0.12%     
- Complexity      4871     4885      +14     
=============================================
  Files            914      917       +3     
  Lines          33155    33228      +73     
  Branches        3843     3847       +4     
=============================================
- Hits           14613    14607       -6     
- Misses         17119    17195      +76     
- Partials        1423     1426       +3     
Impacted Files Coverage Δ
...libaba/nacos/client/env/NacosClientProperties.java 100.00% <ø> (ø)
...ent/logging/logback/NacosClientPropertyAction.java 0.00% <0.00%> (ø)
...client/logging/logback/NacosJoranConfigurator.java 0.00% <0.00%> (ø)
...s/client/naming/core/ServiceInfoUpdateService.java 60.21% <ø> (ø)
...ient/naming/remote/gprc/NamingGrpcClientProxy.java 86.53% <ø> (ø)
...com/alibaba/nacos/client/utils/ValidatorUtils.java 70.00% <ø> (-20.00%) ⬇️
.../nacos/client/env/SearchablePropertiesWrapper.java 12.50% <12.50%> (ø)
...a/com/alibaba/nacos/client/utils/AppNameUtils.java 29.62% <14.28%> (ø)
...libaba/nacos/client/naming/NacosNamingService.java 88.15% <50.00%> (+0.07%) ⬆️
...ba/nacos/client/config/impl/ServerListManager.java 64.31% <66.66%> (-0.38%) ⬇️
... and 67 more

Continue to review full report at Codecov.

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

ServiceLoader<IConfigFilter> configFilters = ServiceLoader.load(IConfigFilter.class);
for (IConfigFilter configFilter : configFilters) {
configFilter.init(properties);
configFilter.init(compatibleProperties);
Copy link
Collaborator

Choose a reason for hiding this comment

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

能否转化为Properties? ConfigFilter是一个插件接口,最好不要改入参数

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

这个我转成一个兼容 Properties 的 wrapper. client/src/main/java/com/alibaba/nacos/client/env/SearchablePropertiesWrapper.java

onewe added a commit to onewe/nacos that referenced this pull request Nov 2, 2022
- Replace system.getProperties and system.getEnv with  NacosClientProperties
- remove address server controller IT

relate alibaba#9356
onewe added a commit to onewe/nacos that referenced this pull request Nov 2, 2022
- Replace system.getProperties and system.getEnv with  NacosClientProperties
- log4j and logback support reading properties from NacosClientProperties

relate alibaba#9356
onewe added a commit to onewe/nacos that referenced this pull request Nov 2, 2022
- Replace system.getProperties and system.getEnv with NacosClientProperties

relate alibaba#9356
onewe added a commit to onewe/nacos that referenced this pull request Nov 3, 2022
- Replace system.getProperties and system.getEnv with NacosClientProperties

relate alibaba#9356
KomachiSion pushed a commit that referenced this pull request Nov 3, 2022
* [ISSUE #8622] sub pr of 9356 - auth module

- Replace system.getProperties and system.getEnv with  NacosClientProperties
- remove address server controller IT

relate #9356

* [ISSUE #8622] rollback about app name

* [ISSUE #8622] remove unused import

* [ISSUE #8622] retry ci
KomachiSion pushed a commit that referenced this pull request Nov 3, 2022
- Replace system.getProperties and system.getEnv with NacosClientProperties

relate #9356
KomachiSion pushed a commit that referenced this pull request Nov 4, 2022
* [ISSUE #8622] sub pr of 9356 - logging module

- Replace system.getProperties and system.getEnv with  NacosClientProperties
- log4j and logback support reading properties from NacosClientProperties

relate #9356

* [ISSUE #8622] add unit tests for logging
@KomachiSion KomachiSion closed this Nov 4, 2022
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.

3 participants