Skip to content

<feature>[sdk]: add requestCpu and add errCode#3581

Open
zstack-robot-2 wants to merge 1 commit into5.5.12from
sync/zhong.xian/feat/ZSTAC-80103@@2
Open

<feature>[sdk]: add requestCpu and add errCode#3581
zstack-robot-2 wants to merge 1 commit into5.5.12from
sync/zhong.xian/feat/ZSTAC-80103@@2

Conversation

@zstack-robot-2
Copy link
Copy Markdown
Collaborator

add requestCpuNum and requestMemorySize;
add loudOperationsErrorCode

Resolves: ZSTAC-80103

Change-Id: Ib1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0

sync from gitlab !9440

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent 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: 7a6a3b91-3f38-413d-84bc-592a000b5a08

📥 Commits

Reviewing files that changed from the base of the PR and between 1082229 and 5a7c76b.

⛔ Files ignored due to path filters (5)
  • sdk/src/main/java/org/zstack/sdk/DeployAppDevelopmentServiceAction.java is excluded by !sdk/**
  • sdk/src/main/java/org/zstack/sdk/DeployModelEvalServiceAction.java is excluded by !sdk/**
  • sdk/src/main/java/org/zstack/sdk/DeployModelServiceAction.java is excluded by !sdk/**
  • sdk/src/main/java/org/zstack/sdk/MatchModelServiceTemplateWithModelAction.java is excluded by !sdk/**
  • sdk/src/main/java/org/zstack/sdk/ModelService.java is excluded by !sdk/**
📒 Files selected for processing (2)
  • testlib/src/main/java/org/zstack/testlib/ApiHelper.groovy
  • utils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java
✅ Files skipped from review due to trivial changes (1)
  • utils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java

Walkthrough

交换/重排了 Groovy 测试库中三个 bare-metal 辅助方法与其构造的 SDK Action 类的对应关系,新增了 updateVmInstancePciDeviceSpecRef 公有 helper;在 CloudOperationsErrorCode 中新增了八个公开错误代码常量(ORG_ZSTACK_AI_10135ORG_ZSTACK_AI_10142)。

Changes

Cohort / File(s) Summary
ApiHelper 变更与新增方法
testlib/src/main/java/org/zstack/testlib/ApiHelper.groovy
调整了三处 DSL 辅助方法与其创建的 org.zstack.sdk.*Action 实例的对应位置/块(bare-metal 相关方法的映射/块顺序被重排,addBareMetal2IpmiChassis 的方法块位置/空行被调整但控制流未变)。新增公有方法 updateVmInstancePciDeviceSpecRef(...),按既有模式实例化并跟踪 ApiPathTracker
错误代码常量新增
utils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java
新增八个公开静态字符串常量:ORG_ZSTACK_AI_10135ORG_ZSTACK_AI_10136ORG_ZSTACK_AI_10137ORG_ZSTACK_AI_10138ORG_ZSTACK_AI_10139ORG_ZSTACK_AI_10140ORG_ZSTACK_AI_10141ORG_ZSTACK_AI_10142,均初始化为相同字面值。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

彩蛋诗

🐰 我把方法悄悄换,
我添了接口新一行,
错误码列队整齐亮,
小兔挥手去巡檐。


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive 标题格式正确遵循 [scope]: ,长度46字符在72字符限制内,但描述与主要变更不够精确匹配。 标题提及 'requestCpu' 和 'errCode',但实际变更包括 ApiHelper 中的方法交换和新增方法,以及 CloudOperationsErrorCode 中的常量添加,建议更新标题以准确反映所有主要变更。
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed 描述与变更集相关,提及了添加的功能和错误代码,但缺少对 ApiHelper 方法调整的具体说明。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/zhong.xian/feat/ZSTAC-80103@@2

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.42.0)
utils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java

Comment @coderabbitai help to get the list of available commands and usage tips.

@MatheMatrix MatheMatrix force-pushed the sync/zhong.xian/feat/ZSTAC-80103@@2 branch from fe2b5db to 74921d0 Compare March 25, 2026 08:56
@MatheMatrix
Copy link
Copy Markdown
Owner

Comment from ye.zou:

Code Review: ZSTAC-80103 (R2)

进度: 5/11 resolved (45%)
1 critical issue(s) still open

完整 review 见: http://dev.zstack.io:9080/zstackio/zstack/-/merge_requests/9309

@MatheMatrix MatheMatrix force-pushed the sync/zhong.xian/feat/ZSTAC-80103@@2 branch from 74921d0 to 1082229 Compare April 3, 2026 07:20
@ZStack-Robot
Copy link
Copy Markdown
Collaborator

Comment from gitlab:

自上次添加REVIEWED标签(2026-03-27 18:16:41.000Z)后, 有新的COMMIT更新(2026-04-03 15:19:53.904Z), 所以移除了REVIEWED标签

add requestCpuNum and requestMemorySize;
add loudOperationsErrorCode

Resolves: ZSTAC-80103

Change-Id: Ib1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0
@MatheMatrix MatheMatrix force-pushed the sync/zhong.xian/feat/ZSTAC-80103@@2 branch from 1082229 to 5a7c76b Compare April 3, 2026 07:51
@ZStack-Robot
Copy link
Copy Markdown
Collaborator

Comment from ye.zou:

Code Review

# 严重程度 分类 文件 问题描述 修复建议
1 🔵 Minor 代码质量 ApiHelper.groovy:965-1020,47345-47369 这个 MR 目标是同步 AI SDK/request 字段,结果 ApiHelper.groovy 里还混进了 bare-metal helper 重排和 updateVmInstancePciDeviceSpecRef 新 helper。代码没炸,但这是脏改动,后面真出回归没人愿意替你猜到底是 AI SDK 还是别的 API 生成物惹的祸。 把这些无关生成物拆到独立 MR,只保留 AI SDK / error code 同步。

结论: CONDITIONAL ⚠️
回归风险: 低
修复建议: 这条不一定会立刻炸,但 review 不该替无关改动背锅,拆开再送。


Progress Table

# Sev Cat Repo File R1 R2 R3 R4 R5
1 CRIT correctness premium AIModelManagerApiInterceptor.java 🔴
2 MAJ correctness premium messages_zsv_zh_CN.properties 🔴
3 min code-quality zstack ApiHelper.groovy 🔴
4 CRIT completeness premium ModelServiceVO.java 🔴
5 CRIT correctness premium AIModelManagerApiInterceptor.java 🔴
6 CRIT correctness premium AIModelManagerApiInterceptor.java 🔴
7 CRIT correctness premium AIModelManagerApiInterceptor.java 🔴
8 MAJ correctness premium AIModelManagerApiInterceptor.java 🔴
9 MAJ requirement premium AbstractAPIDeployModelServiceMsg.java 🔴
10 MAJ convention premium - 🔴
11 MAJ naming premium AbstractAPIDeployModelServiceMsg.java 🔴
12 MAJ correctness premium AIModelManagerApiInterceptor.java 🔴
13 min convention premium APIDeployModelServiceMsgDoc_zh_cn.groovy 🔴
14 min convention premium APIDeployModelServiceMsgDoc_zh_cn.groovy 🔴
15 min correctness premium ContainerModelServiceBackend.java 🔴
16 nit naming premium ContainerModelServiceBackend.java 🔴
17 nit style premium AICaseStub.groovy 🔴
18 nit consistency premium AICaseStub.groovy 🔴
19 nit naming premium AbstractAPIDeployModelServiceMsg.java 🔴
20 nit convention premium MR metadata 🔴
21 nit style premium AICaseStub.groovy 🔴

Progress: ████████░░ 18/21 resolved (86%)
1 critical issue(s) still open

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