diff --git a/README_zh_CN.md b/README_zh_CN.md index 90e8f32..6de533d 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -35,7 +35,7 @@ Gitee Jenkins Plugin 是码云基于 [GitLab Plugin](https://github.com/jenkinsc - 设置 WebHook 验证密码。 - 构建后操作可配置 PR 触发的构建结果评论到码云对应的PR中。 - 构建后操作可配置 PR 触发的构建成功后可自动合并对应PR。 -- 不可自动合并的PR不触发构建,且若配置了评论到PR的功能,则评论到 PR 提示冲突。 +- 对于 PR 相关的所有事件,若 PR 代码冲突不可自动合并,则不触发构建;且若配置了评论到PR的功能,则评论到 PR 提示冲突。 ## 计划中特性 - PR 审查并测试通过触发构建。 diff --git a/src/main/java/com/gitee/jenkins/gitee/api/impl/GiteeV5ApiProxy.java b/src/main/java/com/gitee/jenkins/gitee/api/impl/GiteeV5ApiProxy.java index c8d49b4..8eeb6ee 100644 --- a/src/main/java/com/gitee/jenkins/gitee/api/impl/GiteeV5ApiProxy.java +++ b/src/main/java/com/gitee/jenkins/gitee/api/impl/GiteeV5ApiProxy.java @@ -16,7 +16,7 @@ interface GiteeV5ApiProxy extends GiteeApiProxy { @PUT @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - @Path("/repos/{ownerPath}/{repoPath}/pulls/{prNumber}/merge") + @Path("/repos/{ownerPath}/{repoPath}/pulls/{prNumber}/pull") void acceptPullRequest(@PathParam("ownerPath") String ownerPath, @PathParam("repoPath") String repoPath, @PathParam("prNumber") Integer prNumber); diff --git a/src/main/java/com/gitee/jenkins/gitee/hook/model/PullRequestHook.java b/src/main/java/com/gitee/jenkins/gitee/hook/model/PullRequestHook.java index 8d89808..cfe5ca5 100644 --- a/src/main/java/com/gitee/jenkins/gitee/hook/model/PullRequestHook.java +++ b/src/main/java/com/gitee/jenkins/gitee/hook/model/PullRequestHook.java @@ -80,7 +80,7 @@ public class PullRequestHook extends WebHook { } public String getWebHookDescription() { - return getHookName() + " iid = " + pullRequest.getNumber() + " merge commit sha = " + pullRequest.getMergeCommitSha(); + return getHookName() + " iid = " + pullRequest.getNumber() + " pull commit sha = " + pullRequest.getMergeCommitSha(); } @Override diff --git a/src/main/java/com/gitee/jenkins/trigger/GiteePushTrigger.java b/src/main/java/com/gitee/jenkins/trigger/GiteePushTrigger.java index 00b947c..192f8aa 100644 --- a/src/main/java/com/gitee/jenkins/trigger/GiteePushTrigger.java +++ b/src/main/java/com/gitee/jenkins/trigger/GiteePushTrigger.java @@ -12,7 +12,7 @@ import com.gitee.jenkins.publisher.GiteeAcceptPullRequestPublisher; import com.gitee.jenkins.publisher.GiteeMessagePublisher; import com.gitee.jenkins.trigger.filter.*; import com.gitee.jenkins.trigger.filter.PullRequestLabelFilterConfig; -import com.gitee.jenkins.trigger.handler.merge.PullRequestHookTriggerHandler; +import com.gitee.jenkins.trigger.handler.pull.PullRequestHookTriggerHandler; import com.gitee.jenkins.trigger.handler.note.NoteHookTriggerHandler; import com.gitee.jenkins.trigger.handler.pipeline.PipelineHookTriggerHandler; import com.gitee.jenkins.trigger.handler.push.PushHookTriggerHandler; @@ -47,7 +47,7 @@ import java.io.ObjectStreamException; import java.security.SecureRandom; import static com.gitee.jenkins.trigger.filter.BranchFilterConfig.BranchFilterConfigBuilder.branchFilterConfig; -import static com.gitee.jenkins.trigger.handler.merge.PullRequestHookTriggerHandlerFactory.newPullRequestHookTriggerHandler; +import static com.gitee.jenkins.trigger.handler.pull.PullRequestHookTriggerHandlerFactory.newPullRequestHookTriggerHandler; import static com.gitee.jenkins.trigger.handler.note.NoteHookTriggerHandlerFactory.newNoteHookTriggerHandler; import static com.gitee.jenkins.trigger.handler.pipeline.PipelineHookTriggerHandlerFactory.newPipelineHookTriggerHandler; import static com.gitee.jenkins.trigger.handler.push.PushHookTriggerHandlerFactory.newPushHookTriggerHandler; diff --git a/src/main/java/com/gitee/jenkins/trigger/handler/merge/NopPullRequestHookTriggerHandler.java b/src/main/java/com/gitee/jenkins/trigger/handler/pull/NopPullRequestHookTriggerHandler.java similarity index 91% rename from src/main/java/com/gitee/jenkins/trigger/handler/merge/NopPullRequestHookTriggerHandler.java rename to src/main/java/com/gitee/jenkins/trigger/handler/pull/NopPullRequestHookTriggerHandler.java index 438b3c2..14ddcc1 100644 --- a/src/main/java/com/gitee/jenkins/trigger/handler/merge/NopPullRequestHookTriggerHandler.java +++ b/src/main/java/com/gitee/jenkins/trigger/handler/pull/NopPullRequestHookTriggerHandler.java @@ -1,4 +1,4 @@ -package com.gitee.jenkins.trigger.handler.merge; +package com.gitee.jenkins.trigger.handler.pull; import com.gitee.jenkins.gitee.hook.model.PullRequestHook; import com.gitee.jenkins.trigger.filter.BranchFilter; diff --git a/src/main/java/com/gitee/jenkins/trigger/handler/merge/PullRequestHookTriggerHandler.java b/src/main/java/com/gitee/jenkins/trigger/handler/pull/PullRequestHookTriggerHandler.java similarity index 83% rename from src/main/java/com/gitee/jenkins/trigger/handler/merge/PullRequestHookTriggerHandler.java rename to src/main/java/com/gitee/jenkins/trigger/handler/pull/PullRequestHookTriggerHandler.java index 71cde48..72178ba 100644 --- a/src/main/java/com/gitee/jenkins/trigger/handler/merge/PullRequestHookTriggerHandler.java +++ b/src/main/java/com/gitee/jenkins/trigger/handler/pull/PullRequestHookTriggerHandler.java @@ -1,4 +1,4 @@ -package com.gitee.jenkins.trigger.handler.merge; +package com.gitee.jenkins.trigger.handler.pull; import com.gitee.jenkins.gitee.hook.model.PullRequestHook; import com.gitee.jenkins.trigger.handler.WebHookTriggerHandler; diff --git a/src/main/java/com/gitee/jenkins/trigger/handler/merge/PullRequestHookTriggerHandlerFactory.java b/src/main/java/com/gitee/jenkins/trigger/handler/pull/PullRequestHookTriggerHandlerFactory.java similarity index 98% rename from src/main/java/com/gitee/jenkins/trigger/handler/merge/PullRequestHookTriggerHandlerFactory.java rename to src/main/java/com/gitee/jenkins/trigger/handler/pull/PullRequestHookTriggerHandlerFactory.java index 4792d6d..db1ffc8 100644 --- a/src/main/java/com/gitee/jenkins/trigger/handler/merge/PullRequestHookTriggerHandlerFactory.java +++ b/src/main/java/com/gitee/jenkins/trigger/handler/pull/PullRequestHookTriggerHandlerFactory.java @@ -1,4 +1,4 @@ -package com.gitee.jenkins.trigger.handler.merge; +package com.gitee.jenkins.trigger.handler.pull; import com.gitee.jenkins.gitee.hook.model.Action; import com.gitee.jenkins.gitee.hook.model.State; diff --git a/src/main/java/com/gitee/jenkins/trigger/handler/merge/PullRequestHookTriggerHandlerImpl.java b/src/main/java/com/gitee/jenkins/trigger/handler/pull/PullRequestHookTriggerHandlerImpl.java similarity index 97% rename from src/main/java/com/gitee/jenkins/trigger/handler/merge/PullRequestHookTriggerHandlerImpl.java rename to src/main/java/com/gitee/jenkins/trigger/handler/pull/PullRequestHookTriggerHandlerImpl.java index 86f621c..181f2aa 100644 --- a/src/main/java/com/gitee/jenkins/trigger/handler/merge/PullRequestHookTriggerHandlerImpl.java +++ b/src/main/java/com/gitee/jenkins/trigger/handler/pull/PullRequestHookTriggerHandlerImpl.java @@ -1,4 +1,4 @@ -package com.gitee.jenkins.trigger.handler.merge; +package com.gitee.jenkins.trigger.handler.pull; import com.gitee.jenkins.cause.CauseData; import com.gitee.jenkins.cause.GiteeWebHookCause; @@ -7,7 +7,6 @@ import com.gitee.jenkins.gitee.api.model.PullRequest; import com.gitee.jenkins.gitee.hook.model.*; import com.gitee.jenkins.gitee.hook.model.PullRequestHook; import com.gitee.jenkins.publisher.GiteeMessagePublisher; -import com.gitee.jenkins.trigger.GiteePushTrigger; import com.gitee.jenkins.trigger.exception.NoRevisionToBuildException; import com.gitee.jenkins.trigger.filter.BranchFilter; import com.gitee.jenkins.trigger.filter.PullRequestLabelFilter; @@ -71,13 +70,13 @@ class PullRequestHookTriggerHandlerImpl extends AbstractWebHookTriggerHandler