Skip to content

Commit

Permalink
Fix fetching MR CI status
Browse files Browse the repository at this point in the history
The pipeline doesn't appear immediately, and so it's likely we'll hit
the assertion error. Instead, we can wait for the first pipeline fetched
to match our commit sha.
  • Loading branch information
JaimeLennox committed Apr 2, 2018
1 parent a44e580 commit 2025949
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions marge/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ def get_mr_ci_status(self, merge_request, commit_sha=None):
)
current_pipeline = next(iter(pipelines), None)

if current_pipeline:
assert current_pipeline.sha == commit_sha
if current_pipeline and current_pipeline.sha == commit_sha:
ci_status = current_pipeline.status
else:
log.warning('No pipeline listed for %s on branch %s', commit_sha, merge_request.source_branch)
Expand Down

0 comments on commit 2025949

Please sign in to comment.