diff --git a/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/pojo/code/WebhookConstant.kt b/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/pojo/code/WebhookConstant.kt index b4d21979c6c..1b7ecaeb511 100644 --- a/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/pojo/code/WebhookConstant.kt +++ b/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/pojo/code/WebhookConstant.kt @@ -121,6 +121,7 @@ const val BK_REPO_SVN_WEBHOOK_RELATIVE_PATH = "BK_CI_REPO_SVN_WEBHOOK_INCLUDE_PA const val BK_REPO_SVN_WEBHOOK_EXCLUDE_PATHS = "BK_CI_REPO_SVN_WEBHOOK_EXCLUDE_PATHS" const val BK_REPO_SVN_WEBHOOK_INCLUDE_USERS = "BK_CI_REPO_SVN_WEBHOOK_INCLUDE_USERS" const val BK_REPO_SVN_WEBHOOK_EXCLUDE_USERS = "BK_CI_REPO_SVN_WEBHOOK_EXCLUDE_USERS" +const val BK_REPO_SVN_WEBHOOK_FINAL_INCLUDE_PATH = "BK_REPO_SVN_WEBHOOK_FINAL_INCLUDE_PATH" const val PIPELINE_WEBHOOK_MR_ID = "BK_CI_HOOK_MR_ID" // bk_hookMergeRequestId const val PIPELINE_WEBHOOK_MR_COMMITTER = "BK_CI_HOOK_MR_COMMITTER" // "bk_hookMergeRequest_committer" diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/param/SvnWebHookStartParam.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/param/SvnWebHookStartParam.kt index 3f6d0a77ced..af3f0c82b22 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/param/SvnWebHookStartParam.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/param/SvnWebHookStartParam.kt @@ -30,8 +30,10 @@ package com.tencent.devops.common.webhook.service.code.param import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeSVNWebHookTriggerElement import com.tencent.devops.common.webhook.pojo.code.BK_REPO_SVN_WEBHOOK_EXCLUDE_PATHS import com.tencent.devops.common.webhook.pojo.code.BK_REPO_SVN_WEBHOOK_EXCLUDE_USERS +import com.tencent.devops.common.webhook.pojo.code.BK_REPO_SVN_WEBHOOK_FINAL_INCLUDE_PATH import com.tencent.devops.common.webhook.pojo.code.BK_REPO_SVN_WEBHOOK_INCLUDE_USERS import com.tencent.devops.common.webhook.pojo.code.BK_REPO_SVN_WEBHOOK_RELATIVE_PATH +import com.tencent.devops.common.webhook.pojo.code.MATCH_PATHS import com.tencent.devops.common.webhook.pojo.code.WebHookParams import com.tencent.devops.common.webhook.service.code.matcher.ScmWebhookMatcher import com.tencent.devops.repository.pojo.Repository @@ -58,6 +60,7 @@ class SvnWebHookStartParam : ScmWebhookStartParams startParams[BK_REPO_SVN_WEBHOOK_EXCLUDE_PATHS] = element.excludePaths ?: "" startParams[BK_REPO_SVN_WEBHOOK_INCLUDE_USERS] = element.includeUsers?.joinToString(",") ?: "" startParams[BK_REPO_SVN_WEBHOOK_EXCLUDE_USERS] = element.excludeUsers?.joinToString(",") ?: "" + startParams[BK_REPO_SVN_WEBHOOK_FINAL_INCLUDE_PATH] = matchResult.extra[MATCH_PATHS] ?: "" startParams.putAll(matcher.retrieveParams()) return startParams } diff --git a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/code/WebhookInfo.kt b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/code/WebhookInfo.kt index aefd26a1d3e..467c36a360e 100644 --- a/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/code/WebhookInfo.kt +++ b/src/backend/ci/core/process/api-process/src/main/kotlin/com/tencent/devops/process/pojo/code/WebhookInfo.kt @@ -35,5 +35,7 @@ data class WebhookInfo( val webhookMessage: String?, val webhookCommitId: String?, // 合并后commitId - val webhookMergeCommitSha: String? + val webhookMergeCommitSha: String?, + // 源分支 + val webhookSourceBranch: String? ) diff --git a/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/service/PipelineRuntimeService.kt b/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/service/PipelineRuntimeService.kt index a991742b538..f0566691559 100644 --- a/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/service/PipelineRuntimeService.kt +++ b/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/engine/service/PipelineRuntimeService.kt @@ -69,6 +69,7 @@ import com.tencent.devops.common.redis.RedisOperation import com.tencent.devops.common.service.trace.TraceTag import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_WEBHOOK_EVENT_TYPE import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_WEBHOOK_MR_MERGE_COMMIT_SHA +import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_WEBHOOK_MR_SOURCE_BRANCH import com.tencent.devops.common.webhook.pojo.code.BK_REPO_WEBHOOK_REPO_URL import com.tencent.devops.common.webhook.pojo.code.PIPELINE_WEBHOOK_BRANCH import com.tencent.devops.common.webhook.pojo.code.PIPELINE_WEBHOOK_COMMIT_MESSAGE @@ -1144,7 +1145,8 @@ class PipelineRuntimeService @Autowired constructor( params[PIPELINE_WEBHOOK_EVENT_TYPE] as String? }, webhookCommitId = params[PIPELINE_WEBHOOK_REVISION] as String?, - webhookMergeCommitSha = params[BK_REPO_GIT_WEBHOOK_MR_MERGE_COMMIT_SHA] as String? + webhookMergeCommitSha = params[BK_REPO_GIT_WEBHOOK_MR_MERGE_COMMIT_SHA] as String?, + webhookSourceBranch = params[BK_REPO_GIT_WEBHOOK_MR_SOURCE_BRANCH] as String? ), formatted = false ) diff --git a/src/backend/ci/core/process/plugin-trigger/src/main/kotlin/com/tencent/devops/process/plugin/trigger/timer/quartz/PipelineQuartzService.kt b/src/backend/ci/core/process/plugin-trigger/src/main/kotlin/com/tencent/devops/process/plugin/trigger/timer/quartz/PipelineQuartzService.kt index 37a6fed17e9..39baa4317ad 100644 --- a/src/backend/ci/core/process/plugin-trigger/src/main/kotlin/com/tencent/devops/process/plugin/trigger/timer/quartz/PipelineQuartzService.kt +++ b/src/backend/ci/core/process/plugin-trigger/src/main/kotlin/com/tencent/devops/process/plugin/trigger/timer/quartz/PipelineQuartzService.kt @@ -147,7 +147,7 @@ class PipelineJobBean( fun execute(context: JobExecutionContext?) { val jobKey = context?.jobDetail?.key ?: return val comboKey = jobKey.name - val comboKeys = comboKey.split("_") + val comboKeys = comboKey.split(Regex("_"), 3) val pipelineId = comboKeys[0] val crontabMd5 = comboKeys[1] val projectId = comboKeys[2]