Draft: <feature>[platformservice]: Add platform service SDK metadata#4394
Draft: <feature>[platformservice]: Add platform service SDK metadata#4394ZStack-Robot wants to merge 2 commits into
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (21)
Walkthrough本次变更为平台服务(PlatformService)引入完整 SDK 支持:新增数据库表 PlatformServicePackageVO 与 PlatformServiceInstanceVO,新增一系列 SDK Action/Result/Inventory 类(健康检查、部署/卸载、包上传/查询/删除、实例/VM实例查询),补充类型映射,并扩展测试辅助方法。 Changes平台服务功能新增
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant DeployPlatformServiceAction
participant ZSClient
participant PlatformServiceAPI
participant PlatformServiceInstanceVO
Client->>DeployPlatformServiceAction: call(packageUuid, cpuNum, memorySize, ...)
DeployPlatformServiceAction->>ZSClient: call(this)
ZSClient->>PlatformServiceAPI: PUT /platform-services/packages/{packageUuid}/actions
PlatformServiceAPI->>PlatformServiceInstanceVO: 创建/更新部署状态与进度
PlatformServiceAPI-->>ZSClient: ApiResult
ZSClient-->>DeployPlatformServiceAction: makeResult(ApiResult)
DeployPlatformServiceAction-->>Client: Result(DeployPlatformServiceResult.inventory)
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ 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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@conf/db/zsv/V5.1.0__schema.sql`:
- Around line 199-200: The `createDate` default in the schema uses a fixed
sentinel timestamp instead of the actual creation time. Update the `createDate`
column definitions in the affected table DDLs within `V5.1.0__schema.sql` to use
`DEFAULT CURRENT_TIMESTAMP` (consistent with the `lastOpDate` pattern) rather
than the hardcoded 1999-12-31 value, and apply the same change to both
occurrences referenced in the review.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 649baf39-0b64-41b3-b934-4a09a131e38b
📒 Files selected for processing (21)
conf/db/zsv/V5.1.0__schema.sqlsdk/src/main/java/org/zstack/sdk/SourceClassMap.javasdk/src/main/java/org/zstack/sdk/platformservice/CheckPlatformServiceHealthAction.javasdk/src/main/java/org/zstack/sdk/platformservice/CheckPlatformServiceHealthResult.javasdk/src/main/java/org/zstack/sdk/platformservice/DeletePlatformServicePackageAction.javasdk/src/main/java/org/zstack/sdk/platformservice/DeletePlatformServicePackageResult.javasdk/src/main/java/org/zstack/sdk/platformservice/DeployPlatformServiceAction.javasdk/src/main/java/org/zstack/sdk/platformservice/DeployPlatformServiceResult.javasdk/src/main/java/org/zstack/sdk/platformservice/GetPlatformServiceInstancesAction.javasdk/src/main/java/org/zstack/sdk/platformservice/GetPlatformServiceInstancesResult.javasdk/src/main/java/org/zstack/sdk/platformservice/GetPlatformServiceVmInstancesAction.javasdk/src/main/java/org/zstack/sdk/platformservice/GetPlatformServiceVmInstancesResult.javasdk/src/main/java/org/zstack/sdk/platformservice/PlatformServiceInstanceInventory.javasdk/src/main/java/org/zstack/sdk/platformservice/PlatformServicePackageInventory.javasdk/src/main/java/org/zstack/sdk/platformservice/QueryPlatformServicePackageAction.javasdk/src/main/java/org/zstack/sdk/platformservice/QueryPlatformServicePackageResult.javasdk/src/main/java/org/zstack/sdk/platformservice/UndeployPlatformServiceAction.javasdk/src/main/java/org/zstack/sdk/platformservice/UndeployPlatformServiceResult.javasdk/src/main/java/org/zstack/sdk/platformservice/UploadPlatformServicePackageAction.javasdk/src/main/java/org/zstack/sdk/platformservice/UploadPlatformServicePackageResult.javatestlib/src/main/java/org/zstack/testlib/ApiHelper.groovy
| `lastOpDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
| `createDate` timestamp NOT NULL DEFAULT '1999-12-31 23:59:59', |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
createDate 建议使用 CURRENT_TIMESTAMP 而非固定哨兵值
两张新表的 createDate 均设置为 DEFAULT '1999-12-31 23:59:59',而非 CURRENT_TIMESTAMP。虽然不是 0000-00-00,但同样属于人为哨兵日期,不能准确反映记录创建时间。
💡 建议修改
- `createDate` timestamp NOT NULL DEFAULT '1999-12-31 23:59:59',
+ `createDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,As per path instructions, "Do not use DEFAULT 0000-00-00 00:00:00, use DEFAULT CURRENT_TIMESTAMP instead" — 建议按此原则统一处理 createDate 的默认值。
Also applies to: 224-225
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@conf/db/zsv/V5.1.0__schema.sql` around lines 199 - 200, The `createDate`
default in the schema uses a fixed sentinel timestamp instead of the actual
creation time. Update the `createDate` column definitions in the affected table
DDLs within `V5.1.0__schema.sql` to use `DEFAULT CURRENT_TIMESTAMP` (consistent
with the `lastOpDate` pattern) rather than the hardcoded 1999-12-31 value, and
apply the same change to both occurrences referenced in the review.
Source: Path instructions
|
Comment from yaohua.wu: Review: MR !10354 — ZSV-12505Background
关联 MR
Critical
Warning
本 MR 直接检查结果
Coverage
Verdict: REVISION_REQUIRED本 MR 自身未发现独立代码缺陷,但作为联动 MR,必须等待 premium companion MR 的 Critical 修复和 rebase 后再同批合入。 🤖 Robot Reviewer |
b7c5b23 to
cf5d74e
Compare
Add generated SDK actions, source mappings, testlib helpers, and ZSV schema metadata for platform service APIs. DBImpact Resolves: ZSV-12505 Change-Id: I706c6174666f726d736572766963653132353035
cf5d74e to
e2c225b
Compare
Persist activeApiId on platform service packages and instances so progress can be read from existing task progress records instead of duplicating step fields. DBImpact Resolves: ZSV-12505 Change-Id: Ie6a75a06a3e7960f46f47fecc72715c2fd3e22a9
Add generated SDK actions, source mappings, testlib helper updates, and zsv schema metadata for platform service APIs.
DBImpact
Test: mvn -P premium -pl premium/plugin-premium/platform-service-plugin -am -DskipTests -Djacoco.skip=true install
Resolves: ZSV-12505
Change-Id: I706c6174666f726d736572766963653132353035
sync from gitlab !10354