Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1988,30 +1988,29 @@ private Mono<GitPullDTO> pullAndRehydrateArtifact(
importedBranchedArtifact
.getGitArtifactMetadata()
.getIsRepoPrivate()))
.flatMap(importedArtifact ->
gitArtifactHelper.getArtifactById(importedArtifact.getId(), null))
.flatMap(importedBranchedArtifact -> {
return gitArtifactHelper
.publishArtifact(importedBranchedArtifact, false)
.then(getGitUserForArtifactId(baseArtifactId))
.flatMap(gitAuthor -> {
CommitDTO commitDTO = new CommitDTO();
commitDTO.setMessage(DEFAULT_COMMIT_MESSAGE
+ GitDefaultCommitMessage.SYNC_WITH_REMOTE_AFTER_PULL.getReason());
commitDTO.setAuthor(gitAuthor);

GitPullDTO gitPullDTO = new GitPullDTO();
gitPullDTO.setMergeStatus(status);
gitPullDTO.setArtifact(importedBranchedArtifact);

return Mono.defer(() -> commitArtifact(
commitDTO,
baseArtifact,
importedBranchedArtifact,
gitType,
false))
.thenReturn(gitPullDTO);
});
return gitArtifactHelper.publishArtifact(importedBranchedArtifact, false);
})
.flatMap(publishedArtifact -> {
return getGitUserForArtifactId(baseArtifactId).flatMap(gitAuthor -> {
CommitDTO commitDTO = new CommitDTO();
commitDTO.setMessage(DEFAULT_COMMIT_MESSAGE
+ GitDefaultCommitMessage.SYNC_WITH_REMOTE_AFTER_PULL.getReason());
commitDTO.setAuthor(gitAuthor);

GitPullDTO gitPullDTO = new GitPullDTO();
gitPullDTO.setMergeStatus(status);
gitPullDTO.setArtifact(publishedArtifact);

// TODO: this can be done async as well.
return Mono.defer(() -> commitArtifact(
commitDTO,
publishedArtifact.getId(),
publishedArtifact.getArtifactType(),
gitType,
false))
.thenReturn(gitPullDTO);
});
});
});
}
Expand Down