diff --git a/cla-backend/cla/models/dynamo_models.py b/cla-backend/cla/models/dynamo_models.py index ac3c343c6..b8db05c92 100644 --- a/cla-backend/cla/models/dynamo_models.py +++ b/cla-backend/cla/models/dynamo_models.py @@ -2969,16 +2969,12 @@ def get_signatures_by_reference( ): fn = 'cla.models.dynamo_models.signature.get_signatures_by_reference' cla.log.debug(f'{fn} - reference_id: {reference_id}, reference_type: {reference_type},' - f' project_id: {project_id}, user_ccla_company_id: {project_id},' + f' project_id: {project_id}, user_ccla_company_id: {user_ccla_company_id},' f' signature_signed: {signature_signed}, signature_approved: {signature_approved}') cla.log.debug(f'{fn} - performing signature_reference_id query using: {reference_id}') # TODO: Optimize this query to use filters properly. signature_generator = self.model.signature_reference_index.query(str(reference_id)) - last_evaluated_key = signature_generator.last_evaluated_key - if last_evaluated_key is None: - cla.log.debug(f'{fn} - no last evaluated key found') - return [] cla.log.debug(f'{fn} - generator.last_evaluated_key: {signature_generator.last_evaluated_key}') signatures = [] diff --git a/cla-backend/cla/models/github_models.py b/cla-backend/cla/models/github_models.py index dbeba9fde..074785c2d 100644 --- a/cla-backend/cla/models/github_models.py +++ b/cla-backend/cla/models/github_models.py @@ -534,7 +534,7 @@ def update_merge_group(self, installation_id, github_repository_id, merge_group_ try : # Get Commit authors - commit_authors = get_pull_request_commit_authors(pull_request, installation_id) + commit_authors = get_pull_request_commit_authors(pull_request) cla.log.debug(f'{fn} - commit authors: {commit_authors}') except Exception as e: cla.log.warning(f'{fn} - unable to load commit authors for PR {pull_request_id} from GitHub repository ' @@ -651,6 +651,9 @@ def update_change_request(self, installation_id, github_repository_id, change_re # Get all unique users/authors involved in this PR - returns a List[UserCommitSummary] objects commit_authors = get_pull_request_commit_authors(pull_request) + cla.log.debug(f'{fn} - PR: {pull_request.number}, found {len(commit_authors)} unique commit authors ' + f'for pull request: {pull_request.number}') + try: # Get existing repository info using the repository's external ID, # which is the repository ID assigned by github. @@ -1367,16 +1370,6 @@ def get_pull_request_commit_authors(pull_request) -> List[UserCommitSummary]: commit_authors = [] - # try: - # num_processes = multiprocessing.cpu_count() - # cla.log.debug(f'{fn} - Number of CPUs: {num_processes}') - - # with multiprocessing.Pool(processes=num_processes) as pool: - # commit_authors = pool.starmap(get_author_summary, [(commit, pull_request.number) for commit in pull_request.get_commits()]) - - # except Exception as e: - # cla.log.warning(f'{fn} - Exception while querying pull request commits for author information: {e}') - # raise e with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor: future_to_commit = {executor.submit(get_author_summary, commit, pull_request.number): commit for commit in pull_request.get_commits()} for future in concurrent.futures.as_completed(future_to_commit):