Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
spring:
application:
name: business-service # 应用名,Seata 默认基于此生成事务组
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
name: business-service # 应用名,Seata 默认基于此生成事务组
name: nacos-config-test # 应用名,Seata 默认基于此生成事务组

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

This comment in Chinese states "Application name, Seata defaults to generating transaction group based on this", but this is a Nacos config test module without Seata dependencies. The comment is misleading and not relevant to the actual purpose of this test module. If Nacos-specific configuration documentation is needed, it should explain how the application name is used in Nacos config contexts.

Suggested change
name: business-service # 应用名,Seata 默认基于此生成事务组
name: business-service # 应用名 / serviceId,在 Nacos 注册与配置中使用

Copilot uses AI. Check for mistakes.

seata:
enabled: true # 启用 Seata
tx-service-group: ${spring.application.name}-tx-group # 可删除(默认行为)
Comment on lines +5 to +7
Copy link

Copilot AI Jan 7, 2026

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 uses AI. Check for mistakes.
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
tx-service-group: ${spring.application.name}-tx-group # 可删除(默认行为)

Copilot uses AI. Check for mistakes.

# 如果已配置 Nacos 作为注册中心和配置中心,以下 Seata 配置可完全省略!
Copy link

Copilot AI Jan 7, 2026

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 uses AI. Check for mistakes.
spring:
Copy link

Copilot AI Jan 7, 2026

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 uses AI. Check for mistakes.
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848 # Nacos 地址(全局共用)
username: nacos
password: nacos
config:
server-addr: 127.0.0.1:8848 # Nacos 地址(全局共用)
username: nacos
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
Comment on lines +20 to +37
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Loading