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 d36a0f7ed7e4..ed01eca5d8df 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 @@ -30,7 +30,6 @@ package com.tencent.devops.common.pipeline.pojo.element.trigger import com.tencent.devops.common.api.enums.RepositoryType import com.tencent.devops.common.pipeline.enums.StartType import com.tencent.devops.common.pipeline.pojo.element.trigger.enums.CodeEventType -import com.tencent.devops.common.pipeline.pojo.element.trigger.enums.PathFilterType import io.swagger.annotations.ApiModel import io.swagger.annotations.ApiModelProperty @@ -56,20 +55,6 @@ data class CodeGithubWebHookTriggerElement( val repositoryType: RepositoryType? = null, @ApiModelProperty("新版的github代码库名") val repositoryName: String? = null, - @ApiModelProperty("路径过滤类型", required = true) - val pathFilterType: PathFilterType? = PathFilterType.NamePrefixFilter, - @ApiModelProperty("用于包含的路径", required = false) - val includePaths: String? = "", - @ApiModelProperty("用于排除的路径", required = false) - val excludePaths: String? = "", - @ApiModelProperty("用户白名单", required = false) - val includeUsers: String? = null, - @ApiModelProperty("用于排除的源分支名称", required = false) - val excludeSourceBranchName: String? = null, - @ApiModelProperty("用于包含的源分支名称", required = false) - val includeSourceBranchName: String? = null, - @ApiModelProperty("webhook队列", required = false) - val webhookQueue: Boolean? = false, @ApiModelProperty("code review 状态", required = false) val includeCrState: List? = null, @ApiModelProperty("code note comment", required = false) diff --git a/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/pojo/code/github/GithubPullRequestEvent.kt b/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/pojo/code/github/GithubPullRequestEvent.kt index e23fef5b225c..ce9123cb1473 100644 --- a/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/pojo/code/github/GithubPullRequestEvent.kt +++ b/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/pojo/code/github/GithubPullRequestEvent.kt @@ -54,44 +54,6 @@ fun GithubPullRequestEvent.isPrForkNotMergeEvent() = fun GithubPullRequestEvent.isPrForkEvent() = this.pullRequest.base.repo.id != this.pullRequest.head.repo.id -/** - * 以下情况需要同步触发GithubReview事件 - * 1. 重新打开Pr - * 2. Pr请求评审 - * 3. 源分支推送更新 - */ -fun GithubPullRequestEvent.convertGithubReviewEvent(): GithubReviewEvent? { - val review = when (action) { - "opened", "reopened", "synchronize", "review_requested" -> { - GithubReview( - id = pullRequest.id.toLong(), - nodeId = "", - htmlUrl = pullRequest.htmlUrl, - createdAt = pullRequest.createdAt, // 2022-06-21T08:45:41Z - updatedAt = pullRequest.updatedAt, // 2022-06-21T08:45:41Z - user = sender, - body = pullRequest.body, - commitId = pullRequest.head.sha, - submittedAt = pullRequest.updatedAt ?: "", - state = GithubReviewState.APPROVING.value, - pullRequestUrl = pullRequest.htmlUrl, - authorAssociation = "" - ) - } - - else -> { - return null - } - } - return GithubReviewEvent( - repository = repository, - pullRequest = pullRequest, - review = review, - sender = sender, - action = "submitted" - ) -} - @Suppress("ALL") @JsonIgnoreProperties(ignoreUnknown = true) data class GithubPullRequest( diff --git a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/param/GithubWebHookStartParam.kt b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/param/GithubWebHookStartParam.kt index e2f6935d9049..f51dfa3a3d25 100644 --- a/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/param/GithubWebHookStartParam.kt +++ b/src/backend/ci/core/common/common-webhook/biz-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/service/code/param/GithubWebHookStartParam.kt @@ -29,19 +29,11 @@ package com.tencent.devops.common.webhook.service.code.param import com.tencent.devops.common.pipeline.pojo.element.trigger.CodeGithubWebHookTriggerElement import com.tencent.devops.common.pipeline.utils.PIPELINE_GIT_REPO_ID -import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_MANUAL_UNLOCK import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_WEBHOOK_COMMIT_ID 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_EXCLUDE_BRANCHS -import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_WEBHOOK_EXCLUDE_PATHS import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_WEBHOOK_EXCLUDE_USERS -import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_WEBHOOK_FINAL_INCLUDE_BRANCH -import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_WEBHOOK_FINAL_INCLUDE_PATH import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_WEBHOOK_INCLUDE_BRANCHS -import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_WEBHOOK_INCLUDE_PATHS -import com.tencent.devops.common.webhook.pojo.code.BK_REPO_GIT_WEBHOOK_INCLUDE_USERS -import com.tencent.devops.common.webhook.pojo.code.MATCH_BRANCH -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 @@ -69,13 +61,6 @@ class GithubWebHookStartParam : ScmWebhookStartParams