Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitconfig/hooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def check_commit_msg(file_path):
FAIL = False

jira_patterns = [r"\bZSTAC-\d+\b", r"\bZSTACK-\d+\b", r"\bMINI-\d+\b",
r"\bZOPS-\d+\b", r"\bZHCI-\d+\b", r"\bZSV-\d+\b"]
r"\bZOPS-\d+\b", r"\bZHCI-\d+\b", r"\bZSV-\d+\b", r"\bZCF-\d+\b"]
with open(file_path, 'r', encoding='utf8') as f:
lines = f.readlines()
full_lines = len(lines)
Expand Down
2 changes: 1 addition & 1 deletion .gitconfig/hooks/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def get_tags(changed_folders, changed_paths):
def get_jiras():
jiras = []
jira_patterns = [r"\bZSTAC-\d+\b", r"\bZSTACK-\d+\b", r"\bMINI-\d+\b",
r"\bZOPS-\d+\b", r"\bZHCI-\d+\b", r"\bZSV-\d+\b"]
r"\bZOPS-\d+\b", r"\bZHCI-\d+\b", r"\bZSV-\d+\b", r"\bZCF-\d+\b"]

bashCommand = "git rev-parse --abbrev-ref HEAD"
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
Expand Down
10 changes: 10 additions & 0 deletions conf/db/upgrade/V5.4.8__schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- Add ExternalServiceConfiguration table
CREATE TABLE IF NOT EXISTS `zstack`.`ExternalServiceConfigurationVO` (
`uuid` varchar(32) NOT NULL UNIQUE,
`serviceType` varchar(32) NOT NULL,
`configuration` text DEFAULT NULL,
`description` varchar(2048) DEFAULT NULL,
`lastOpDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`createDate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1 change: 1 addition & 0 deletions conf/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,6 @@
<class>org.zstack.header.network.l3.L3NetworkSequenceNumberVO</class>
<class>org.zstack.network.hostNetworkInterface.PhysicalSwitchVO</class>
<class>org.zstack.network.hostNetworkInterface.PhysicalSwitchPortVO</class>
<class>org.zstack.header.core.external.service.ExternalServiceConfigurationVO</class>
</persistence-unit>
</persistence>
17 changes: 17 additions & 0 deletions conf/serviceConfig/externalService.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,21 @@
<message>
<name>org.zstack.header.core.external.service.APIReloadExternalServiceMsg</name>
</message>

<message>
<name>org.zstack.header.core.external.service.APIAddExternalServiceConfigurationMsg</name>
</message>

<message>
<name>org.zstack.header.core.external.service.APIQueryExternalServiceConfigurationMsg</name>
<serviceId>query</serviceId>
</message>

<message>
<name>org.zstack.header.core.external.service.APIUpdateExternalServiceConfigurationMsg</name>
</message>

<message>
<name>org.zstack.header.core.external.service.APIDeleteExternalServiceConfigurationMsg</name>
</message>
</service>
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ public interface ExternalService {
ExternalServiceCapabilities getExternalServiceCapabilities();

void reload();

String getServiceType();

void externalConfig(String serviceType);
Comment on lines +19 to +22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Search for calls to externalConfig method and how the interface is used
rg -n -A3 -B3 'externalConfig\s*\(' --type=java | head -50

Repository: MatheMatrix/zstack

Length of output: 2071


🏁 Script executed:

# Read the ExternalService interface to see the complete definition
find . -type f -name "ExternalService.java" -path "*/core/src/*" | head -1 | xargs cat -n

Repository: MatheMatrix/zstack

Length of output: 645


🏁 Script executed:

# Check for Javadoc comments in the interface
rg -B5 'String getServiceType\(\)|void externalConfig' core/src/main/java/org/zstack/core/externalservice/ExternalService.java

Repository: MatheMatrix/zstack

Length of output: 224


为接口方法添加 Javadoc 注释

根据编码规范,接口方法必须配有有效的 Javadoc 注释。请为 getServiceType()externalConfig(String serviceType) 添加文档说明其用途。

🤖 Prompt for AI Agents
In `@core/src/main/java/org/zstack/core/externalservice/ExternalService.java`
around lines 19 - 22, 为接口方法添加 Javadoc 注释:在 ExternalService 接口中为 getServiceType()
和 externalConfig(String serviceType) 添加规范的 Javadoc
注释,分别说明方法的用途、返回值(getServiceType 返回的服务类型含义)及参数含义(externalConfig 的 serviceType
参数代表哪个服务或配置上下文),并在必要时加入 `@return` 和 `@param` 标签以满足编码规范与文档要求。

}
Loading