Skip to content

<fix>[portforwarding]: skip detach when serviceUuids is empty#3869

Open
ZStack-Robot wants to merge 1 commit into5.5.16from
sync/shixin.ruan/shixin-ZSTAC-84748@@2
Open

<fix>[portforwarding]: skip detach when serviceUuids is empty#3869
ZStack-Robot wants to merge 1 commit into5.5.16from
sync/shixin.ruan/shixin-ZSTAC-84748@@2

Conversation

@ZStack-Robot
Copy link
Copy Markdown
Collaborator

PortForwardingConfigProxy.detachNetworkServiceFromNoHaVirtualRouter
would generate 'AND vo.uuid IN ()' when called with an empty list,
causing a MariaDB syntax error. Add an early return guard.

Resolves: ZSTAC-84748

Change-Id: I15a86ffb92829af6952697a4f3cb1351cd5ed28c

sync from gitlab !9744

PortForwardingConfigProxy.detachNetworkServiceFromNoHaVirtualRouter
would generate 'AND vo.uuid IN ()' when called with an empty list,
causing a MariaDB syntax error. Add an early return guard.

Resolves: ZSTAC-84748

Change-Id: I15a86ffb92829af6952697a4f3cb1351cd5ed28c
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml)

Review profile: CHILL

Plan: Pro

Run ID: ab136874-0f79-4540-8872-e44269cf17c7

📥 Commits

Reviewing files that changed from the base of the PR and between ce7b222 and 7acca91.

📒 Files selected for processing (1)
  • plugin/virtualRouterProvider/src/main/java/org/zstack/network/service/virtualrouter/portforwarding/PortForwardingConfigProxy.java

概览

PortForwardingConfigProxy 类的 detachNetworkServiceFromNoHaVirtualRouter 方法中添加了对 serviceUuids 列表为 null 或空的防御性检查,防止后续 SQL 查询在参数无效时执行。无其他逻辑改动。

变更

分组 / 文件 摘要
端口转发配置代理
plugin/virtualRouterProvider/src/main/java/org/zstack/network/service/virtualrouter/portforwarding/PortForwardingConfigProxy.java
添加了 serviceUuids 列表的 null/空值检查,提前返回以避免执行包含无效 IN 参数的 SQL 删除操作。

预估代码审查工作量

🎯 1 (极简) | ⏱️ ~3 分钟

诗文

🐰 小小的检查守护代码,
null 和空值无处遁逃,
SQL 查询得以安然无恙,
防御之心如此周到!✨

🚥 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR title follows the required [scope]: format, is 61 characters (under 72), and accurately describes the main change.
Description check ✅ Passed PR description clearly explains the bug fix, references the related JIRA issue, and aligns with the changeset modifications.
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.

✏️ 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/shixin.ruan/shixin-ZSTAC-84748@@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.

2 participants