Skip to content

Commit 1ef058e

Browse files
authored
Merge pull request #3686 from chaoss/ntdn/consolodate_github_graphql_urls1
access GraphQL urls from the designated graphql helper class
2 parents 51ca1c0 + 3c87498 commit 1ef058e

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

augur/tasks/github/releases/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#SPDX-License-Identifier: MIT
22
from augur.tasks.github.util.github_task_session import *
3+
from augur.tasks.github.util.github_graphql_data_access import GithubGraphQlDataAccess
34
from augur.application.db.models import *
45
from augur.tasks.github.util.util import get_owner_repo
56
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):
159160

160161
owner, repo = get_owner_repo(github_url)
161162

162-
url = 'https://api.github.com/graphql'
163+
url = GithubGraphQlDataAccess.base_url()
163164

164165
query = get_query(logger, owner, repo, tag_only)
165166

augur/tasks/github/repo_info/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def is_archived(logger, repo_data):
9393
return False
9494

9595
def grab_repo_info_from_graphql_endpoint(key_auth, logger, query):
96-
url = 'https://api.github.com/graphql'
96+
url = GithubGraphQlDataAccess.base_url()
9797
# Hit the graphql endpoint and retry 3 times in case of failure
9898
logger.info("Hitting endpoint: {} ...\n".format(url))
9999
data = request_graphql_dict(key_auth, logger, url, query)

augur/tasks/github/util/github_graphql_data_access.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ class InvalidDataException(Exception):
2020
pass
2121

2222
class GithubGraphQlDataAccess:
23+
"""Utilities for accessing the GitHub GraphQL API
24+
"""
2325

26+
@staticmethod
27+
def base_url():
28+
return URL
2429

2530
def __init__(self, key_manager, logger: logging.Logger, ingore_not_found_error=False):
2631

0 commit comments

Comments
 (0)