<fix>[config]: update globalConfigOptions number range#4161
<fix>[config]: update globalConfigOptions number range#4161zstack-robot-2 wants to merge 1 commit into
Conversation
概览该PR为ZStack全局配置系统的数值范围验证添加了包含等于边界的约束支持。新增了 变更数值边界约束扩展
代码审查工作量估算🎯 2 (Simple) | ⏱️ ~12 分钟 诗
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
core/src/main/java/org/zstack/core/config/GlobalConfigOptionsDoc_zh_cn.groovy (1)
28-39: ⚡ Quick win建议丰富字段描述信息。
当前描述仅为"大于等于"和"小于等于",建议补充更完整的说明,例如:
numberGreaterThanOrEqual: "数值下界(包含边界值)"numberLessThanOrEqual: "数值上界(包含边界值)"这样可以帮助 API 使用者更清楚地理解字段的用途和约束语义。
🤖 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 `@core/src/main/java/org/zstack/core/config/GlobalConfigOptionsDoc_zh_cn.groovy` around lines 28 - 39, Update the field descriptions for numberGreaterThanOrEqual and numberLessThanOrEqual in GlobalConfigOptionsDoc_zh_cn.groovy to be more descriptive; replace the terse "大于等于" and "小于等于" with fuller explanations such as "数值下界(包含边界值)" for numberGreaterThanOrEqual and "数值上界(包含边界值)" for numberLessThanOrEqual so API consumers understand these represent inclusive lower and upper bounds respectively.sdk/src/main/java/org/zstack/sdk/GlobalConfigOptions.java (1)
31-45: ⚡ Quick win建议为新增的公共字段添加 Javadoc 注释。
虽然 SDK DTO 类通常文档较少,但为公共字段添加简短的 Javadoc 说明(如
/** 数值下界(包含等于) */)可以提升 API 的可读性和使用体验。🤖 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 `@sdk/src/main/java/org/zstack/sdk/GlobalConfigOptions.java` around lines 31 - 45, 为公共字段添加简短的 Javadoc 注释以提升可读性:在 numberGreaterThanOrEqual 和 numberLessThanOrEqual 字段及其访问器方法(setNumberGreaterThanOrEqual, getNumberGreaterThanOrEqual, setNumberLessThanOrEqual, getNumberLessThanOrEqual)上添加一行注释说明其含义(例如“数值下界(包含)”/“数值上界(包含)”),保持中文或英文简洁描述并放在字段/方法声明前的 /** ... */ 块中。
🤖 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.
Nitpick comments:
In
`@core/src/main/java/org/zstack/core/config/GlobalConfigOptionsDoc_zh_cn.groovy`:
- Around line 28-39: Update the field descriptions for numberGreaterThanOrEqual
and numberLessThanOrEqual in GlobalConfigOptionsDoc_zh_cn.groovy to be more
descriptive; replace the terse "大于等于" and "小于等于" with fuller explanations such
as "数值下界(包含边界值)" for numberGreaterThanOrEqual and "数值上界(包含边界值)" for
numberLessThanOrEqual so API consumers understand these represent inclusive
lower and upper bounds respectively.
In `@sdk/src/main/java/org/zstack/sdk/GlobalConfigOptions.java`:
- Around line 31-45: 为公共字段添加简短的 Javadoc 注释以提升可读性:在 numberGreaterThanOrEqual 和
numberLessThanOrEqual 字段及其访问器方法(setNumberGreaterThanOrEqual,
getNumberGreaterThanOrEqual, setNumberLessThanOrEqual,
getNumberLessThanOrEqual)上添加一行注释说明其含义(例如“数值下界(包含)”/“数值上界(包含)”),保持中文或英文简洁描述并放在字段/方法声明前的
/** ... */ 块中。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 13b1698d-da26-4185-916f-990dbc1d6986
📒 Files selected for processing (5)
core/src/main/java/org/zstack/core/config/GlobalConfigFacadeImpl.javacore/src/main/java/org/zstack/core/config/GlobalConfigOptions.javacore/src/main/java/org/zstack/core/config/GlobalConfigOptionsDoc_zh_cn.groovysdk/src/main/java/org/zstack/sdk/GlobalConfigOptions.javatest/src/test/groovy/org/zstack/test/integration/core/config/GlobalConfigCase.groovy
Backport ZSTAC-85576 to 4.8.38 (cross-repo @@2)
Cherry-pick of original fix (含配套测试) to 4.8.38. 本 issue 同时涉及 zstack 与 premium 两仓,分支统一命名 bugfix/ZSTAC-85576@@2 以便 DevOps 关联跑 case。
Sibling repo MR: premium MR (see below)
Commits
Related: ZSTAC-85576
sync from gitlab !10066