<feature>[network]: filter policy schedules - #4717
Conversation
Schedule lists could only be scoped by their owning resource, forcing callers to fetch every candidate before filtering. Support status, repeat type, and time type filters while keeping derived status calculation in the management plane. Resolves: ZSTAC-87922 Change-Id: I5910b817566cbe01b3108b1e3f9a91f398a46015
|
Warning
|
| Layer / File(s) | Summary |
|---|---|
查询参数契约 plugin/networkSecurityPolicySchedule/src/main/java/org/zstack/networksecuritypolicyschedule/APIGetNetworkSecurityPolicyScheduleMsg.java, plugin/networkSecurityPolicySchedule/src/main/java/org/zstack/networksecuritypolicyschedule/APIGetNetworkSecurityPolicyScheduleMsgDoc_zh_cn.groovy, sdk/src/main/java/org/zstack/sdk/GetNetworkSecurityPolicyScheduleAction.java |
新增 timeStatus、repeatType 和 timeType 可选参数、枚举限制、访问方法、示例值、中文文档和 SDK 字段。 |
服务端过滤逻辑 plugin/networkSecurityPolicySchedule/src/main/java/org/zstack/networksecuritypolicyschedule/NetworkSecurityPolicyScheduleManagerImpl.java |
查询时按 repeatType 和 timeType 过滤数据库记录,并按 timeStatus 过滤生成的计划清单。 |
集成测试验证 test/src/test/groovy/org/zstack/test/integration/networksecuritypolicyschedule/NetworkSecurityPolicyScheduleApiCase.groovy |
新增单条件和组合条件查询测试,并验证非法过滤值返回 ApiException。主测试流程调用 testGetFilters()。 |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Merge Risk: ⚪ Minimal · up to 9e80e
The change adds schedule-list filtering and corresponding API coverage without any identified merge-blocking risk; it is ready for normal checks and review.
Poem
小兔带来筛选键,
状态、重复与时区并肩。
计划清单按条件排,
非法值被异常拦截,
测试月光下验证每一页。
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 3 files. (2 skipped: 2… | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | 标题明确概括了网络策略定时计划的过滤功能,与变更内容一致。 |
| Description check | ✅ Passed | 描述说明了按状态、重复类型和时间类型过滤策略定时计划的功能,并说明了管理面状态计算和关联问题。 |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 3 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
sync/pengchao.liu/subtask-ZSTAC-87922
Comment @coderabbitai help to get the list of available commands.
Schedule lists could only be scoped by their owning resource, forcing
callers to fetch every candidate before filtering. Support status,
repeat type, and time type filters while keeping derived status
calculation in the management plane.
Resolves: ZSTAC-87922
Change-Id: I5910b817566cbe01b3108b1e3f9a91f398a46015
sync from gitlab !10772