Skip to content

<fix>[keyprovider]: Refine rekey validation and skip reporting#3623

Open
zstack-robot-2 wants to merge 1 commit intofeature-zsv-5.0.0-vm-support-vtpm-and-secucebootfrom
sync/tao.yang/ZSV-11505@@2
Open

<fix>[keyprovider]: Refine rekey validation and skip reporting#3623
zstack-robot-2 wants to merge 1 commit intofeature-zsv-5.0.0-vm-support-vtpm-and-secucebootfrom
sync/tao.yang/ZSV-11505@@2

Conversation

@zstack-robot-2
Copy link
Copy Markdown
Collaborator

Resolves: ZSV-11505

Change-Id: I6f756f7362636c7878676c786d6371746574746f

sync from gitlab !9482

Resolves: ZSV-11505

Change-Id: I6f756f7362636c7878676c786d6371746574746f
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9d7ae138-f0fc-4675-9b92-596b1b23bd45

📥 Commits

Reviewing files that changed from the base of the PR and between 9729c52 and f6e8b41.

📒 Files selected for processing (3)
  • sdk/src/main/java/SourceClassMap.java
  • sdk/src/main/java/org/zstack/sdk/keyprovider/api/RekeyKeyProviderRefsResult.java
  • sdk/src/main/java/org/zstack/sdk/keyprovider/api/RekeySkippedResource.java

功能概览

此次变更为密钥提供商重新生成(rekey)操作添加了新的数据模型支持。新增 RekeySkippedResource 类用于追踪被跳过的资源,同时扩展了 RekeyKeyProviderRefsResult 以记录操作统计指标(总数、成功数、跳过数)。

变更详情

变更组 / 文件 摘要
新增密钥重新生成数据模型
sdk/src/main/java/org/zstack/sdk/keyprovider/api/RekeySkippedResource.java
新增完整的Java模型类,包含4个公开字段(keyRefId、resourceType、resourceUuid、reason)及其对应的getter/setter方法,用于表示被跳过的资源信息。
类映射配置更新
sdk/src/main/java/SourceClassMap.java
RekeySkippedResource 添加双向映射条目,支持源包命名空间与目标包命名空间之间的转换。
操作结果类扩展
sdk/src/main/java/org/zstack/sdk/keyprovider/api/RekeyKeyProviderRefsResult.java
添加4个新的公开字段(totalCount、successCount、skippedCount、skippedResources)及对应的getter/setter方法,用于追踪rekey操作的执行统计和被跳过资源列表。

代码审查工作量评估

🎯 2 (Simple) | ⏱️ ~12 分钟

诗歌

🐰 新的模型类悄然而至,
跳过的资源被记录下来,
映射表添砖加瓦,
数据流动无阻碍,
rekey操作更清晰!✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR标题准确反映了主要变更:为keyprovider的密钥重新配置(rekey)操作添加了跳过资源的报告功能,包括新增RekeySkippedResource类和相关的验证逻辑。
Description check ✅ Passed PR描述与变更集相关联,包含了解决的问题标识(ZSV-11505)和变更来源信息,虽然细节有限但足够表明与keyprovider功能改进相关。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/tao.yang/ZSV-11505@@2

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

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.

1 participant