From 8c49085da762ca75e99044b380794a675eac76b0 Mon Sep 17 00:00:00 2001 From: Andrew Brain Date: Sun, 9 Jun 2024 18:47:48 -0500 Subject: [PATCH] Fix typos and parameter passing issue Signed-off-by: Andrew Brain --- augur/application/db/lib.py | 6 +++--- augur/tasks/frontend.py | 4 ++-- augur/tasks/git/dependency_tasks/core.py | 2 +- augur/tasks/git/facade_tasks.py | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/augur/application/db/lib.py b/augur/application/db/lib.py index 35dee313b6..cc785951aa 100644 --- a/augur/application/db/lib.py +++ b/augur/application/db/lib.py @@ -216,8 +216,8 @@ def facade_bulk_insert_commits(logger, records): firsthalfRecords = records[:len(records)//2] secondhalfRecords = records[len(records)//2:] - facade_bulk_insert_commits(logger, session,firsthalfRecords) - facade_bulk_insert_commits(logger, session,secondhalfRecords) + facade_bulk_insert_commits(logger, firsthalfRecords) + facade_bulk_insert_commits(logger, secondhalfRecords) elif len(records) == 1 and isinstance(e,DataError) and "time zone displacement" in f"{e}": commit_record = records[0] #replace incomprehensible dates with epoch. @@ -225,7 +225,7 @@ def facade_bulk_insert_commits(logger, records): placeholder_date = "1970-01-01 00:00:15 -0500" #Check for improper utc timezone offset - #UTC timezone offset should be betwen -14:00 and +14:00 + #UTC timezone offset should be between -14:00 and +14:00 commit_record['author_timestamp'] = placeholder_date commit_record['committer_timestamp'] = placeholder_date diff --git a/augur/tasks/frontend.py b/augur/tasks/frontend.py index 1e019a3625..fffd79d330 100644 --- a/augur/tasks/frontend.py +++ b/augur/tasks/frontend.py @@ -80,7 +80,7 @@ def add_repo(user_id, group_name, repo_url): logger = logging.getLogger(add_org.__name__) - with GithubTaskSession() as session: + with GithubTaskSession(logger) as session: result = UserRepo.add_github_repo(session, repo_url, user_id, group_name) print(repo_url, result) @@ -92,7 +92,7 @@ def add_org(user_id, group_name, org_url): logger = logging.getLogger(add_org.__name__) - with GithubTaskSession() as session: + with GithubTaskSession(logger) as session: result = UserRepo.add_github_org_repos(session, org_url, user_id, group_name) print(org_url, result) diff --git a/augur/tasks/git/dependency_tasks/core.py b/augur/tasks/git/dependency_tasks/core.py index 8b76033baa..979020f9cb 100644 --- a/augur/tasks/git/dependency_tasks/core.py +++ b/augur/tasks/git/dependency_tasks/core.py @@ -63,7 +63,7 @@ def deps_model(session, repo_id,repo_git,repo_path,repo_name): def generate_scorecard(logger, repo_git): """Runs scorecard on repo and stores data in database :param repo_id: Repository ID - :param repo_git: URL path of the Repostiory + :param repo_git: URL path of the Repository """ repo = get_repo_by_repo_git(repo_git) repo_id = repo.repo_id diff --git a/augur/tasks/git/facade_tasks.py b/augur/tasks/git/facade_tasks.py index e955fbad10..97a69a7574 100644 --- a/augur/tasks/git/facade_tasks.py +++ b/augur/tasks/git/facade_tasks.py @@ -109,8 +109,8 @@ def trim_commits_post_analysis_facade_task(repo_git): repo = get_repo_by_repo_git(repo_git) #Get the huge list of commits to process. - absoulte_path = get_absolute_repo_path(facade_helper.repo_base_directory, repo.repo_id, repo.repo_path,repo.repo_name) - repo_loc = (f"{absoulte_path}/.git") + absolute_path = get_absolute_repo_path(facade_helper.repo_base_directory, repo.repo_id, repo.repo_path,repo.repo_name) + repo_loc = (f"{absolute_path}/.git") # Grab the parents of HEAD parent_commits = get_parent_commits_set(repo_loc, start_date) @@ -181,8 +181,8 @@ def analyze_commits_in_parallel(repo_git, multithreaded: bool)-> None: repo = get_repo_by_repo_id(repo_id) #Get the huge list of commits to process. - absoulte_path = get_absolute_repo_path(facade_helper.repo_base_directory, repo.repo_id, repo.repo_path, repo.repo_name) - repo_loc = (f"{absoulte_path}/.git") + absolute_path = get_absolute_repo_path(facade_helper.repo_base_directory, repo.repo_id, repo.repo_path, repo.repo_name) + repo_loc = (f"{absolute_path}/.git") # Grab the parents of HEAD parent_commits = get_parent_commits_set(repo_loc, start_date) @@ -203,8 +203,8 @@ def analyze_commits_in_parallel(repo_git, multithreaded: bool)-> None: queue = list(missing_commits) logger.info(f"Got to analysis!") - absoulte_path = get_absolute_repo_path(facade_helper.repo_base_directory, repo.repo_id, repo.repo_path,repo.repo_name) - repo_loc = (f"{absoulte_path}/.git") + absolute_path = get_absolute_repo_path(facade_helper.repo_base_directory, repo.repo_id, repo.repo_path,repo.repo_name) + repo_loc = (f"{absolute_path}/.git") pendingCommitRecordsToInsert = []