diff --git a/augur/tasks/github/releases/core.py b/augur/tasks/github/releases/core.py index f6b2f5e56b..b1be904666 100644 --- a/augur/tasks/github/releases/core.py +++ b/augur/tasks/github/releases/core.py @@ -1,5 +1,6 @@ #SPDX-License-Identifier: MIT from augur.tasks.github.util.github_task_session import * +from augur.tasks.github.util.github_graphql_data_access import GithubGraphQlDataAccess from augur.application.db.models import * from augur.tasks.github.util.util import get_owner_repo from augur.tasks.github.util.gh_graphql_entities import request_graphql_dict @@ -159,7 +160,7 @@ def fetch_data(key_auth, logger, github_url, repo_id, tag_only = False): owner, repo = get_owner_repo(github_url) - url = 'https://api.github.com/graphql' + url = GithubGraphQlDataAccess.base_url() query = get_query(logger, owner, repo, tag_only) diff --git a/augur/tasks/github/repo_info/core.py b/augur/tasks/github/repo_info/core.py index 57cd970bc0..4bc6da89a4 100644 --- a/augur/tasks/github/repo_info/core.py +++ b/augur/tasks/github/repo_info/core.py @@ -93,7 +93,7 @@ def is_archived(logger, repo_data): return False def grab_repo_info_from_graphql_endpoint(key_auth, logger, query): - url = 'https://api.github.com/graphql' + url = GithubGraphQlDataAccess.base_url() # Hit the graphql endpoint and retry 3 times in case of failure logger.info("Hitting endpoint: {} ...\n".format(url)) data = request_graphql_dict(key_auth, logger, url, query) diff --git a/augur/tasks/github/util/github_graphql_data_access.py b/augur/tasks/github/util/github_graphql_data_access.py index 96b0c6ab76..dc047b1880 100644 --- a/augur/tasks/github/util/github_graphql_data_access.py +++ b/augur/tasks/github/util/github_graphql_data_access.py @@ -20,7 +20,12 @@ class InvalidDataException(Exception): pass class GithubGraphQlDataAccess: + """Utilities for accessing the GitHub GraphQL API + """ + @staticmethod + def base_url(): + return URL def __init__(self, key_manager, logger: logging.Logger, ingore_not_found_error=False):