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

chore(IDX): update cla bot name #65

Merged
merged 3 commits into from
Dec 2, 2024
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
11 changes: 4 additions & 7 deletions reusable_workflows/check_cla/check_cla_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
APPROVED_LABEL = "cla:agreed"
GH_WORKFLOW_LABEL = "cla:gh-wf-pending"

DFINITY_BOT_NAME = "sa-github-api"
DFINITY_BOT_NAME_OLD = "dfinity-droid-prod[bot]"
# keep all old bot names for backwards compatibility
CLA_BOT_NAMES = ["cla-idx-bot[bot]", "sa-github-api", "dfinity-droid-prod[bot]"]


class CLAHandler:
Expand All @@ -25,7 +25,7 @@ def check_comment_already_exists(
self, comments: github3.structs.GitHubIterator
) -> bool:
for comment in comments:
if comment.user.login == DFINITY_BOT_NAME:
if comment.user.login in CLA_BOT_NAMES:
return True
return False

Expand Down Expand Up @@ -56,10 +56,7 @@ def check_if_cla_signed(self, issue: GHIssue, user: str) -> bool:

def get_cla_issue(self, user: str) -> Optional[GHIssue]:
for issue in self.cla_repo.issues():
if issue.title == f"cla: @{user}" and issue.user.login in [
DFINITY_BOT_NAME,
DFINITY_BOT_NAME_OLD,
]:
if issue.title == f"cla: @{user}" and issue.user.login in CLA_BOT_NAMES:
return issue
print(f"No CLA issue for {user}")
return None # to make linter happy
Expand Down