<feature>[ai] ZSTAC-84025: schema + SDK actions for inference template auto-match#3870
<feature>[ai] ZSTAC-84025: schema + SDK actions for inference template auto-match#3870zstack-robot-2 wants to merge 3 commits into5.5.16from
Conversation
…erviceRefVO.isDefault/createDate/lastOpDate Resolves: ZSTAC-84025 Change-Id: Ifbb68c9d475aa19762bb053e6545381a305dfe5b
…l.defaultModelServiceUuid Resolves: ZSTAC-84025 Change-Id: I4046976b0c4437ba4c14069946b8075393f152ed
…Model DSL Resolves: ZSTAC-84025 Change-Id: I0df26f7367a28da9c6c825dcddcb829db133374e
概览该拉取请求向 更改
预估代码审查工作量🎯 2 (简单) | ⏱️ ~10 分钟 诗
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.22__schema.sql`:
- Around line 5-6: The upgrade script uses raw ALTER TABLE ... ADD COLUMN for
ModelServiceRefVO.`isDefault` (and the other two ADD COLUMNs at the same file)
which can fail if the column already exists; change these raw ALTERs to the same
safe pattern used elsewhere in this file (use the ADD_COLUMN wrapper function or
an existence check via information_schema) so the script is idempotent — update
the statements that add isDefault (and the other two direct ADD COLUMN lines) to
call the ADD_COLUMN helper or surround them with a conditional existence check
before ALTER TABLE.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ 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: f82ecf34-a85f-4358-b16f-ef10bf4145b4
⛔ Files ignored due to path filters (3)
sdk/src/main/java/org/zstack/sdk/AutoMatchModelServiceByModelAction.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/AutoMatchModelServiceByModelResult.javais excluded by!sdk/**sdk/src/main/java/org/zstack/sdk/UpdateModelAction.javais excluded by!sdk/**
📒 Files selected for processing (2)
conf/db/upgrade/V5.5.22__schema.sqltestlib/src/main/java/org/zstack/testlib/ApiHelper.groovy
| ALTER TABLE `zstack`.`ModelServiceRefVO` ADD COLUMN `isDefault` TINYINT(1) NOT NULL DEFAULT 0; | ||
|
|
There was a problem hiding this comment.
升级脚本加列方式不一致,存在重复执行失败风险。
Line 5、Line 16、Line 17 直接使用 ALTER TABLE ... ADD COLUMN,而同文件 Line 2/12 使用了 ADD_COLUMN 封装。若目标环境已存在这些列,直接 ALTER 会中断升级。建议统一改为带存在性检查的方式(如 ADD_COLUMN 或 information_schema 判存)。
As per coding guidelines: "Upgrading scene has been carefully handled".
Also applies to: 16-17
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@conf/db/upgrade/V5.5.22__schema.sql` around lines 5 - 6, The upgrade script
uses raw ALTER TABLE ... ADD COLUMN for ModelServiceRefVO.`isDefault` (and the
other two ADD COLUMNs at the same file) which can fail if the column already
exists; change these raw ALTERs to the same safe pattern used elsewhere in this
file (use the ADD_COLUMN wrapper function or an existence check via
information_schema) so the script is idempotent — update the statements that add
isDefault (and the other two direct ADD COLUMN lines) to call the ADD_COLUMN
helper or surround them with a conditional existence check before ALTER TABLE.
Scope (zstack core)
ZSTAC-84025 推理模板自动匹配 (Inference Template Auto-Match) for AIOS 5.5.22 — zstack core slice.
Changes (3 commits)
552558629aV5.5.22__schema.sql— addsModelVO.pipelineTag/manifestJson,ModelServiceRefVO.isDefault/createDate/lastOpDatee088888775AutoMatchModelServiceByModelAction/Result,UpdateModelAction.defaultModelServiceUuidfield8ccf27b358ApiHelper.groovyregenerated withautoMatchModelServiceByModelDSLCross-repo dependencies
This MR is one of three:
.ggufdetection + YAML frontmatter parser + manifest passthroughAll three must land together; premium's runtime depends on schema added here.
Verification
./runMavenProfile premiumBUILD SUCCESS in PR docker (full clean install, 1h45m)createDate DEFAULT '0000-00-00 00:00:00')Spec
sync from gitlab !9745