Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Merge Error #2832

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
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
23 changes: 1 addition & 22 deletions augur/tasks/git/facade_tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#SPDX-License-Identifier: MIT

Check warning on line 1 in augur/tasks/git/facade_tasks.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 C0114: Missing module docstring (missing-module-docstring) Raw Output: augur/tasks/git/facade_tasks.py:1:0: C0114: Missing module docstring (missing-module-docstring)

import logging
from celery import group, chain
Expand All @@ -13,7 +13,7 @@
from augur.tasks.git.util.facade_worker.facade_worker.rebuildcache import fill_empty_affiliations, invalidate_caches, nuke_affiliations, rebuild_unknown_affiliation_and_web_caches


from augur.tasks.github.facade_github.tasks import *

Check warning on line 16 in augur/tasks/git/facade_tasks.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 W0401: Wildcard import augur.tasks.github.facade_github.tasks (wildcard-import) Raw Output: augur/tasks/git/facade_tasks.py:16:0: W0401: Wildcard import augur.tasks.github.facade_github.tasks (wildcard-import)
from augur.tasks.git.util.facade_worker.facade_worker.config import FacadeHelper
from augur.tasks.util.collection_state import CollectionState
from augur.tasks.util.collection_util import get_collection_status_repo_git_from_filter
Expand All @@ -31,13 +31,13 @@
from augur.tasks.git.dependency_libyear_tasks.tasks import process_libyear_dependency_metrics
from augur.tasks.git.scc_value_tasks.tasks import process_scc_value_metrics

from augur.tasks.github.util.github_task_session import *

Check warning on line 34 in augur/tasks/git/facade_tasks.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 W0401: Wildcard import augur.tasks.github.util.github_task_session (wildcard-import) Raw Output: augur/tasks/git/facade_tasks.py:34:0: W0401: Wildcard import augur.tasks.github.util.github_task_session (wildcard-import)


#define an error callback for chains in facade collection so facade doesn't make the program crash
#if it does.
@celery.task
def facade_error_handler(request,exc,traceback):

Check warning on line 40 in augur/tasks/git/facade_tasks.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 W0621: Redefining name 'traceback' from outer scope (line 16) (redefined-outer-name) Raw Output: augur/tasks/git/facade_tasks.py:40:37: W0621: Redefining name 'traceback' from outer scope (line 16) (redefined-outer-name)

logger = logging.getLogger(facade_error_handler.__name__)

Expand All @@ -56,13 +56,13 @@

#Predefine facade collection with tasks
@celery.task(base=AugurFacadeRepoCollectionTask)
def facade_analysis_init_facade_task(repo_git):

Check warning on line 59 in augur/tasks/git/facade_tasks.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 W0613: Unused argument 'repo_git' (unused-argument) Raw Output: augur/tasks/git/facade_tasks.py:59:37: W0613: Unused argument 'repo_git' (unused-argument)

logger = logging.getLogger(facade_analysis_init_facade_task.__name__)
facade_helper = FacadeHelper(logger)

facade_helper.update_status('Running analysis')
facade_helper.log_activity('Info',f"Beginning analysis.")

Check warning on line 65 in augur/tasks/git/facade_tasks.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation) Raw Output: augur/tasks/git/facade_tasks.py:65:38: W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)


@celery.task(base=AugurFacadeRepoCollectionTask)
Expand Down Expand Up @@ -110,7 +110,7 @@

#Get the huge list of commits to process.
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")

Check warning on line 113 in augur/tasks/git/facade_tasks.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 C0325: Unnecessary parens after '=' keyword (superfluous-parens) Raw Output: augur/tasks/git/facade_tasks.py:113:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
# Grab the parents of HEAD

parent_commits = get_parent_commits_set(repo_loc, start_date)
Expand Down Expand Up @@ -182,7 +182,7 @@

#Get the huge list of commits to process.
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")

Check warning on line 185 in augur/tasks/git/facade_tasks.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 C0325: Unnecessary parens after '=' keyword (superfluous-parens) Raw Output: augur/tasks/git/facade_tasks.py:185:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
# Grab the parents of HEAD

parent_commits = get_parent_commits_set(repo_loc, start_date)
Expand All @@ -196,7 +196,7 @@
facade_helper.log_activity('Debug',f"Commits missing from repo {repo_id}: {len(missing_commits)}")


if not len(missing_commits) or repo_id is None:

Check warning on line 199 in augur/tasks/git/facade_tasks.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) Raw Output: augur/tasks/git/facade_tasks.py:199:7: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len)
#session.log_activity('Info','Type of missing_commits: %s' % type(missing_commits))
return

Expand All @@ -204,7 +204,7 @@

logger.info(f"Got to analysis!")
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")

Check warning on line 207 in augur/tasks/git/facade_tasks.py

View workflow job for this annotation

GitHub Actions / runner / pylint

[pylint] reported by reviewdog 🐶 C0325: Unnecessary parens after '=' keyword (superfluous-parens) Raw Output: augur/tasks/git/facade_tasks.py:207:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)

pendingCommitRecordsToInsert = []

Expand Down Expand Up @@ -388,27 +388,6 @@



def generate_contributor_sequence(logger,repo_git, session):

contributor_sequence = []
#all_repo_ids = []
repo_id = None

#contributor_sequence.append(facade_start_contrib_analysis_task.si())
repo = get_repo_by_repo_git(repo_git)
repo_id = repo.repo_id

#pdb.set_trace()
#breakpoint()
#for repo in all_repos:
# contributor_sequence.append(insert_facade_contributors.si(repo['repo_id']))
#all_repo_ids = [repo['repo_id'] for repo in all_repos]

#contrib_group = create_grouped_task_load(dataList=all_repo_ids,task=insert_facade_contributors)#group(contributor_sequence)
#contrib_group.link_error(facade_error_handler.s())
#return contrib_group#chain(facade_start_contrib_analysis_task.si(), contrib_group)
return insert_facade_contributors.si(repo_id)


def facade_phase(repo_git, full_collection):

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0613: Unused argument 'full_collection' (unused-argument)

logger = logging.getLogger(facade_phase.__name__)
Expand Down Expand Up @@ -450,7 +429,7 @@

#Generate contributor analysis task group.
if not limited_run or (limited_run and run_facade_contributors):
facade_core_collection.append(generate_contributor_sequence(logger,repo_git,facade_helper))
facade_core_collection.append(insert_facade_contributors.si(repo_git))


#These tasks need repos to be cloned by facade before they can work.
Expand Down
7 changes: 3 additions & 4 deletions augur/tasks/github/facade_github/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from augur.tasks.github.util.github_random_key_auth import GithubRandomKeyAuth
from augur.application.db.models import Contributor
from augur.tasks.github.facade_github.core import *

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0401: Wildcard import augur.tasks.github.facade_github.core (wildcard-import)

from augur.application.db.lib import execute_sql, get_contributor_aliases_by_email, get_unresolved_commit_emails_by_name, get_contributors_by_full_name
from augur.application.db.lib import execute_sql, get_contributor_aliases_by_email, get_unresolved_commit_emails_by_name, get_contributors_by_full_name, get_repo_by_repo_git
from augur.tasks.git.util.facade_worker.facade_worker.facade00mainprogram import *

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0401: Wildcard import augur.tasks.git.util.facade_worker.facade_worker.facade00mainprogram (wildcard-import)



Expand Down Expand Up @@ -195,10 +195,9 @@ def insert_facade_contributors(self, repo_git):
# Set platform id to 1 since this task is github specific
platform_id = 1

engine = self.app.engine

logger = logging.getLogger(insert_facade_contributors.__name__)
repo_id = None
repo = get_repo_by_repo_git(repo_git)
repo_id = repo.repo_id

# Get all of the commit data's emails and names from the commit table that do not appear
# in the contributors table or the contributors_aliases table.
Expand Down
Loading