Skip to content

Commit

Permalink
linting: Recheck PR info if it's mergeability is not determined yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Sep 19, 2016
1 parent c6f6c24 commit 3557f8f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions conda_forge_webservices/linting.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import shutil
import tempfile
import textwrap
import time

import requests
from git import Repo
Expand All @@ -27,7 +28,11 @@ def compute_lint_message(repo_owner, repo_name, pr_id):
owner = gh.get_user(repo_owner)
repo = owner.get_repo(repo_name)

pull_request = repo.get_pull(pr_id)
mergeable = None
while mergeable is None:
pull_request = repo.get_pull(pr_id)
mergeable = pull_request.mergeable
time.sleep(0.1)

with tmp_directory() as tmp_dir:
repo = Repo.clone_from(repo.clone_url, tmp_dir)
Expand All @@ -38,7 +43,7 @@ def compute_lint_message(repo_owner, repo_name, pr_id):
sha = str(repo.head.object.hexsha)

# Raise an error if the PR is not mergeable.
if not pull_request.mergeable:
if not mergeable:
message = textwrap.dedent("""
Hi! This is the friendly automated conda-forge-linting service.
Expand Down

0 comments on commit 3557f8f

Please sign in to comment.