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/multi commit issue #4163

Merged
merged 2 commits into from
Nov 7, 2023
Merged
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
12 changes: 9 additions & 3 deletions cla-backend/cla/models/github_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import concurrent.futures
from typing import List, Union, Optional

import threading
import falcon
import github
from github import PullRequest
Expand Down Expand Up @@ -731,12 +732,17 @@ def update_change_request(self, installation_id, github_repository_id, change_re
# Find users who have signed and who have not signed.
signed = []
missing = []
futures = []

cla.log.debug(f'{fn} - PR: {pull_request.number}, scanning users - '
'determining who has signed a CLA an who has not.')
for user_commit_summary in commit_authors:
cla.log.debug(f'{fn} - PR: {pull_request.number} for user: {user_commit_summary}')
handle_commit_from_user(project, user_commit_summary, signed, missing)

with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
for user_commit_summary in commit_authors:
cla.log.debug(f'{fn} - PR: {pull_request.number} for user: {user_commit_summary}')
futures.append(executor.submit(handle_commit_from_user, project,user_commit_summary,signed,missing))
for future in concurrent.futures.as_completed(futures):
cla.log.debug(f'{fn} - ThreadClosed for handle_commit_from_user')

# At this point, the signed and missing lists are now filled and updated with the commit user info

Expand Down
Loading