Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 新增项目级事件回调 #10146 #10253

Closed
wants to merge 54 commits into from

Conversation

hejieehe
Copy link
Collaborator

@@ -440,4 +440,12 @@ CREATE TABLE IF NOT EXISTS `T_OPERATIONAL_PRODUCT`
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='运营产品信息表';

CREATE TABLE IF NOT EXISTS `T_PROJECT_CALLBACK` (
`ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`EVENT` varchar(32) DEFAULT NULL COMMENT '事件类型',
Copy link
Collaborator

Choose a reason for hiding this comment

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

改成EVENT_TYPE

enum class ProjectEventType {
CREATE,
UPDATE,
ENABLE,
Copy link
Collaborator

Choose a reason for hiding this comment

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

区分启用和禁用

@@ -381,4 +385,93 @@ object OkhttpUtils {
false
}
}

private fun buildRequest(
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • 重试在com.tencent.devops.common.util.HttpRetryUtils有实现,不需要重复造轮子
  • callback应该只有post请求,不需要关注其他请求方法的

@POST
@Path("/create")
@Operation(summary = "新建项目级回调")
fun create(
Copy link
Collaborator

Choose a reason for hiding this comment

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

创建回调url和凭证应该分开,url需要区分region

"secretType[${it.secretType}]"
)
// 4.发请求
send(
Copy link
Collaborator

Choose a reason for hiding this comment

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

回调请求如果超时3s,应该终止

@hejieehe hejieehe closed this May 14, 2024
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.

None yet

2 participants