diff --git a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/Element.kt b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/Element.kt index 0f38d87f1af..e4d19faa845 100644 --- a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/Element.kt +++ b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/Element.kt @@ -45,7 +45,6 @@ import com.tencent.devops.common.pipeline.pojo.element.market.MarketCheckImageEl import com.tencent.devops.common.pipeline.pojo.element.matrix.MatrixStatusElement import com.tencent.devops.common.pipeline.pojo.element.quality.QualityGateInElement import com.tencent.devops.common.pipeline.pojo.element.quality.QualityGateOutElement -import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGitGenericWebHookTriggerElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGitWebHookTriggerElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGithubWebHookTriggerElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGitlabWebHookTriggerElement @@ -89,10 +88,6 @@ import io.swagger.annotations.ApiModelProperty JsonSubTypes.Type(value = QualityGateInElement::class, name = QualityGateInElement.classType), JsonSubTypes.Type(value = QualityGateOutElement::class, name = QualityGateOutElement.classType), JsonSubTypes.Type(value = CodeTGitWebHookTriggerElement::class, name = CodeTGitWebHookTriggerElement.classType), - JsonSubTypes.Type( - value = CodeGitGenericWebHookTriggerElement::class, - name = CodeGitGenericWebHookTriggerElement.classType - ), JsonSubTypes.Type(value = CodeP4WebHookTriggerElement::class, name = CodeP4WebHookTriggerElement.classType) ) @Suppress("ALL") diff --git a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeGitGenericWebHookTrigger.kt b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeGitGenericWebHookTrigger.kt deleted file mode 100644 index 49abec0a545..00000000000 --- a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeGitGenericWebHookTrigger.kt +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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.common.pipeline.pojo.element.trigger - -import com.tencent.devops.common.api.enums.RepositoryTypeNew -import com.tencent.devops.common.pipeline.pojo.element.trigger.enums.CodeEventType -import io.swagger.annotations.ApiModel -import io.swagger.annotations.ApiModelProperty - -@ApiModel("Git通用事件触发", description = CodeGitGenericWebHookTriggerElement.classType) -data class CodeGitGenericWebHookTriggerElement( - @ApiModelProperty("任务名称", required = true) - override val name: String = "TGit变更触发", - @ApiModelProperty("id", required = false) - override var id: String? = null, - @ApiModelProperty("状态", required = false) - override var status: String? = null, - @ApiModelProperty("数据", required = true) - val data: CodeGitGenericWebHookTriggerData -) : WebHookTriggerElement(name, id, status) { - companion object { - const val classType = "codeGitGenericWebHookTrigger" - } - - override fun getClassType() = classType -} - -data class CodeGitGenericWebHookTriggerData( - @ApiModelProperty("Git通用事件触发数据", required = true) - val input: CodeGitGenericWebHookTriggerInput -) - -data class CodeGitGenericWebHookTriggerInput( - @ApiModelProperty("代码库类型", required = true) - val scmType: String, - @ApiModelProperty("代码库类型") - val repositoryType: RepositoryTypeNew? = null, - @ApiModelProperty("仓库ID", required = true) - val repositoryHashId: String?, - @ApiModelProperty("代码库名") - val repositoryName: String? = null, - @ApiModelProperty("代码库链接", required = true) - val repositoryUrl: String, - @ApiModelProperty("凭证ID", required = false) - val credentialId: String? = null, - @ApiModelProperty("凭证ID", required = false) - val token: String? = null, - @ApiModelProperty("触发事件", required = true) - val eventType: String = CodeEventType.PUSH.name, - @ApiModelProperty("hook地址,目前只对codecc开放", required = false) - var hookUrl: String? = null, - @ApiModelProperty("分支", required = false) - val branchName: String?, - @ApiModelProperty("用于排除的分支名", required = false) - val excludeBranchName: String?, - @ApiModelProperty("用于包含的路径", required = false) - val includePaths: String?, - @ApiModelProperty("相对路径", required = true) - val relativePath: String?, - @ApiModelProperty("用于排除的路径", required = false) - val excludePaths: String?, - @ApiModelProperty("用于排除的user id", required = false) - val excludeUsers: List?, - @ApiModelProperty("用户白名单", required = false) - val includeUsers: List?, - @ApiModelProperty("是否为block", required = false) - val block: Boolean?, - @ApiModelProperty("tag名称", required = false) - val tagName: String? = null, - @ApiModelProperty("用于排除的tag名称", required = false) - val excludeTagName: String? = null, - @ApiModelProperty("用于排除的源分支名称", required = false) - val excludeSourceBranchName: String? = null, - @ApiModelProperty("用于包含的源分支名称", required = false) - val includeSourceBranchName: String? = null -) diff --git a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeGithubWebHookTriggerElement.kt b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeGithubWebHookTriggerElement.kt index c01b3075e81..bf648a0ba60 100644 --- a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeGithubWebHookTriggerElement.kt +++ b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeGithubWebHookTriggerElement.kt @@ -63,6 +63,8 @@ data class CodeGithubWebHookTriggerElement( override fun getClassType() = classType + override fun getTaskAtom() = taskAtom + override fun findFirstTaskIdByStartType(startType: StartType): String { return if (startType.name == StartType.WEB_HOOK.name) { this.id!! diff --git a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeGitlabWebHookTriggerElement.kt b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeGitlabWebHookTriggerElement.kt index baacd99fe62..642eaceabe4 100644 --- a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeGitlabWebHookTriggerElement.kt +++ b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeGitlabWebHookTriggerElement.kt @@ -86,6 +86,8 @@ data class CodeGitlabWebHookTriggerElement( override fun getClassType() = classType + override fun getTaskAtom() = taskAtom + override fun findFirstTaskIdByStartType(startType: StartType): String { return if (startType.name == StartType.WEB_HOOK.name) { this.id!! diff --git a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeP4WebHookTriggerElement.kt b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeP4WebHookTriggerElement.kt index e32775e87c9..3c247a3917a 100644 --- a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeP4WebHookTriggerElement.kt +++ b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeP4WebHookTriggerElement.kt @@ -51,6 +51,8 @@ data class CodeP4WebHookTriggerElement( override fun getClassType() = classType + override fun getTaskAtom() = taskAtom + override fun findFirstTaskIdByStartType(startType: StartType): String { return if (startType.name == StartType.WEB_HOOK.name) { this.id!! diff --git a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeSVNWebHookTriggerElement.kt b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeSVNWebHookTriggerElement.kt index 27a89db06f0..8206107b4c1 100644 --- a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeSVNWebHookTriggerElement.kt +++ b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeSVNWebHookTriggerElement.kt @@ -65,6 +65,8 @@ data class CodeSVNWebHookTriggerElement( override fun getClassType() = classType + override fun getTaskAtom() = taskAtom + override fun findFirstTaskIdByStartType(startType: StartType): String { return if (startType.name == StartType.WEB_HOOK.name) { this.id!! diff --git a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeTGitWebHookTriggerElement.kt b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeTGitWebHookTriggerElement.kt index 27efbe580fc..c72220db6c1 100644 --- a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeTGitWebHookTriggerElement.kt +++ b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/pojo/element/trigger/CodeTGitWebHookTriggerElement.kt @@ -52,6 +52,8 @@ data class CodeTGitWebHookTriggerElement( override fun getClassType() = classType + override fun getTaskAtom() = taskAtom + override fun findFirstTaskIdByStartType(startType: StartType): String { return if (startType.name == StartType.WEB_HOOK.name) { this.id!! diff --git a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/utils/RepositoryConfigUtils.kt b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/utils/RepositoryConfigUtils.kt index db6a41d50d2..11524943f51 100644 --- a/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/utils/RepositoryConfigUtils.kt +++ b/src/backend/ci/core/common/common-pipeline/src/main/kotlin/com/tencent/devops/common/pipeline/utils/RepositoryConfigUtils.kt @@ -29,7 +29,6 @@ package com.tencent.devops.common.pipeline.utils import com.tencent.devops.common.api.enums.RepositoryConfig import com.tencent.devops.common.api.enums.RepositoryType -import com.tencent.devops.common.api.enums.RepositoryTypeNew import com.tencent.devops.common.api.exception.InvalidParamException import com.tencent.devops.common.api.util.EnvUtils import com.tencent.devops.common.pipeline.pojo.element.Element @@ -37,7 +36,6 @@ import com.tencent.devops.common.pipeline.pojo.element.agent.CodeGitElement import com.tencent.devops.common.pipeline.pojo.element.agent.CodeGitlabElement import com.tencent.devops.common.pipeline.pojo.element.agent.CodeSvnElement import com.tencent.devops.common.pipeline.pojo.element.agent.GithubElement -import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGitGenericWebHookTriggerElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGitWebHookTriggerElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGithubWebHookTriggerElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGitlabWebHookTriggerElement @@ -95,32 +93,6 @@ object RepositoryConfigUtils { repositoryName = element.data.input.repositoryName, repositoryType = element.data.input.repositoryType ?: RepositoryType.ID ) - is CodeGitGenericWebHookTriggerElement -> { - with(element.data.input) { - when (repositoryType) { - RepositoryTypeNew.URL -> - RepositoryConfig( - repositoryHashId = null, - repositoryName = repositoryUrl, - repositoryType = RepositoryType.NAME - ) - RepositoryTypeNew.ID -> - RepositoryConfig( - repositoryHashId = repositoryHashId, - repositoryName = repositoryName, - repositoryType = RepositoryType.ID - ) - RepositoryTypeNew.NAME -> - RepositoryConfig( - repositoryHashId = repositoryHashId, - repositoryName = repositoryName, - repositoryType = RepositoryType.NAME - ) - else -> - throw InvalidParamException("Unknown repositoryType -> $element") - } - } - } is CodeP4WebHookTriggerElement -> RepositoryConfig( repositoryHashId = element.data.input.repositoryHashId, repositoryName = element.data.input.repositoryName, diff --git a/src/backend/ci/core/common/common-pipeline/src/test/kotlin/com/tencent/devops/common/pipeline/enums/EnvControlTaskTypeTest.kt b/src/backend/ci/core/common/common-pipeline/src/test/kotlin/com/tencent/devops/common/pipeline/enums/EnvControlTaskTypeTest.kt index 4b2538a3478..cadb56ee2bc 100644 --- a/src/backend/ci/core/common/common-pipeline/src/test/kotlin/com/tencent/devops/common/pipeline/enums/EnvControlTaskTypeTest.kt +++ b/src/backend/ci/core/common/common-pipeline/src/test/kotlin/com/tencent/devops/common/pipeline/enums/EnvControlTaskTypeTest.kt @@ -41,7 +41,6 @@ import com.tencent.devops.common.pipeline.pojo.element.market.MarketCheckImageEl import com.tencent.devops.common.pipeline.pojo.element.matrix.MatrixStatusElement import com.tencent.devops.common.pipeline.pojo.element.quality.QualityGateInElement import com.tencent.devops.common.pipeline.pojo.element.quality.QualityGateOutElement -import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGitGenericWebHookTriggerElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGitWebHookTriggerElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGithubWebHookTriggerElement import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGitlabWebHookTriggerElement @@ -68,7 +67,6 @@ class EnvControlTaskTypeTest { assertEquals(EnvControlTaskType.parse(""), actualNull) assertEquals(EnvControlTaskType.parse("nullActual"), actualNull) assertEquals(EnvControlTaskType.parse("Other"), actualNull) - assertEquals(EnvControlTaskType.parse(CodeGitGenericWebHookTriggerElement.classType), actualNull) assertEquals(EnvControlTaskType.parse(CodeP4WebHookTriggerElement.classType), actualNull) assertEquals(EnvControlTaskType.parse(MatrixStatusElement.classType), actualNull) assertEquals(EnvControlTaskType.parse(CodeGitWebHookTriggerElement.classType), actualNull) diff --git a/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/dao/process/ProcessDataMigrateDao.kt b/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/dao/process/ProcessDataMigrateDao.kt index f94d8038f1a..71e603f388f 100644 --- a/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/dao/process/ProcessDataMigrateDao.kt +++ b/src/backend/ci/core/misc/biz-misc/src/main/kotlin/com/tencent/devops/misc/dao/process/ProcessDataMigrateDao.kt @@ -58,7 +58,6 @@ import com.tencent.devops.model.process.tables.TPipelineViewGroup import com.tencent.devops.model.process.tables.TPipelineViewTop import com.tencent.devops.model.process.tables.TPipelineViewUserLastView import com.tencent.devops.model.process.tables.TPipelineViewUserSettings -import com.tencent.devops.model.process.tables.TPipelineWebhookBuildLogDetail import com.tencent.devops.model.process.tables.TPipelineWebhookBuildParameter import com.tencent.devops.model.process.tables.TPipelineWebhookQueue import com.tencent.devops.model.process.tables.TProjectPipelineCallback @@ -97,7 +96,6 @@ import com.tencent.devops.model.process.tables.records.TPipelineViewRecord import com.tencent.devops.model.process.tables.records.TPipelineViewTopRecord import com.tencent.devops.model.process.tables.records.TPipelineViewUserLastViewRecord import com.tencent.devops.model.process.tables.records.TPipelineViewUserSettingsRecord -import com.tencent.devops.model.process.tables.records.TPipelineWebhookBuildLogDetailRecord import com.tencent.devops.model.process.tables.records.TPipelineWebhookBuildParameterRecord import com.tencent.devops.model.process.tables.records.TPipelineWebhookQueueRecord import com.tencent.devops.model.process.tables.records.TProjectPipelineCallbackHistoryRecord @@ -653,31 +651,6 @@ class ProcessDataMigrateDao { } } - fun getPipelineWebhookBuildLogDetailRecords( - dslContext: DSLContext, - projectId: String, - pipelineId: String, - limit: Int, - offset: Int - ): List { - with(TPipelineWebhookBuildLogDetail.T_PIPELINE_WEBHOOK_BUILD_LOG_DETAIL) { - return dslContext.selectFrom(this) - .where(PROJECT_ID.eq(projectId).and(PIPELINE_ID.eq(pipelineId))) - .orderBy(ID.asc()) - .limit(limit).offset(offset).fetchInto(TPipelineWebhookBuildLogDetailRecord::class.java) - } - } - - fun migratePipelineWebhookBuildLogDetailData( - migratingShardingDslContext: DSLContext, - webhookBuildLogDetailRecords: List - ) { - with(TPipelineWebhookBuildLogDetail.T_PIPELINE_WEBHOOK_BUILD_LOG_DETAIL) { - val insertRecords = webhookBuildLogDetailRecords.map { migratingShardingDslContext.newRecord(this, it) } - migratingShardingDslContext.batchInsert(insertRecords).execute() - } - } - fun getPipelineWebhookQueueRecords( dslContext: DSLContext, projectId: String,