-
Notifications
You must be signed in to change notification settings - Fork 8.5k
通过设置默认属性来简化yml配置来删除冗余配置项目 #3986
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
base: 2023.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,37 @@ | ||||||||||||||||||||||||||||||||||||||||
| spring: | ||||||||||||||||||||||||||||||||||||||||
| application: | ||||||||||||||||||||||||||||||||||||||||
| name: business-service # 应用名,Seata 默认基于此生成事务组 | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
| name: business-service # 应用名,Seata 默认基于此生成事务组 | |
| name: business-service # 应用名 / serviceId,在 Nacos 注册与配置中使用 |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Seata configuration is being added to a Nacos config test module that has no Seata dependencies in its pom.xml. The module is specifically for testing Nacos configuration functionality (as evidenced by the test files like NacosConfigRefreshTest, NacosConfigurationTests, etc.). Adding Seata configuration here is misleading and doesn't align with the module's purpose. If the goal is to demonstrate Seata configuration simplification, this should be in a separate Seata-specific test module or example.
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states "可删除(默认行为)" (Can be deleted - default behavior), which suggests this line is optional/redundant. If this configuration truly represents default behavior and can be deleted, it should not be included in the example configuration file at all. Including optional configurations with notes that they can be deleted creates confusion and goes against the PR's stated goal of removing redundant configuration.
| tx-service-group: ${spring.application.name}-tx-group # 可删除(默认行为) |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment states "如果已配置 Nacos 作为注册中心和配置中心,以下 Seata 配置可完全省略!" (If Nacos is configured as registry and config center, the following Seata configuration can be completely omitted!). However, this is misleading because the Seata configuration section (lines 23-37) is already commented out. The comment suggests it's explaining what can be omitted, but it creates confusion about what is actually active configuration versus documentation. This entire documentation would be better suited for a separate example or documentation file rather than a test configuration.
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The YAML file has duplicate top-level 'spring' keys (lines 1 and 10). In YAML, duplicate keys at the same level will cause the first key to be overridden by the second one. This means the configuration at lines 1-3 (spring.application.name: business-service) will be lost. These configurations should be merged into a single 'spring' section.
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commented-out configuration section (lines 22-37) appears to be documentation rather than actual test configuration. Test configuration files should contain only the minimal, valid configuration needed to run the tests. Including large blocks of commented-out "example" configuration makes the file harder to maintain and understand. If the goal is to provide configuration examples, they should be in documentation files or separate example projects, not in test resource files.
| password: nacos | |
| # 完全删除以下冗余配置: | |
| # seata: | |
| # config: | |
| # type: nacos | |
| # nacos: | |
| # serverAddr: 127.0.0.1:8848 | |
| # dataId: "seata.properties" | |
| # username: nacos | |
| # password: nacos | |
| # registry: | |
| # type: nacos | |
| # nacos: | |
| # application: seata-server | |
| # server-addr: 127.0.0.1:8848 | |
| # username: nacos | |
| # password: nacos | |
| password: nacos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The application name 'business-service' is inappropriate for a Nacos configuration test module. This name suggests a business domain service rather than a test application. The existing test files use 'myTestService1' or similar test-oriented names. Consider using a name that clearly indicates this is a test application, such as 'nacos-config-test' to match the module's artifactId.