Skip to content

Commit 23ab171

Browse files
committed
clarify comments
1 parent 7c90cc2 commit 23ab171

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

server/events/vcs/gitlab_client.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -454,21 +454,20 @@ func (g *GitlabClient) UpdateStatus(logger logging.SimpleLogging, repo models.Re
454454
}
455455
}
456456

457-
// Ensure that all commit statuses has identical pipeline ID reflected by only one pipeline ID
457+
// Ensure that all commit statuses has identical pipeline ID reflected by only one item in pipelineIds
458458
if len(pipelineIds) == 1 {
459459
logger.Info("Exactly one PipelineID found for commit %s and ref %s, setting new status PipelineID to %d", pull.HeadCommit, pull.HeadBranch, pipelineIds[0])
460460

461-
// Set the pipeline ID to the last pipeline that ran for the commit
461+
// Set the pipeline ID to the only item in pipelineIds
462462
setCommitStatusOptions.PipelineID = gitlab.Ptr(pipelineIds[0])
463-
break
464463
} else {
465464
logger.Warn("Commit %s has statuses from more than one PipelineID (ids=%v) for ref %s. Set PipelineID from the last commit status: %s", pull.HeadCommit, pipelineIds, pull.HeadBranch, commitStatuses[0].PipelineId)
466465

467-
// Set the pipeline ID to the last pipeline that ran for the commit
466+
// Set the pipeline ID from the last commit status
468467
setCommitStatusOptions.PipelineID = gitlab.Ptr(commitStatuses[0].PipelineId)
469-
break
470468
}
471469

470+
break
472471
}
473472
if i != retries {
474473
logger.Info("No pipeline found for commit %s and ref %s, retrying in %s", pull.HeadCommit, pull.HeadBranch, delay)

0 commit comments

Comments
 (0)