From af6f2a9711b068d0d905be9d435290efd1ccddc3 Mon Sep 17 00:00:00 2001 From: mingshewhe Date: Sat, 21 Oct 2023 20:53:33 +0800 Subject: [PATCH 1/3] CHANGELOG: Update directory for v1.13.0-rc.4 release --- CHANGELOG/CHANGELOG-1.13.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CHANGELOG/CHANGELOG-1.13.md b/CHANGELOG/CHANGELOG-1.13.md index c69b6b99e5b..16cb2b240b0 100644 --- a/CHANGELOG/CHANGELOG-1.13.md +++ b/CHANGELOG/CHANGELOG-1.13.md @@ -1,4 +1,7 @@ +- [v1.13.0-rc.4](#v1130-rc4) + - [Changelog since v1.13.0-rc.3](#changelog-since-v1130-rc3) + - [v1.13.0-rc.2](#v1130-rc2) - [Changelog since v1.12.0-rc.8](#changelog-since-v1120-rc8) @@ -7,6 +10,31 @@ +# v1.13.0-rc.4 +## Changelog since v1.13.0-rc.3 +#### 新增 +- [新增] 新增判断是否是项目成员user态接口 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9569) +- [新增] 新增获取部门员工信息接口 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9570) +- [新增] 支持开通蓝盾项目权限的同时开通对应的监控空间权限 [链接](http://github.com/TencentBlueKing/bk-ci/issues/8935) +- [新增] 增加获取项目信息及成员信息接口 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9392) +- [新增] 接入审计中心 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9414) +- [新增] fit-sec线权限升级支持 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9521) +- [新增] 优化Env模块的日志打印逻辑 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9470) +- [新增] user类接口传递网关token [链接](http://github.com/TencentBlueKing/bk-ci/issues/9482) +- [新增] build_msg需要根据事件触发场景细化 [链接](http://github.com/TencentBlueKing/bk-ci/issues/8831) +- [新增] bkrepo客户端新增apk加固接口 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9423) +- [新增] 新增不用SQL检查的代码 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9346) + +#### 优化 +- [优化] 静态资源文件的url地址域名支持适配特定环境 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9504) +- [优化] metrics接口优化补充,调整项目下插件信息来源 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9488) +- [优化] 增加国际化初始化配置 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9413) + +#### 修复 +- [修复] 获取子流水线执行状态接口不需要做权限校验 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9552) +- [修复] 查看研发商店的模版时,若插件可见范围符合要求,不应该提示项目xxx不允许使用插件xxx [链接](http://github.com/TencentBlueKing/bk-ci/issues/9531) +- [修复] 增加开源版插件的task.json的packagePath字段的非空校验 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9509) +- [修复] 删除流水线后,未删除制品库中流水线的资源 [链接](http://github.com/TencentBlueKing/bk-ci/issues/9491) # v1.13.0-rc.2 ## Changelog since v1.12.0-rc.8 #### 新增 From 9d3d68240f6750969daf04ea691898f4d2b23d5d Mon Sep 17 00:00:00 2001 From: hejieehe <904696180@qq.com> Date: Mon, 23 Oct 2023 16:48:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E3=80=90PAC=E3=80=91feat=EF=BC=9A=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=BB=8E=E4=BB=A3=E7=A0=81=E5=BA=93=E7=BB=B4=E5=BA=A6?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=AF=B9=E5=BA=94=E7=9A=84=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=BA=93=E4=BA=8B=E4=BB=B6=20#8122?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webhook/enums/WebhookI18nConstants.kt | 3 + .../code/handler/CodeWebhookTriggerHandler.kt | 3 +- .../github/GithubCreateTriggerHandler.kt | 9 ++- .../handler/github/GithubPrTriggerHandler.kt | 12 +++- .../github/GithubPushTriggerHandler.kt | 12 +++- .../code/handler/p4/P4ChangeTriggerHandler.kt | 12 +++- .../code/handler/p4/P4ShelveTriggerHandler.kt | 12 +++- .../handler/svn/SvnCommitTriggerHandler.kt | 12 +++- .../handler/tgit/TGitIssueTriggerHandler.kt | 12 +++- .../code/handler/tgit/TGitMrTriggerHandler.kt | 12 +++- .../handler/tgit/TGitNoteTriggerHandler.kt | 12 +++- .../handler/tgit/TGitPushTriggerHandler.kt | 12 +++- .../handler/tgit/TGitReviewTriggerHandler.kt | 14 ++++- .../handler/tgit/TGitTagPushTriggerHandler.kt | 12 +++- .../code/matcher/AbstractScmWebhookMatcher.kt | 5 +- .../service/code/matcher/ScmWebhookMatcher.kt | 3 +- .../pojo/trigger/PipelineEventReplayInfo.kt | 58 +++++++++++++++++++ .../process/trigger/WebhookTriggerService.kt | 5 +- .../i18n/process/message_en_US.properties | 27 ++++++++- .../i18n/process/message_zh_CN.properties | 25 ++++++++ .../sql/1001_ci_process_ddl_mysql.sql | 2 +- 21 files changed, 230 insertions(+), 44 deletions(-) create mode 100644 src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/trigger/PipelineEventReplayInfo.kt diff --git a/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/enums/WebhookI18nConstants.kt b/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/enums/WebhookI18nConstants.kt index 40d7993a8e1..0e403133bfe 100644 --- a/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/enums/WebhookI18nConstants.kt +++ b/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/enums/WebhookI18nConstants.kt @@ -120,4 +120,7 @@ object WebhookI18nConstants { // issues操作类型不匹配 const val ISSUES_ACTION_NOT_MATCH = "bkRepoTriggerIssueActionNotMatch" + + // 事件回放匹配码后缀 + const val EVENT_REPLAY_SUFFIX = "Replay" } diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/CodeWebhookTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/CodeWebhookTriggerHandler.kt index e84118bc7a4..8837455c10d 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/CodeWebhookTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/CodeWebhookTriggerHandler.kt @@ -34,6 +34,7 @@ import com.tencent.devops.common.webhook.service.code.filter.WebhookFilter import com.tencent.devops.common.webhook.service.code.filter.WebhookFilterChain import com.tencent.devops.common.webhook.service.code.filter.WebhookFilterResponse import com.tencent.devops.common.webhook.service.code.pojo.WebhookMatchResult +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.scm.pojo.WebhookCommit @@ -75,7 +76,7 @@ interface CodeWebhookTriggerHandler { /** * 获取事件说明,根据不同的事件组织事件说明 */ - fun getEventDesc(event: T): String = "" + fun getEventDesc(event: T, replayInfo: PipelineEventReplayInfo? = null): String = "" /** * 获取webhook事件生产者ID,工蜂-工蜂ID,github-github id,svn-svn path,p4-p4port diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubCreateTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubCreateTriggerHandler.kt index 23bc82db501..46225088f34 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubCreateTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubCreateTriggerHandler.kt @@ -40,6 +40,7 @@ import com.tencent.devops.common.webhook.pojo.code.WebHookParams import com.tencent.devops.common.webhook.pojo.code.github.GithubCreateEvent import com.tencent.devops.common.webhook.service.code.filter.WebhookFilter import com.tencent.devops.common.webhook.service.code.handler.GitHookTriggerHandler +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.scm.utils.code.git.GitUtils import java.time.LocalDateTime @@ -78,7 +79,7 @@ class GithubCreateTriggerHandler : GitHookTriggerHandler { return event.ref } - override fun getEventDesc(event: GithubCreateEvent): String { + override fun getEventDesc(event: GithubCreateEvent, replayInfo: PipelineEventReplayInfo?): String { var i18Code = WebhookI18nConstants.GITHUB_CREATE_TAG_EVENT_DESC val linkUrl = if (event.ref_type == "tag") { "https://github.com/${event.repository.fullName}/releases/tag/${event.ref}" @@ -86,12 +87,14 @@ class GithubCreateTriggerHandler : GitHookTriggerHandler { i18Code = WebhookI18nConstants.GITHUB_CREATE_BRANCH_EVENT_DESC "https://github.com/${event.repository.fullName}/tree/${event.ref}" } + // 事件重放 + val (username, code) = PipelineEventReplayInfo.getTriggerInfo(replayInfo, getUsername(event), i18Code) return I18Variable( - code = i18Code, + code = code, params = listOf( getBranchName(event), linkUrl, - getUsername(event), + username, DateTimeUtil.formatMilliTime(LocalDateTime.now().timestampmilli()) ) ).toJsonStr() diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubPrTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubPrTriggerHandler.kt index abd224e6ea7..c999267941c 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubPrTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubPrTriggerHandler.kt @@ -86,6 +86,7 @@ import com.tencent.devops.common.webhook.service.code.filter.WebhookFilter import com.tencent.devops.common.webhook.service.code.handler.GitHookTriggerHandler import com.tencent.devops.common.webhook.service.code.pojo.WebhookMatchResult import com.tencent.devops.common.webhook.util.WebhookUtils +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.scm.utils.code.git.GitUtils import org.slf4j.LoggerFactory @@ -130,13 +131,18 @@ class GithubPrTriggerHandler : GitHookTriggerHandler { return event.pullRequest.title } - override fun getEventDesc(event: GithubPullRequestEvent): String { + override fun getEventDesc(event: GithubPullRequestEvent, replayInfo: PipelineEventReplayInfo?): String { + val (username, i18Code) = PipelineEventReplayInfo.getTriggerInfo( + replayInfo, + getUsername(event), + WebhookI18nConstants.GITHUB_PR_EVENT_DESC + ) return I18Variable( - code = WebhookI18nConstants.GITHUB_PR_EVENT_DESC, + code = i18Code, params = listOf( event.pullRequest.htmlUrl, event.pullRequest.number.toString(), - getUsername(event), + username, event.action ) ).toJsonStr() diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubPushTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubPushTriggerHandler.kt index 5d31becdac4..7014ca3019e 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubPushTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/github/GithubPushTriggerHandler.kt @@ -61,6 +61,7 @@ import com.tencent.devops.common.webhook.service.code.filter.WebhookFilter import com.tencent.devops.common.webhook.service.code.handler.GitHookTriggerHandler import com.tencent.devops.common.webhook.service.code.pojo.WebhookMatchResult import com.tencent.devops.common.webhook.util.WebhookUtils +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.scm.utils.code.git.GitUtils import org.slf4j.LoggerFactory @@ -105,7 +106,7 @@ class GithubPushTriggerHandler : GitHookTriggerHandler { return event.headCommit?.message ?: "" } - override fun getEventDesc(event: GithubPushEvent): String { + override fun getEventDesc(event: GithubPushEvent, replayInfo: PipelineEventReplayInfo?): String { val linkUrl = if (event.headCommit != null) { "https://github.com/${event.repository.fullName}/commit/${event.headCommit?.id}" } else { @@ -117,13 +118,18 @@ class GithubPushTriggerHandler : GitHookTriggerHandler { } else { revision } + val (username, i18Code) = PipelineEventReplayInfo.getTriggerInfo( + replayInfo, + getUsername(event), + WebhookI18nConstants.GITHUB_PUSH_EVENT_DESC + ) return I18Variable( - code = WebhookI18nConstants.GITHUB_PUSH_EVENT_DESC, + code = i18Code, params = listOf( getBranchName(event), linkUrl, commitId, - getUsername(event) + username ) ).toJsonStr() } diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/p4/P4ChangeTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/p4/P4ChangeTriggerHandler.kt index c8cf3cdf531..c6bdc8e4482 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/p4/P4ChangeTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/p4/P4ChangeTriggerHandler.kt @@ -44,6 +44,7 @@ import com.tencent.devops.common.webhook.service.code.filter.WebhookFilter import com.tencent.devops.common.webhook.service.code.filter.WebhookFilterResponse import com.tencent.devops.common.webhook.service.code.handler.CodeWebhookTriggerHandler import com.tencent.devops.common.webhook.util.WebhookUtils +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.process.utils.PIPELINE_BUILD_MSG import com.tencent.devops.repository.pojo.Repository @@ -82,12 +83,17 @@ class P4ChangeTriggerHandler( override fun getMessage(event: P4ChangeEvent) = event.description - override fun getEventDesc(event: P4ChangeEvent): String { + override fun getEventDesc(event: P4ChangeEvent, replayInfo: PipelineEventReplayInfo?): String { + val (username, i18Code) = PipelineEventReplayInfo.getTriggerInfo( + replayInfo, + getUsername(event), + WebhookI18nConstants.P4_EVENT_DESC + ) return I18Variable( - code = WebhookI18nConstants.P4_EVENT_DESC, + code = i18Code, params = listOf( getRevision(event), - getUsername(event), + username, getFormatEventType(event) ) ).toJsonStr() diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/p4/P4ShelveTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/p4/P4ShelveTriggerHandler.kt index d98c126bc07..f27a65e7180 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/p4/P4ShelveTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/p4/P4ShelveTriggerHandler.kt @@ -45,6 +45,7 @@ import com.tencent.devops.common.webhook.service.code.filter.WebhookFilter import com.tencent.devops.common.webhook.service.code.filter.WebhookFilterResponse import com.tencent.devops.common.webhook.service.code.handler.CodeWebhookTriggerHandler import com.tencent.devops.common.webhook.util.WebhookUtils +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.process.utils.PIPELINE_BUILD_MSG import com.tencent.devops.repository.api.ServiceP4Resource import com.tencent.devops.repository.pojo.Repository @@ -85,12 +86,17 @@ class P4ShelveTriggerHandler( override fun getMessage(event: P4ShelveEvent) = event.description - override fun getEventDesc(event: P4ShelveEvent): String { + override fun getEventDesc(event: P4ShelveEvent, replayInfo: PipelineEventReplayInfo?): String { + val (username, i18Code) = PipelineEventReplayInfo.getTriggerInfo( + replayInfo, + getUsername(event), + WebhookI18nConstants.P4_EVENT_DESC + ) return I18Variable( - code = WebhookI18nConstants.P4_EVENT_DESC, + code = i18Code, params = listOf( getRevision(event), - getUsername(event), + username, getFormatEventType(event) ) ).toJsonStr() diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/svn/SvnCommitTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/svn/SvnCommitTriggerHandler.kt index c13f1b29601..805ad08d390 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/svn/SvnCommitTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/svn/SvnCommitTriggerHandler.kt @@ -44,6 +44,7 @@ import com.tencent.devops.common.webhook.service.code.filter.UserFilter import com.tencent.devops.common.webhook.service.code.filter.WebhookFilter import com.tencent.devops.common.webhook.service.code.handler.CodeWebhookTriggerHandler import com.tencent.devops.common.webhook.util.WebhookUtils +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.Repository @CodeWebhookHandler @@ -81,12 +82,17 @@ class SvnCommitTriggerHandler : CodeWebhookTriggerHandler { return event.log } - override fun getEventDesc(event: SvnCommitEvent): String { + override fun getEventDesc(event: SvnCommitEvent, replayInfo: PipelineEventReplayInfo?): String { + val (username, i18Code) = PipelineEventReplayInfo.getTriggerInfo( + replayInfo, + getUsername(event), + WebhookI18nConstants.SVN_COMMIT_EVENT_DESC + ) return I18Variable( - code = WebhookI18nConstants.SVN_COMMIT_EVENT_DESC, + code = i18Code, params = listOf( getRevision(event), - getUsername(event) + username ) ).toJsonStr() } diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitIssueTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitIssueTriggerHandler.kt index 47a23365f96..406aac7efca 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitIssueTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitIssueTriggerHandler.kt @@ -57,6 +57,7 @@ import com.tencent.devops.common.webhook.service.code.filter.GitUrlFilter import com.tencent.devops.common.webhook.service.code.filter.WebhookFilter import com.tencent.devops.common.webhook.service.code.handler.GitHookTriggerHandler import com.tencent.devops.common.webhook.util.WebhookUtils +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.scm.utils.code.git.GitUtils @@ -130,13 +131,18 @@ class TGitIssueTriggerHandler( return event.objectAttributes.title } - override fun getEventDesc(event: GitIssueEvent): String { + override fun getEventDesc(event: GitIssueEvent, replayInfo: PipelineEventReplayInfo?): String { + val (username, i18Code) = PipelineEventReplayInfo.getTriggerInfo( + replayInfo, + getUsername(event), + getI18Code(event) + ) return I18Variable( - code = getI18Code(event), + code = i18Code, params = listOf( "${event.objectAttributes.url}", event.objectAttributes.iid, - getUsername(event) + username ) ).toJsonStr() } diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitMrTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitMrTriggerHandler.kt index aafcc48a9d0..9a0083a9c57 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitMrTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitMrTriggerHandler.kt @@ -89,6 +89,7 @@ import com.tencent.devops.common.webhook.util.WebhookUtils import com.tencent.devops.common.webhook.util.WebhookUtils.convert import com.tencent.devops.common.webhook.util.WebhookUtils.getBranch import com.tencent.devops.process.engine.service.code.filter.CommitMessageFilter +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.CodeGitlabRepository import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.scm.pojo.WebhookCommit @@ -160,13 +161,18 @@ class TGitMrTriggerHandler( return event.object_attributes.id } - override fun getEventDesc(event: GitMergeRequestEvent): String { + override fun getEventDesc(event: GitMergeRequestEvent, replayInfo: PipelineEventReplayInfo?): String { + val (username, i18Code) = PipelineEventReplayInfo.getTriggerInfo( + replayInfo, + getUsername(event), + getI18Code(event) + ) return I18Variable( - code = getI18Code(event), + code = i18Code, params = listOf( "${event.object_attributes.url}", event.object_attributes.iid.toString(), - getUsername(event) + username ) ).toJsonStr() } diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitNoteTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitNoteTriggerHandler.kt index 5c48ffe3430..7388142ca8c 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitNoteTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitNoteTriggerHandler.kt @@ -80,6 +80,7 @@ import com.tencent.devops.common.webhook.service.code.filter.RegexContainFilter import com.tencent.devops.common.webhook.service.code.filter.WebhookFilter import com.tencent.devops.common.webhook.service.code.handler.CodeWebhookTriggerHandler import com.tencent.devops.common.webhook.util.WebhookUtils +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.CodeGitlabRepository import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.scm.utils.code.git.GitUtils @@ -164,13 +165,18 @@ class TGitNoteTriggerHandler( return event.objectAttributes.note } - override fun getEventDesc(event: GitNoteEvent): String { + override fun getEventDesc(event: GitNoteEvent, replayInfo: PipelineEventReplayInfo?): String { + val (username, i18Code) = PipelineEventReplayInfo.getTriggerInfo( + replayInfo, + getUsername(event), + WebhookI18nConstants.TGIT_NOTE_EVENT_DESC + ) return I18Variable( - code = WebhookI18nConstants.TGIT_NOTE_EVENT_DESC, + code = i18Code, params = listOf( event.objectAttributes.url, event.objectAttributes.id.toString(), - getUsername(event) + username ) ).toJsonStr() } diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitPushTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitPushTriggerHandler.kt index 98f8e0ee275..e72dec3d7cc 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitPushTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitPushTriggerHandler.kt @@ -72,6 +72,7 @@ import com.tencent.devops.common.webhook.service.code.pojo.WebhookMatchResult import com.tencent.devops.common.webhook.util.WebhookUtils import com.tencent.devops.common.webhook.util.WebhookUtils.convert import com.tencent.devops.process.engine.service.code.filter.CommitMessageFilter +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.scm.pojo.WebhookCommit import com.tencent.devops.scm.utils.code.git.GitUtils @@ -130,14 +131,19 @@ class TGitPushTriggerHandler( } } - override fun getEventDesc(event: GitPushEvent): String { + override fun getEventDesc(event: GitPushEvent, replayInfo: PipelineEventReplayInfo?): String { + val (username, i18Code) = PipelineEventReplayInfo.getTriggerInfo( + replayInfo, + getUsername(event), + TGIT_PUSH_EVENT_DESC + ) return I18Variable( - code = TGIT_PUSH_EVENT_DESC, + code = i18Code, params = listOf( getBranchName(event), "${event.repository.homepage}/commit/${event.checkout_sha}", "${event.checkout_sha}".substring(0, GitPushEvent.SHORT_COMMIT_ID_LENGTH), - event.user_name + username ) ).toJsonStr() } diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitReviewTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitReviewTriggerHandler.kt index e2c4155a501..c2f821d0f30 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitReviewTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitReviewTriggerHandler.kt @@ -58,6 +58,7 @@ import com.tencent.devops.common.webhook.service.code.filter.GitUrlFilter import com.tencent.devops.common.webhook.service.code.filter.WebhookFilter import com.tencent.devops.common.webhook.service.code.handler.CodeWebhookTriggerHandler import com.tencent.devops.common.webhook.util.WebhookUtils +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.scm.utils.code.git.GitUtils @@ -98,14 +99,21 @@ class TGitReviewTriggerHandler( return "" } - override fun getEventDesc(event: GitReviewEvent): String { - val (state, username) = if (event.reviewer != null) { + override fun getEventDesc(event: GitReviewEvent, replayInfo: PipelineEventReplayInfo?): String { + // 评审状态 to 事件人 + val (state, eventUser) = if (event.reviewer != null) { event.reviewer!!.state to event.reviewer!!.reviewer.name } else { event.state to getUsername(event) } + // 最终触发人 to 文案code + val (username, i18Code) = PipelineEventReplayInfo.getTriggerInfo( + replayInfo, + eventUser, + getI18Code(state) + ) return I18Variable( - code = getI18Code(state), + code = i18Code, params = listOf( "${event.repository.homepage}/reviews/${event.iid}", event.iid, diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitTagPushTriggerHandler.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitTagPushTriggerHandler.kt index 2a4cc2d5096..c15c4a12a01 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitTagPushTriggerHandler.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/handler/tgit/TGitTagPushTriggerHandler.kt @@ -57,6 +57,7 @@ import com.tencent.devops.common.webhook.service.code.filter.UserFilter import com.tencent.devops.common.webhook.service.code.filter.WebhookFilter import com.tencent.devops.common.webhook.service.code.handler.CodeWebhookTriggerHandler import com.tencent.devops.common.webhook.util.WebhookUtils +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.scm.utils.code.git.GitUtils @@ -99,7 +100,7 @@ class TGitTagPushTriggerHandler : CodeWebhookTriggerHandler { return event.ref.replace("refs/tags/", "") } - override fun getEventDesc(event: GitTagPushEvent): String { + override fun getEventDesc(event: GitTagPushEvent, replayInfo: PipelineEventReplayInfo?): String { val createFrom = when { event.create_from.isNullOrBlank() || event.checkout_sha == event.create_from -> { GitUtils.getShortSha(event.checkout_sha) @@ -109,13 +110,18 @@ class TGitTagPushTriggerHandler : CodeWebhookTriggerHandler { event.create_from } } + val (username, i18Code) = PipelineEventReplayInfo.getTriggerInfo( + replayInfo, + getUsername(event), + WebhookI18nConstants.TGIT_TAG_PUSH_EVENT_DESC + ) return I18Variable( - code = WebhookI18nConstants.TGIT_TAG_PUSH_EVENT_DESC, + code = i18Code, params = listOf( "$createFrom", "${event.repository.homepage}/-/tags/${getBranchName(event)}", getBranchName(event), - getUsername(event) + username ) ).toJsonStr() } diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/matcher/AbstractScmWebhookMatcher.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/matcher/AbstractScmWebhookMatcher.kt index 813f906aa9a..8d7c381f474 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/matcher/AbstractScmWebhookMatcher.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/matcher/AbstractScmWebhookMatcher.kt @@ -31,6 +31,7 @@ import com.tencent.devops.common.pipeline.pojo.element.trigger.enums.CodeEventTy import com.tencent.devops.common.webhook.pojo.code.CodeWebhookEvent import com.tencent.devops.common.webhook.service.code.loader.CodeWebhookHandlerRegistrar import com.tencent.devops.common.webhook.service.code.pojo.WebhookMatchResult +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.Repository @Suppress("TooManyFunctions") @@ -83,8 +84,8 @@ abstract class AbstractScmWebhookMatcher( return eventHandler.getMessage(event) } - override fun getEventDesc(): String { - return eventHandler.getEventDesc(event) + override fun getEventDesc(replayInfo: PipelineEventReplayInfo?): String { + return eventHandler.getEventDesc(event, replayInfo) } override fun getExternalId(): String { diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/matcher/ScmWebhookMatcher.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/matcher/ScmWebhookMatcher.kt index 718fbae741e..ef0f522d598 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/matcher/ScmWebhookMatcher.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/matcher/ScmWebhookMatcher.kt @@ -31,6 +31,7 @@ import com.tencent.devops.common.pipeline.pojo.element.trigger.enums.CodeEventTy import com.tencent.devops.common.pipeline.pojo.element.trigger.enums.CodeType import com.tencent.devops.common.webhook.pojo.code.WebHookParams import com.tencent.devops.common.webhook.service.code.pojo.WebhookMatchResult +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.scm.pojo.WebhookCommit import org.slf4j.LoggerFactory @@ -75,7 +76,7 @@ interface ScmWebhookMatcher { /** * 获取事件描述,根据不同的事件组织事件说明 */ - fun getEventDesc(): String = "" + fun getEventDesc(replayInfo: PipelineEventReplayInfo? = null): String = "" /** * 获取webhook事件生产者ID,工蜂-工蜂ID,github-github id,svn-svn path,p4-p4port diff --git a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/trigger/PipelineEventReplayInfo.kt b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/trigger/PipelineEventReplayInfo.kt new file mode 100644 index 00000000000..193b1242a43 --- /dev/null +++ b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/trigger/PipelineEventReplayInfo.kt @@ -0,0 +1,58 @@ +/* + * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * + * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license. + * + * A copy of the MIT License is included in this file. + * + * + * Terms of the MIT License: + * --------------------------------------------------- + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of + * the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT + * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +package com.tencent.devops.process.pojo.trigger + +import com.tencent.devops.common.webhook.enums.WebhookI18nConstants +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty + +@ApiModel("流水线事件重放操作信息") +data class PipelineEventReplayInfo( + @ApiModelProperty("触发人") + val userId: String +){ + companion object{ + /** + * 获取触发信息 + * 若为[重放事件]时,触发人为[回放者],且事件描述采用重放相关文案code + * 反之返回默认用户和触发文案code + */ + fun getTriggerInfo( + replayInfo: PipelineEventReplayInfo?, + defaultUserId: String, + defaultI18Code: String + ): Pair { + return if (replayInfo != null) { + replayInfo.userId to "$defaultI18Code${WebhookI18nConstants.EVENT_REPLAY_SUFFIX}" + } else { + defaultUserId to defaultI18Code + } + } + } +} diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/trigger/WebhookTriggerService.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/trigger/WebhookTriggerService.kt index fecd547f868..f0a162de3a6 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/trigger/WebhookTriggerService.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/trigger/WebhookTriggerService.kt @@ -31,6 +31,7 @@ package com.tencent.devops.process.trigger import com.tencent.devops.common.api.enums.ScmType import com.tencent.devops.common.webhook.service.code.matcher.ScmWebhookMatcher import com.tencent.devops.process.engine.service.PipelineWebhookService +import com.tencent.devops.process.pojo.trigger.PipelineEventReplayInfo import com.tencent.devops.process.pojo.trigger.PipelineTriggerEvent import com.tencent.devops.process.pojo.webhook.PipelineWebhookSubscriber import com.tencent.devops.process.service.webhook.PipelineBuildWebhookService @@ -92,8 +93,8 @@ class WebhookTriggerService( val triggerEvent = PipelineTriggerEvent( triggerType = scmType.name, eventType = matcher.getEventType().name, - triggerUser = matcher.getUsername(), - eventDesc = matcher.getEventDesc(), + triggerUser = userId, + eventDesc = matcher.getEventDesc(PipelineEventReplayInfo(userId)), hookRequestId = hookRequestId, eventTime = eventTime ) diff --git a/support-files/i18n/process/message_en_US.properties b/support-files/i18n/process/message_en_US.properties index 24b22f97d91..c001650ed36 100644 --- a/support-files/i18n/process/message_en_US.properties +++ b/support-files/i18n/process/message_en_US.properties @@ -385,7 +385,32 @@ bkP4EventDesc=Change [{0}] by {1} {2} bkSvnCommitEventDesc=Commit [{0}] pushed by {1} bkManualStartEventDesc=Manually triggered by {0} bkRemoteStartEventDesc=Remote api triggered by {0} -bkServiceStartEventDesc={0} Pipeline invocation triggered by [{2}] 调用 +bkServiceStartEventDesc={0} Pipeline invocation triggered by [{2}] invoke +# event replay +bkTgitPushEventDescReplay=[{0}] Commit [{2}] replayed by {3} +bkTgitIssueOpenedEventDescReplay=Issue [!{1}] replayed by {2} +bkTgitIssueUpdatedEventDescReplay=Issue [!{1}] replayed by {2} +bkTgitIssueClosedEventDescReplay=Issue [!{1}] replayed by {2} +bkTgitIssueReopenedEventDescReplay=Issue [!{1}] replayed by {2} +bkTgitMrCreatedEventDescReplay=Merge requests [!{1}] replayed by {2} +bkTgitMrUpdatedEventDescReplay=Merge requests [!{1}] replayed by {2} +bkTgitMrClosedEventDescReplay=Merge requests [!{1}] replayed by {2} +bkTgitMrReopenedEventDescReplay=Merge requests [!{1}] replayed by {2} +bkTgitMrPushUpdatedEventDescReplay=Merge requests [!{1}] replayed by {2} +bkTgitMrMergedEventDescReplay=Merge requests [!{1}] replayed by {2} +bkTgitTagPushEventDescReplay=[{0}]Tag [{2}] replayed by {3} +bkTgitNoteEventDescReplay=Note [{1}] replayed by {2} +bkTgitReviewCreatedEventDescReplay=Code review [{1}] replayed by {2} +bkTgitReviewApprovedEventDescReplay=Code review [{1}] replayed by {2} +bkTgitReviewApprovingEventDescReplay=Code review [{1}] approving +bkTgitReviewChangeDeniedEventDescReplay=Code review [{1}] replayed by {2} +bkTgitReviewChangeRequiredEventDescReplay=Code review [{1}] replayed by {2} +bkGithubPushEventDescReplay=[{0}] Commit [{2}] replayed {3} +bkGithubCreateBranchEventDescReplay=Branch [{1}] replayed {2} +bkGithubCreateTagEventDescReplay=Tag [{1}] replayed {2} +bkGithubPrEventDescReplay=Pull request [!{1}] by {2} replayed +bkP4EventDescReplay=Change [{0}] by {1} replayed +bkSvnCommitEventDescReplay=Commit [{0}] replayed by {1} bkRepoTriggerEventTypeNotMatch=Event type mismatch bkRepoTriggerTargetBranchNotMatch=Target branch [{0}] of merge request does not match bkRepoTriggerTargetBranchIgnored=Target branch [{0}] of merge request has been excluded diff --git a/support-files/i18n/process/message_zh_CN.properties b/support-files/i18n/process/message_zh_CN.properties index d1c8ddc6eb8..ed2c6e20474 100644 --- a/support-files/i18n/process/message_zh_CN.properties +++ b/support-files/i18n/process/message_zh_CN.properties @@ -386,6 +386,31 @@ bkSvnCommitEventDesc=提交 [{0}] 由 {1} bkManualStartEventDesc={0} 手动触发 bkRemoteStartEventDesc={0} 远程触发 bkServiceStartEventDesc={0} 触发的流水线 [{2}] 调用 +# 重放事件 +bkTgitPushEventDescReplay=[{0}] 提交 [{2}] 由 {3} 重放 +bkTgitIssueCreatedEventDescReplay=议题 [!{1}] 由 {2} 重放 +bkTgitIssueUpdatedEventDescReplay=议题 [!{1}] 由 {2} 重放 +bkTgitIssueClosedEventDescReplay=议题 [!{1}] 由 {2} 重放 +bkTgitIssueReopenedEventDescReplay=议题 [!{1}] 由 {2} 重放 +bkTgitMrCreatedEventDescReplay=合并请求 [!{1}] 由 {2} 重放 +bkTgitMrUpdatedEventDescReplay=合并请求 [!{1}] 由 {2} 重放 +bkTgitMrClosedEventDescReplay=合并请求 [!{1}] 由 {2} 重放 +bkTgitMrReopenedEventDescReplay=合并请求 [!{1}] 由 {2} 重放 +bkTgitMrPushUpdatedEventDescReplay=合并请求 [!{1}] 由 {2} 重放 +bkTgitMrMergedEventDescReplay=合并请求 [!{1}] 由 {2} 重放 +bkTgitTagPushEventDescReplay=[{0}] 创建Tag [{2}] 由 {3} 重放 +bkTgitNoteEventDescReplay=评论 [{1}] 由 {2} 重放 +bkTgitReviewCreatedEventDescReplay=代码审查 [{1}] 由 {2} 重放 +bkTgitReviewApprovedEventDescReplay=代码审查 [{1}] 由 {2} 重放 +bkTgitReviewApprovingEventDescReplay=代码审查 [{1}] 评审中 +bkTgitReviewChangeDeniedEventDescReplay=代码审查 [{1}] 由 {2} 重放 +bkTgitReviewChangeRequiredEventDescReplay=代码审查 [{1}] 由 {2} 重放 +bkGithubPushEventDescReplay=[{0}] 提交 [{2}] 由 {3} 重放 +bkGithubCreateBranchEventDescReplay=Branch [{1}] 由 {2} 重放 +bkGithubCreateTagEventDescReplay=Tag [{1}] 由 {2} 重放 +bkGithubPrEventDescReplay=Pull request [{1}] 由 {2} {3} +bkP4EventDescReplay=Change {0} 由 {1} 重放 +bkSvnCommitEventDescReplay=提交 [{0}] 由 {1} 重放 bkRepoTriggerEventTypeNotMatch=事件类型不满足触发条件 bkRepoTriggerTargetBranchNotMatch=MR目标分支[{0}]不满足触发条件 bkRepoTriggerTargetBranchIgnored=MR目标分支[{0}]被排除 diff --git a/support-files/sql/1001_ci_process_ddl_mysql.sql b/support-files/sql/1001_ci_process_ddl_mysql.sql index 98ddcc139fb..bcb614c5088 100644 --- a/support-files/sql/1001_ci_process_ddl_mysql.sql +++ b/support-files/sql/1001_ci_process_ddl_mysql.sql @@ -1176,7 +1176,7 @@ CREATE TABLE IF NOT EXISTS `T_PIPELINE_TRIGGER_DETAIL` `EVENT_ID` bigint(20) NOT NULL COMMENT '事件ID', `STATUS` varchar(100) DEFAULT NULL COMMENT '状态(success or failure)', `PIPELINE_ID` varchar(100) DEFAULT NULL COMMENT '流水线ID', - `PIPELINE_NAME` varchar(100) DEFAULT NULL COMMENT '流水线名称', + `PIPELINE_NAME` varchar(255) DEFAULT NULL COMMENT '流水线名称', `VERSION` int DEFAULT NULL COMMENT '流水线版本号', `BUILD_ID` varchar(100) DEFAULT NULL COMMENT '构建ID', `BUILD_NUM` varchar(100) DEFAULT NULL COMMENT '构建编号', From 80ac17b2417d79c4b32507857d527d8a029235c2 Mon Sep 17 00:00:00 2001 From: hejieehe <904696180@qq.com> Date: Mon, 23 Oct 2023 20:04:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90PAC=E3=80=91feat=EF=BC=9A=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=BB=8E=E4=BB=A3=E7=A0=81=E5=BA=93=E7=BB=B4=E5=BA=A6?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=AF=B9=E5=BA=94=E7=9A=84=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=BA=93=E4=BA=8B=E4=BB=B6=20#8122?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devops/process/pojo/trigger/PipelineEventReplayInfo.kt | 4 ++-- .../devops/process/engine/service/PipelineWebhookService.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/trigger/PipelineEventReplayInfo.kt b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/trigger/PipelineEventReplayInfo.kt index 193b1242a43..8731bf4fe4c 100644 --- a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/trigger/PipelineEventReplayInfo.kt +++ b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/trigger/PipelineEventReplayInfo.kt @@ -36,8 +36,8 @@ import io.swagger.annotations.ApiModelProperty data class PipelineEventReplayInfo( @ApiModelProperty("触发人") val userId: String -){ - companion object{ +) { + companion object { /** * 获取触发信息 * 若为[重放事件]时,触发人为[回放者],且事件描述采用重放相关文案code diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/engine/service/PipelineWebhookService.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/engine/service/PipelineWebhookService.kt index 749741478fa..8114629f579 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/engine/service/PipelineWebhookService.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/engine/service/PipelineWebhookService.kt @@ -714,7 +714,7 @@ class PipelineWebhookService @Autowired constructor( if (elementRepositoryConfig.getRepositoryId() != webhookRepositoryConfig.getRepositoryId()) { logger.info( "webhook repository config different from element repository config|" + - "webhook:${webhookRepositoryConfig}|element:${elementRepositoryConfig}" + "webhook:$webhookRepositoryConfig|element:$elementRepositoryConfig" ) return@webhook } @@ -746,7 +746,7 @@ class PipelineWebhookService @Autowired constructor( repositoryHashId = repository?.repoHashId ) } catch (ignored: Exception) { - logger.info("update webhook event info error|${webhook}", ignored) + logger.info("update webhook event info error|$webhook", ignored) } } }