Skip to content

Commit

Permalink
Revert "For gh-133. Try again when special error occurs"
Browse files Browse the repository at this point in the history
This reverts commit 6166aa8.
  • Loading branch information
MadsNielsen committed Aug 16, 2018
1 parent 4950e26 commit 365a4e8
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
import org.jenkinsci.plugins.gitclient.MergeCommand;
import org.jenkinsci.plugins.pretestedintegration.IntegrationStrategy;
import org.jenkinsci.plugins.pretestedintegration.IntegrationStrategyDescriptor;
import org.jenkinsci.plugins.pretestedintegration.exceptions.*;
import org.jenkinsci.plugins.pretestedintegration.exceptions.EstablishingWorkspaceFailedException;
import org.jenkinsci.plugins.pretestedintegration.exceptions.IntegrationFailedException;
import org.jenkinsci.plugins.pretestedintegration.exceptions.NothingToDoException;
import org.jenkinsci.plugins.pretestedintegration.exceptions.UnsupportedConfigurationException;
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
import org.kohsuke.stapler.DataBoundConstructor;

Expand Down Expand Up @@ -136,19 +139,10 @@ public Revision decorateRevisionToBuild(
if(run.getActions(PretestTriggerCommitAction.class).isEmpty() ) {
GitIntegrationStrategy gitStrategy = (GitIntegrationStrategy)gitBridge.integrationStrategy;
gitStrategy.integrateAsGitPluginExt(scm, run, git, listener, marked, triggeredBranch, gitBridge);

//For AccumulatedCommit and in pipeline, immediately push back the merge result
if(gitStrategy instanceof AccumulatedCommitStrategy && run instanceof WorkflowRun) {
try {
GitBridge.pushToBranch(listener, git, expandedIntegrationBranch, triggeredBranch.getName(), repoName);
} catch (GitException fex) {
if(fex.getMessage().contains("error: cannot lock ref")) {
//Something is wrong on the remote...try again
LOGGER.log(Level.WARNING, LOG_PREFIX + "Failed to push...retying in 5 seconds");
listener.getLogger().println(LOG_PREFIX + "Failed to push...retying in 5 seconds");
Thread.sleep(5000);
GitBridge.pushToBranch(listener, git, expandedIntegrationBranch, triggeredBranch.getName(), repoName);
}
}
GitBridge.pushToBranch(listener, git, expandedIntegrationBranch, triggeredBranch.getName(), repoName);
}
run.addAction(new PretestTriggerCommitAction(triggeredBranch, expandedIntegrationBranch, expandedRepo, ucCredentialsId));
} else {
Expand Down

0 comments on commit 365a4e8

Please sign in to comment.