Skip to content

Commit

Permalink
fix facade task signature
Browse files Browse the repository at this point in the history
Signed-off-by: Isaac Milarsky <[email protected]>
  • Loading branch information
IsaacMilarky committed Apr 25, 2024
1 parent 2474c56 commit 8567074
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 28 deletions.
28 changes: 1 addition & 27 deletions augur/tasks/git/facade_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,32 +439,6 @@ def generate_analysis_sequence(logger,repo_git, session):
return analysis_sequence



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())
query = s.sql.text("""SELECT repo_id FROM repo
WHERE repo_git=:value""").bindparams(value=repo_git)

repo = session.execute_sql(query).fetchone()
session.logger.info(f"repo: {repo}")
repo_id = repo[0]
#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):
logger = logging.getLogger(facade_phase.__name__)
logger.info("Generating facade sequence")
Expand Down Expand Up @@ -506,7 +480,7 @@ def facade_phase(repo_git):

#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,session))
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
10 changes: 9 additions & 1 deletion augur/tasks/github/facade_github/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,22 @@ def link_commits_to_contributor(session,contributorQueue):

# Update the contributors table from the data facade has gathered.
@celery.task(base=AugurFacadeRepoCollectionTask, bind=True)
def insert_facade_contributors(self, repo_id):
def insert_facade_contributors(self, repo_git):

engine = self.app.engine

logger = logging.getLogger(insert_facade_contributors.__name__)
repo_id = None

with GithubTaskManifest(logger) as manifest:

#contributor_sequence.append(facade_start_contrib_analysis_task.si())
query = s.sql.text("""SELECT repo_id FROM repo
WHERE repo_git=:value""").bindparams(value=repo_git)

repo = manifest.augur_db.execute_sql(query).fetchone()
logger.info(f"repo: {repo}")
repo_id = repo[0]

# 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

0 comments on commit 8567074

Please sign in to comment.