<feature>[dpu-bm2]: support dpu baremetal2 instance#3482
<feature>[dpu-bm2]: support dpu baremetal2 instance#3482zstack-robot-1 wants to merge 1 commit into5.5.12from
Conversation
Walkthrough将裸金属2型扩展为支持 DPU(baremetal2Dpu):更新主机管理器的架构检查条件以基于集群类型,新增 DPU 相关数据库表,注册新的集群 hypervisor 类型,扩展测试辅助方法并添加多项错误码常量。 Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant HostMgr as HostManagerImpl
participant ClusterSvc as Cluster (DB/Service)
participant ArchCheck as ArchValidator
Client->>HostMgr: 请求添加/连接主机
HostMgr->>ClusterSvc: 查询 cluster.getHypervisorType()
ClusterSvc-->>HostMgr: 返回 hypervisorType
HostMgr->>ArchCheck: 基于 cluster hypervisorType 决定是否跳过架构校验
alt cluster in SKIP list
ArchCheck-->>HostMgr: 跳过校验
else
ArchCheck-->>HostMgr: 执行校验
end
HostMgr-->>Client: 返回结果
代码审查工作量估计🎯 4 (复杂) | ⏱️ ~60 分钟 庆祝诗
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.41.1)utils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.javaComment |
support dpu baremetal2 instance Resolves/Related: ZSTAC-12345 Change-Id: I626d637a7168656a6c726c6769777a726e616973
5718b67 to
2318947
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
header/src/main/java/org/zstack/header/cluster/APICreateClusterMsg.java (1)
68-73: 建议同步更新@choices注释,避免与validValues不一致。
Line 73已支持baremetal2/baremetal2Dpu/xdragon,但上方@choices仍是旧列表,建议补齐以免误导。建议修改
/** * `@desc` see field 'hypervisorType' of :ref:`ClusterInventory` for details * `@choices` - KVM * - Simulator * - baremetal + * - baremetal2 + * - xdragon + * - baremetal2Dpu */ `@APIParam`(validValues = {"KVM", "Simulator", "baremetal", "baremetal2", "xdragon", "baremetal2Dpu"}) private String hypervisorType;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@header/src/main/java/org/zstack/header/cluster/APICreateClusterMsg.java` around lines 68 - 73, Update the `@choices` Javadoc above APICreateClusterMsg to match the `@APIParam` validValues by adding the missing entries "baremetal2", "baremetal2Dpu", and "xdragon" so the documentation and choices list for the ClusterInventory hypervisorType remain consistent with the validValues declaration in APICreateClusterMsg.conf/db/upgrade/V5.5.12__schema.sql (1)
6-6:PRIMARY KEY已保证唯一性,UNIQUE约束可去重Line 6 与 Line 15 的
uuid同时声明PRIMARY KEY和UNIQUE,UNIQUE在这里是冗余约束,建议移除以减少无效定义。建议修复(示例)
-`uuid` varchar(32) NOT NULL UNIQUE, +`uuid` varchar(32) NOT NULL, @@ -`uuid` varchar(32) NOT NULL UNIQUE, +`uuid` varchar(32) NOT NULL,Also applies to: 15-15
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@conf/db/upgrade/V5.5.12__schema.sql` at line 6, 在迁移脚本中找到同时将 uuid 声明为 PRIMARY KEY 和 UNIQUE 的列定义(例如出现的片段 "uuid varchar(32) NOT NULL UNIQUE"),删除冗余的 UNIQUE 约束只保留 NOT NULL/PRIMARY KEY(即将 "uuid varchar(32) NOT NULL UNIQUE" 改为 "uuid varchar(32) NOT NULL" 或直接用 "uuid varchar(32) PRIMARY KEY"),在脚本中对所有出现该重复约束的 uuid 定义都做相同修改以去掉无效 UNIQUE。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@conf/db/upgrade/V5.5.12__schema.sql`:
- Around line 10-11: The foreign key REFERENCES in the CONSTRAINTs
fkBareMetal2DpuChassisVOChassisVO and fkBareMetal2DpuChassisVOHostEO currently
use unqualified table names; update them to fully-qualified schema references
(e.g. use zstack.`BareMetal2ChassisVO` and zstack.`HostEO`) so the SQL in
V5.5.12__schema.sql does not rely on the current default schema; apply the same
change to the other occurrences called out (around the other REFERENCES on lines
noted, e.g. any plain `TableName` in that file such as the ones near lines 20-21
and 31-35) to keep the upgrade scripts consistent.
- Around line 24-36: The ALTER statements on table BareMetal2InstanceVO drop and
re-add foreign keys fkBareMetal2InstanceVOGatewayVO and
fkBareMetal2InstanceVOGatewayVO1 without idempotency checks, which will fail if
constraints are already absent/present; modify the migration to query
information_schema.TABLE_CONSTRAINTS for BareMetal2InstanceVO and only EXECUTE
dynamic DROP FOREIGN KEY when the constraint exists and only EXECUTE ADD
CONSTRAINT when it does not exist (use the constraint names
fkBareMetal2InstanceVOGatewayVO and fkBareMetal2InstanceVOGatewayVO1 and
reference HostEO(uuid) with ON DELETE SET NULL), ensuring the script is safe to
run repeatedly and in branch states.
---
Nitpick comments:
In `@conf/db/upgrade/V5.5.12__schema.sql`:
- Line 6: 在迁移脚本中找到同时将 uuid 声明为 PRIMARY KEY 和 UNIQUE 的列定义(例如出现的片段 "uuid
varchar(32) NOT NULL UNIQUE"),删除冗余的 UNIQUE 约束只保留 NOT NULL/PRIMARY KEY(即将 "uuid
varchar(32) NOT NULL UNIQUE" 改为 "uuid varchar(32) NOT NULL" 或直接用 "uuid
varchar(32) PRIMARY KEY"),在脚本中对所有出现该重复约束的 uuid 定义都做相同修改以去掉无效 UNIQUE。
In `@header/src/main/java/org/zstack/header/cluster/APICreateClusterMsg.java`:
- Around line 68-73: Update the `@choices` Javadoc above APICreateClusterMsg to
match the `@APIParam` validValues by adding the missing entries "baremetal2",
"baremetal2Dpu", and "xdragon" so the documentation and choices list for the
ClusterInventory hypervisorType remain consistent with the validValues
declaration in APICreateClusterMsg.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml)
Review profile: CHILL
Plan: Pro
Run ID: 562e6ff3-9483-4afd-acdf-6c9c83e0adb2
⛔ Files ignored due to path filters (7)
sdk/src/main/java/SourceClassMap.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/AddBareMetal2DpuChassisAction.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/BareMetal2DpuChassisInventory.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/BareMetal2DpuHostInventory.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/CreateBareMetal2InstanceAction.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/CreateClusterAction.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/StartBareMetal2InstanceAction.javais excluded by!sdk/**
📒 Files selected for processing (6)
compute/src/main/java/org/zstack/compute/host/HostManagerImpl.javaconf/db/upgrade/V5.5.12__schema.sqlheader/src/main/java/org/zstack/header/cluster/APICreateClusterMsg.javaheader/src/main/java/org/zstack/header/cluster/APICreateClusterMsgDoc_zh_cn.groovytestlib/src/main/java/org/zstack/testlib/ApiHelper.groovyutils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java
| CONSTRAINT `fkBareMetal2DpuChassisVOChassisVO` FOREIGN KEY (`uuid`) REFERENCES `BareMetal2ChassisVO` (`uuid`) ON DELETE CASCADE, | ||
| CONSTRAINT `fkBareMetal2DpuChassisVOHostEO` FOREIGN KEY (`hostUuid`) REFERENCES `HostEO` (`uuid`) ON DELETE SET NULL |
There was a problem hiding this comment.
建议统一使用 zstack.表名 的 schema 全限定引用
当前外键 REFERENCES 使用了未带 schema 的表名;在 upgrade 目录建议统一为 zstack....,降低上下文 schema 依赖并保持脚本风格一致。
建议修复(示例)
-CONSTRAINT `fkBareMetal2DpuChassisVOChassisVO` FOREIGN KEY (`uuid`) REFERENCES `BareMetal2ChassisVO` (`uuid`) ON DELETE CASCADE,
-CONSTRAINT `fkBareMetal2DpuChassisVOHostEO` FOREIGN KEY (`hostUuid`) REFERENCES `HostEO` (`uuid`) ON DELETE SET NULL
+CONSTRAINT `fkBareMetal2DpuChassisVOChassisVO` FOREIGN KEY (`uuid`) REFERENCES `zstack`.`BareMetal2ChassisVO` (`uuid`) ON DELETE CASCADE,
+CONSTRAINT `fkBareMetal2DpuChassisVOHostEO` FOREIGN KEY (`hostUuid`) REFERENCES `zstack`.`HostEO` (`uuid`) ON DELETE SET NULL
@@
-CONSTRAINT `fkBareMetal2DpuHostVOHostVO` FOREIGN KEY (`uuid`) REFERENCES `HostEO` (`uuid`) ON DELETE CASCADE,
-CONSTRAINT `fkBareMetal2DpuHostVOChassisVO` FOREIGN KEY (`chassisUuid`) REFERENCES `BareMetal2DpuChassisVO` (`uuid`) ON DELETE CASCADE
+CONSTRAINT `fkBareMetal2DpuHostVOHostVO` FOREIGN KEY (`uuid`) REFERENCES `zstack`.`HostEO` (`uuid`) ON DELETE CASCADE,
+CONSTRAINT `fkBareMetal2DpuHostVOChassisVO` FOREIGN KEY (`chassisUuid`) REFERENCES `zstack`.`BareMetal2DpuChassisVO` (`uuid`) ON DELETE CASCADE
@@
-REFERENCES `HostEO` (`uuid`)
+REFERENCES `zstack`.`HostEO` (`uuid`)
@@
-REFERENCES `HostEO` (`uuid`)
+REFERENCES `zstack`.`HostEO` (`uuid`)Based on learnings: “在 conf/db/upgrade 下继续使用 TABLE_SCHEMA = 'zstack' 并以 zstack.`Table` 方式引用表,可在该目录通用。”
Also applies to: 20-21, 31-35
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@conf/db/upgrade/V5.5.12__schema.sql` around lines 10 - 11, The foreign key
REFERENCES in the CONSTRAINTs fkBareMetal2DpuChassisVOChassisVO and
fkBareMetal2DpuChassisVOHostEO currently use unqualified table names; update
them to fully-qualified schema references (e.g. use zstack.`BareMetal2ChassisVO`
and zstack.`HostEO`) so the SQL in V5.5.12__schema.sql does not rely on the
current default schema; apply the same change to the other occurrences called
out (around the other REFERENCES on lines noted, e.g. any plain `TableName` in
that file such as the ones near lines 20-21 and 31-35) to keep the upgrade
scripts consistent.
conf/db/upgrade/V5.5.12__schema.sql
Outdated
| ALTER TABLE `zstack`.`BareMetal2InstanceVO` | ||
| DROP FOREIGN KEY `fkBareMetal2InstanceVOGatewayVO`, | ||
| DROP FOREIGN KEY `fkBareMetal2InstanceVOGatewayVO1`; | ||
|
|
||
| ALTER TABLE `zstack`.`BareMetal2InstanceVO` | ||
| ADD CONSTRAINT `fkBareMetal2InstanceVOGatewayVO` | ||
| FOREIGN KEY (`gatewayUuid`) | ||
| REFERENCES `HostEO` (`uuid`) | ||
| ON DELETE SET NULL, | ||
| ADD CONSTRAINT `fkBareMetal2InstanceVOGatewayVO1` | ||
| FOREIGN KEY (`lastGatewayUuid`) | ||
| REFERENCES `HostEO` (`uuid`) | ||
| ON DELETE SET NULL; |
There was a problem hiding this comment.
外键变更缺少幂等保护,升级脚本在分支库状态下可能中断
Line 24-36 直接 DROP FOREIGN KEY / ADD CONSTRAINT,当约束不存在或已存在时会报错,升级流程会被中断。建议基于 information_schema.TABLE_CONSTRAINTS 先判断再执行动态 SQL。
建议修复(示例)
-ALTER TABLE `zstack`.`BareMetal2InstanceVO`
-DROP FOREIGN KEY `fkBareMetal2InstanceVOGatewayVO`,
-DROP FOREIGN KEY `fkBareMetal2InstanceVOGatewayVO1`;
-
-ALTER TABLE `zstack`.`BareMetal2InstanceVO`
- ADD CONSTRAINT `fkBareMetal2InstanceVOGatewayVO`
- FOREIGN KEY (`gatewayUuid`)
- REFERENCES `HostEO` (`uuid`)
- ON DELETE SET NULL,
- ADD CONSTRAINT `fkBareMetal2InstanceVOGatewayVO1`
- FOREIGN KEY (`lastGatewayUuid`)
- REFERENCES `HostEO` (`uuid`)
- ON DELETE SET NULL;
+SET `@schema` := 'zstack';
+SET `@tbl` := 'BareMetal2InstanceVO';
+
+SELECT COUNT(1) INTO `@fk1_exists`
+FROM information_schema.TABLE_CONSTRAINTS
+WHERE CONSTRAINT_SCHEMA = `@schema`
+ AND TABLE_NAME = `@tbl`
+ AND CONSTRAINT_NAME = 'fkBareMetal2InstanceVOGatewayVO'
+ AND CONSTRAINT_TYPE = 'FOREIGN KEY';
+SET `@sql` := IF(`@fk1_exists` > 0,
+ 'ALTER TABLE `zstack`.`BareMetal2InstanceVO` DROP FOREIGN KEY `fkBareMetal2InstanceVOGatewayVO`',
+ 'SELECT 1');
+PREPARE stmt FROM `@sql`; EXECUTE stmt; DEALLOCATE PREPARE stmt;
+
+SELECT COUNT(1) INTO `@fk2_exists`
+FROM information_schema.TABLE_CONSTRAINTS
+WHERE CONSTRAINT_SCHEMA = `@schema`
+ AND TABLE_NAME = `@tbl`
+ AND CONSTRAINT_NAME = 'fkBareMetal2InstanceVOGatewayVO1'
+ AND CONSTRAINT_TYPE = 'FOREIGN KEY';
+SET `@sql` := IF(`@fk2_exists` > 0,
+ 'ALTER TABLE `zstack`.`BareMetal2InstanceVO` DROP FOREIGN KEY `fkBareMetal2InstanceVOGatewayVO1`',
+ 'SELECT 1');
+PREPARE stmt FROM `@sql`; EXECUTE stmt; DEALLOCATE PREPARE stmt;
+
+SELECT COUNT(1) INTO `@fk1_new_exists`
+FROM information_schema.TABLE_CONSTRAINTS
+WHERE CONSTRAINT_SCHEMA = `@schema`
+ AND TABLE_NAME = `@tbl`
+ AND CONSTRAINT_NAME = 'fkBareMetal2InstanceVOGatewayVO'
+ AND CONSTRAINT_TYPE = 'FOREIGN KEY';
+SET `@sql` := IF(`@fk1_new_exists` = 0,
+ 'ALTER TABLE `zstack`.`BareMetal2InstanceVO`
+ ADD CONSTRAINT `fkBareMetal2InstanceVOGatewayVO`
+ FOREIGN KEY (`gatewayUuid`) REFERENCES `zstack`.`HostEO` (`uuid`) ON DELETE SET NULL',
+ 'SELECT 1');
+PREPARE stmt FROM `@sql`; EXECUTE stmt; DEALLOCATE PREPARE stmt;
+
+SELECT COUNT(1) INTO `@fk2_new_exists`
+FROM information_schema.TABLE_CONSTRAINTS
+WHERE CONSTRAINT_SCHEMA = `@schema`
+ AND TABLE_NAME = `@tbl`
+ AND CONSTRAINT_NAME = 'fkBareMetal2InstanceVOGatewayVO1'
+ AND CONSTRAINT_TYPE = 'FOREIGN KEY';
+SET `@sql` := IF(`@fk2_new_exists` = 0,
+ 'ALTER TABLE `zstack`.`BareMetal2InstanceVO`
+ ADD CONSTRAINT `fkBareMetal2InstanceVOGatewayVO1`
+ FOREIGN KEY (`lastGatewayUuid`) REFERENCES `zstack`.`HostEO` (`uuid`) ON DELETE SET NULL',
+ 'SELECT 1');
+PREPARE stmt FROM `@sql`; EXECUTE stmt; DEALLOCATE PREPARE stmt;Based on learnings: “ZStack 数据库升级脚本…需要通过 information_schema 检查表和约束的存在性来确保脚本可以安全重复执行。”
As per coding guidelines: “Upgrading scene has been carefully handled”.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ALTER TABLE `zstack`.`BareMetal2InstanceVO` | |
| DROP FOREIGN KEY `fkBareMetal2InstanceVOGatewayVO`, | |
| DROP FOREIGN KEY `fkBareMetal2InstanceVOGatewayVO1`; | |
| ALTER TABLE `zstack`.`BareMetal2InstanceVO` | |
| ADD CONSTRAINT `fkBareMetal2InstanceVOGatewayVO` | |
| FOREIGN KEY (`gatewayUuid`) | |
| REFERENCES `HostEO` (`uuid`) | |
| ON DELETE SET NULL, | |
| ADD CONSTRAINT `fkBareMetal2InstanceVOGatewayVO1` | |
| FOREIGN KEY (`lastGatewayUuid`) | |
| REFERENCES `HostEO` (`uuid`) | |
| ON DELETE SET NULL; | |
| SET `@schema` := 'zstack'; | |
| SET `@tbl` := 'BareMetal2InstanceVO'; | |
| SELECT COUNT(1) INTO `@fk1_exists` | |
| FROM information_schema.TABLE_CONSTRAINTS | |
| WHERE CONSTRAINT_SCHEMA = `@schema` | |
| AND TABLE_NAME = `@tbl` | |
| AND CONSTRAINT_NAME = 'fkBareMetal2InstanceVOGatewayVO' | |
| AND CONSTRAINT_TYPE = 'FOREIGN KEY'; | |
| SET `@sql` := IF(`@fk1_exists` > 0, | |
| 'ALTER TABLE `zstack`.`BareMetal2InstanceVO` DROP FOREIGN KEY `fkBareMetal2InstanceVOGatewayVO`', | |
| 'SELECT 1'); | |
| PREPARE stmt FROM `@sql`; EXECUTE stmt; DEALLOCATE PREPARE stmt; | |
| SELECT COUNT(1) INTO `@fk2_exists` | |
| FROM information_schema.TABLE_CONSTRAINTS | |
| WHERE CONSTRAINT_SCHEMA = `@schema` | |
| AND TABLE_NAME = `@tbl` | |
| AND CONSTRAINT_NAME = 'fkBareMetal2InstanceVOGatewayVO1' | |
| AND CONSTRAINT_TYPE = 'FOREIGN KEY'; | |
| SET `@sql` := IF(`@fk2_exists` > 0, | |
| 'ALTER TABLE `zstack`.`BareMetal2InstanceVO` DROP FOREIGN KEY `fkBareMetal2InstanceVOGatewayVO1`', | |
| 'SELECT 1'); | |
| PREPARE stmt FROM `@sql`; EXECUTE stmt; DEALLOCATE PREPARE stmt; | |
| SELECT COUNT(1) INTO `@fk1_new_exists` | |
| FROM information_schema.TABLE_CONSTRAINTS | |
| WHERE CONSTRAINT_SCHEMA = `@schema` | |
| AND TABLE_NAME = `@tbl` | |
| AND CONSTRAINT_NAME = 'fkBareMetal2InstanceVOGatewayVO' | |
| AND CONSTRAINT_TYPE = 'FOREIGN KEY'; | |
| SET `@sql` := IF(`@fk1_new_exists` = 0, | |
| 'ALTER TABLE `zstack`.`BareMetal2InstanceVO` | |
| ADD CONSTRAINT `fkBareMetal2InstanceVOGatewayVO` | |
| FOREIGN KEY (`gatewayUuid`) REFERENCES `zstack`.`HostEO` (`uuid`) ON DELETE SET NULL', | |
| 'SELECT 1'); | |
| PREPARE stmt FROM `@sql`; EXECUTE stmt; DEALLOCATE PREPARE stmt; | |
| SELECT COUNT(1) INTO `@fk2_new_exists` | |
| FROM information_schema.TABLE_CONSTRAINTS | |
| WHERE CONSTRAINT_SCHEMA = `@schema` | |
| AND TABLE_NAME = `@tbl` | |
| AND CONSTRAINT_NAME = 'fkBareMetal2InstanceVOGatewayVO1' | |
| AND CONSTRAINT_TYPE = 'FOREIGN KEY'; | |
| SET `@sql` := IF(`@fk2_new_exists` = 0, | |
| 'ALTER TABLE `zstack`.`BareMetal2InstanceVO` | |
| ADD CONSTRAINT `fkBareMetal2InstanceVOGatewayVO1` | |
| FOREIGN KEY (`lastGatewayUuid`) REFERENCES `zstack`.`HostEO` (`uuid`) ON DELETE SET NULL', | |
| 'SELECT 1'); | |
| PREPARE stmt FROM `@sql`; EXECUTE stmt; DEALLOCATE PREPARE stmt; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@conf/db/upgrade/V5.5.12__schema.sql` around lines 24 - 36, The ALTER
statements on table BareMetal2InstanceVO drop and re-add foreign keys
fkBareMetal2InstanceVOGatewayVO and fkBareMetal2InstanceVOGatewayVO1 without
idempotency checks, which will fail if constraints are already absent/present;
modify the migration to query information_schema.TABLE_CONSTRAINTS for
BareMetal2InstanceVO and only EXECUTE dynamic DROP FOREIGN KEY when the
constraint exists and only EXECUTE ADD CONSTRAINT when it does not exist (use
the constraint names fkBareMetal2InstanceVOGatewayVO and
fkBareMetal2InstanceVOGatewayVO1 and reference HostEO(uuid) with ON DELETE SET
NULL), ensuring the script is safe to run repeatedly and in branch states.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
header/src/main/java/org/zstack/header/cluster/APICreateClusterMsg.java (1)
69-73: Javadoc@choices注释与实际validValues不一致Javadoc 中的
@choices仅列出了KVM, Simulator, baremetal,但实际validValues包含了KVM, Simulator, baremetal, baremetal2, xdragon, baremetal2Dpu。建议更新注释以保持一致。建议修复
/** * `@desc` see field 'hypervisorType' of :ref:`ClusterInventory` for details - * `@choices` - KVM - * - Simulator - * - baremetal + * `@choices` - KVM + * - Simulator + * - baremetal + * - baremetal2 + * - xdragon + * - baremetal2Dpu */ `@APIParam`(validValues = {"KVM", "Simulator", "baremetal", "baremetal2", "xdragon", "baremetal2Dpu"})🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@header/src/main/java/org/zstack/header/cluster/APICreateClusterMsg.java` around lines 69 - 73, Update the Javadoc `@choices` on APICreateClusterMsg to match the actual `@APIParam` validValues; replace the current "@choices - KVM - Simulator - baremetal" with the full list "KVM, Simulator, baremetal, baremetal2, xdragon, baremetal2Dpu" so the comment and the `@APIParam`(validValues = {...}) remain consistent and accurate.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@header/src/main/java/org/zstack/header/cluster/APICreateClusterMsg.java`:
- Around line 69-73: Update the Javadoc `@choices` on APICreateClusterMsg to match
the actual `@APIParam` validValues; replace the current "@choices - KVM -
Simulator - baremetal" with the full list "KVM, Simulator, baremetal,
baremetal2, xdragon, baremetal2Dpu" so the comment and the `@APIParam`(validValues
= {...}) remain consistent and accurate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml)
Review profile: CHILL
Plan: Pro
Run ID: b9f94f31-6837-45f8-bbdd-c9271e50dc1a
⛔ Files ignored due to path filters (7)
sdk/src/main/java/SourceClassMap.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/AddBareMetal2DpuChassisAction.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/BareMetal2DpuChassisInventory.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/BareMetal2DpuHostInventory.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/CreateBareMetal2InstanceAction.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/CreateClusterAction.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/StartBareMetal2InstanceAction.javais excluded by!sdk/**
📒 Files selected for processing (6)
compute/src/main/java/org/zstack/compute/host/HostManagerImpl.javaconf/db/upgrade/V5.5.12__schema.sqlheader/src/main/java/org/zstack/header/cluster/APICreateClusterMsg.javaheader/src/main/java/org/zstack/header/cluster/APICreateClusterMsgDoc_zh_cn.groovytestlib/src/main/java/org/zstack/testlib/ApiHelper.groovyutils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java
support dpu baremetal2 instance
Resolves/Related: ZSTAC-12345
Change-Id: I626d637a7168656a6c726c6769777a726e616973
[dpu-bm2]: support dpu baremetal2 instance
support dpu baremetal2 instance
Resolves/Related: ZSTAC-80830
Change-Id: I626d637a7168656a6c726c6769777a726e616973
sync from gitlab !9341