fix: Make git push operation atomic (#32777)
This commit is contained in:
parent
97e3791d3a
commit
3b45db6df6
|
|
@ -225,6 +225,7 @@ public class GitExecutorCEImpl implements GitExecutor {
|
||||||
|
|
||||||
StringBuilder result = new StringBuilder("Pushed successfully with status : ");
|
StringBuilder result = new StringBuilder("Pushed successfully with status : ");
|
||||||
git.push()
|
git.push()
|
||||||
|
.setAtomic(true)
|
||||||
.setTransportConfigCallback(transportConfigCallback)
|
.setTransportConfigCallback(transportConfigCallback)
|
||||||
.setRemote(remoteUrl)
|
.setRemote(remoteUrl)
|
||||||
.call()
|
.call()
|
||||||
|
|
|
||||||
|
|
@ -3077,11 +3077,11 @@ public class GitServiceCEImpl implements GitServiceCE {
|
||||||
auth.getPublicKey(),
|
auth.getPublicKey(),
|
||||||
auth.getPrivateKey(),
|
auth.getPrivateKey(),
|
||||||
gitArtifactMetadata.getBranchName())
|
gitArtifactMetadata.getBranchName())
|
||||||
.map(pushResult -> {
|
.flatMap(pushResult -> {
|
||||||
if (pushResult.contains("REJECTED")) {
|
if (pushResult.contains("REJECTED")) {
|
||||||
throw new AppsmithException(AppsmithError.GIT_UPSTREAM_CHANGES);
|
return Mono.error(new AppsmithException(AppsmithError.GIT_UPSTREAM_CHANGES));
|
||||||
}
|
}
|
||||||
return pushResult;
|
return Mono.just(pushResult);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user