Skip to content
Draft
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
13 changes: 13 additions & 0 deletions augur/tasks/github/releases/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,17 @@ def fetch_data(key_auth, logger, github_url, repo_id, tag_only = False):
logger.info("Hitting endpoint: {} ...\n".format(url))
data = request_graphql_dict(key_auth,logger, url, query)

if data is None:
logger.warning(f"GraphQL returned None for repo {github_url}; skipping releases.")
return None

if 'data' in data:
data = data['data']['repository']

if data is None:
logger.warning(f"GraphQL repository node is None for repo {github_url}; skipping releases.")
return None

data['owner'] = owner

return data
Expand All @@ -182,6 +190,9 @@ def releases_model(session, key_auth, logger, repo_git, repo_id):
logger.info(f"Ran into problem when fetching data for repo {repo_git}: {e}")
return

if data is None:
return
Comment on lines +193 to +194
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these early returns concern me - id want to look at the code below them in more detail to see what else could be getting skipped that the default github diff context doesnt show


#logger.info("repository value is: {}\n".format(data))
if 'releases' in data:
if 'edges' in data['releases'] and data['releases']['edges']:
Expand All @@ -195,6 +206,8 @@ def releases_model(session, key_auth, logger, repo_git, repo_id):
elif 'edges' in data['releases'] and not data['releases']['edges']:
logger.info("Searching for tags instead of releases...")
data = fetch_data(key_auth, logger, repo_git, repo_id,True)
if data is None:
return
Comment on lines +209 to +210
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

logger.info("refs value is: {}\n".format(data))
if 'refs' in data:
if 'edges' in data['refs']:
Expand Down
Loading