Skip to content

Commit

Permalink
Merge pull request #1 from platacard/check-pipe
Browse files Browse the repository at this point in the history
check actual pipeline
  • Loading branch information
aleksandrMasliaev authored Dec 12, 2024
2 parents 9a539e5 + 030561c commit 7c4d2ca
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/kotlin/marge_kot/helpers/PipelineWaiter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ class PipelineWaiter(
onOutdated = { throw NeedRebaseException() }
)
Napier.v("Get pipeline for current merge request")
val pipeline = mergeRequest.pipeline?.id?.let {
repository.getPipeline(mergeRequest.pipeline.id)
val mergeRequestPipeline = mergeRequest.pipeline
val pipeline = mergeRequestPipeline?.id?.let {
repository.getPipeline(mergeRequestPipeline.id)
} ?: throw NeedRebaseException()
Napier.v("Check if pipeline is actual")
if (mergeRequest.diffRefs?.headSha != pipeline.sha) {
Napier.v("Need to wait for a fresh pipeline")
continue
}
Napier.v("Pipeline status is ${pipeline.status}")
when (pipeline.status) {
Pipeline.Status.SUCCESS -> return
Expand Down

0 comments on commit 7c4d2ca

Please sign in to comment.