!13 评论触发人显示错误修复

Merge pull request !13 from silverballer/1.2.5
This commit is contained in:
Yashin 2021-02-20 10:25:29 +08:00 committed by Gitee
commit f8da78cbf5
4 changed files with 16 additions and 4 deletions

View File

@ -14,6 +14,7 @@ public abstract class WebHook {
private String objectKind;
private String hookName;
private String jsonBody;
private User sender;
public String getJsonBody() { return this.jsonBody; }
@ -43,6 +44,14 @@ public abstract class WebHook {
this.repository = repository;
}
public User getSender() {
return sender;
}
public void setSender(User sender) {
this.sender = sender;
}
public String getWebHookDescription() {
return hookName;
}
@ -60,6 +69,7 @@ public abstract class WebHook {
.append(repository, webHook.repository)
.append(objectKind, webHook.objectKind)
.append(hookName, webHook.hookName)
.append(sender, webHook.sender)
.isEquals();
}
@ -69,6 +79,7 @@ public abstract class WebHook {
.append(repository)
.append(hookName)
.append(objectKind)
.append(sender)
.toHashCode();
}
@ -78,6 +89,7 @@ public abstract class WebHook {
.append("repository", repository)
.append("hookName", hookName)
.append("objectKind", objectKind)
.append("sender", sender)
.toString();
}
}

View File

@ -170,7 +170,7 @@ class NoteHookTriggerHandlerImpl extends AbstractWebHookTriggerHandler<NoteHook>
.withTargetNamespace(hook.getProject().getNamespace())
.withTargetRepoSshUrl(hook.getProject().getSshUrl())
.withTargetRepoHttpUrl(hook.getProject().getGitHttpUrl())
.withTriggeredByUser(hook.getComment().getUser().getName())
.withTriggeredByUser(hook.getSender().getName())
.withTriggerPhrase(hook.getComment().getBody())
.withSha(hook.getComment().getCommitId())
.withPathWithNamespace(hook.getProject().getPathWithNamespace())
@ -201,7 +201,7 @@ class NoteHookTriggerHandlerImpl extends AbstractWebHookTriggerHandler<NoteHook>
.withTargetNamespace(hook.getPullRequest().getTarget().getNamespace())
.withTargetRepoSshUrl(hook.getPullRequest().getTarget().getSshUrl())
.withTargetRepoHttpUrl(hook.getPullRequest().getTarget().getGitHttpUrl())
.withTriggeredByUser(hook.getPullRequest().getHead().getUser().getName())
.withTriggeredByUser(hook.getSender().getName())
.withLastCommit(hook.getPullRequest().getMergeCommitSha())
.withSha(hook.getPullRequest().getMergeCommitSha())
.withAfter(hook.getPullRequest().getMergeCommitSha())

View File

@ -228,7 +228,7 @@ class PullRequestHookTriggerHandlerImpl extends AbstractWebHookTriggerHandler<Pu
.withTargetNamespace(hook.getPullRequest().getTarget().getNamespace())
.withTargetRepoSshUrl(hook.getPullRequest().getTarget().getSshUrl())
.withTargetRepoHttpUrl(hook.getPullRequest().getTarget().getGitHttpUrl())
.withTriggeredByUser(hook.getPullRequest().getHead().getUser().getName())
.withTriggeredByUser(hook.getSender().getName())
.withLastCommit(hook.getPullRequest().getMergeCommitSha())
.withSha(hook.getPullRequest().getMergeCommitSha())
.withAfter(hook.getPullRequest().getMergeCommitSha())

View File

@ -92,7 +92,7 @@ class PushHookTriggerHandlerImpl extends AbstractWebHookTriggerHandler<PushHook>
.withTargetNamespace("")
.withTargetRepoSshUrl("")
.withTargetRepoHttpUrl("")
.withTriggeredByUser(retrievePushedBy(hook))
.withTriggeredByUser(hook.getSender().getName())
.withBefore(hook.getBefore())
.withAfter(hook.getAfter())
.withRef(hook.getRef())