Skip to content

<feature>[network]: filter policy schedules - #4717

Open
ZStack-Robot wants to merge 1 commit into
feature-5.5.38-policy-rule-schedulerfrom
sync/pengchao.liu/subtask-ZSTAC-87922
Open

<feature>[network]: filter policy schedules#4717
ZStack-Robot wants to merge 1 commit into
feature-5.5.38-policy-rule-schedulerfrom
sync/pengchao.liu/subtask-ZSTAC-87922

Conversation

@ZStack-Robot

Copy link
Copy Markdown
Collaborator

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

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
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

Parsing errors (1)
Could not fetch remote config from http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml: TimeoutError: The operation timed out.
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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: fd002523-0e18-424a-bf48-35fbd474b5fa

📥 Commits

Reviewing files that changed from the base of the PR and between c0bbabd and 9e80e93.

📒 Files selected for processing (5)
  • plugin/networkSecurityPolicySchedule/src/main/java/org/zstack/networksecuritypolicyschedule/APIGetNetworkSecurityPolicyScheduleMsg.java
  • plugin/networkSecurityPolicySchedule/src/main/java/org/zstack/networksecuritypolicyschedule/APIGetNetworkSecurityPolicyScheduleMsgDoc_zh_cn.groovy
  • plugin/networkSecurityPolicySchedule/src/main/java/org/zstack/networksecuritypolicyschedule/NetworkSecurityPolicyScheduleManagerImpl.java
  • sdk/src/main/java/org/zstack/sdk/GetNetworkSecurityPolicyScheduleAction.java
  • test/src/test/groovy/org/zstack/test/integration/networksecuritypolicyschedule/NetworkSecurityPolicyScheduleApiCase.groovy

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


Walkthrough

本次变更为网络安全策略计划查询新增 timeStatusrepeatTypetimeType 过滤参数。服务端支持数据库过滤和结果集过滤。SDK、接口文档和集成测试同步更新。

Changes

计划查询过滤

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
新增 timeStatusrepeatTypetimeType 可选参数、枚举限制、访问方法、示例值、中文文档和 SDK 字段。
服务端过滤逻辑
plugin/networkSecurityPolicySchedule/src/main/java/org/zstack/networksecuritypolicyschedule/NetworkSecurityPolicyScheduleManagerImpl.java
查询时按 repeatTypetimeType 过滤数据库记录,并按 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 ⚠️ Warning 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.

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