Moved cancelling pending builds to be done before setting build status pending.
The other order caused problems when the pending build had the same commit as the new one: the build for the commit was shown as cancelled in Gitlab even though it was pending in Jenkins.
This commit is contained in:
parent
70773f3f83
commit
3cec22aefb
|
@ -48,8 +48,8 @@ public abstract class AbstractWebHookTriggerHandler<H extends WebHook> implement
|
|||
String targetBranch = getTargetBranch(hook);
|
||||
if (branchFilter.isBranchAllowed(targetBranch)) {
|
||||
LOGGER.log(Level.INFO, "{0} triggered for {1}.", LoggerUtil.toArray(job.getFullName(), getTriggerType()));
|
||||
setCommitStatusPendingIfNecessary(job, hook);
|
||||
cancelPendingBuildsIfNecessary(job, hook);
|
||||
setCommitStatusPendingIfNecessary(job, hook);
|
||||
scheduleBuild(job, createActions(job, hook));
|
||||
} else {
|
||||
LOGGER.log(Level.INFO, "branch {0} is not allowed", targetBranch);
|
||||
|
|
Loading…
Reference in New Issue