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

Update contribution reviewers #27791

Merged
merged 4 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .github/workflows/handle-new-external-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.x'
- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
- name: Print Context
Expand Down
13 changes: 6 additions & 7 deletions Utils/github_workflow_scripts/handle_external_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import json
import os

from typing import List, Set
from pathlib import Path

import urllib3
Expand All @@ -17,7 +16,7 @@
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
print = timestamped_print

REVIEWERS = ['thefrieddan1', 'michal-dagan', 'RotemAmit']
REVIEWERS = ['mmhw', 'maimorag', 'anas-yousef']
MARKETPLACE_CONTRIBUTION_PR_AUTHOR = 'xsoar-bot'
WELCOME_MSG = 'Thank you for your contribution. Your generosity and caring are unrivaled! Rest assured - our content ' \
'wizard @{selected_reviewer} will very shortly look over your proposed changes.'
Expand All @@ -34,7 +33,7 @@
CONTRIBUTION_LABEL = 'Contribution'


def determine_reviewer(potential_reviewers: List[str], repo: Repository) -> str:
def determine_reviewer(potential_reviewers: list[str], repo: Repository) -> str:
"""Checks the number of open 'Contribution' PRs that have either been assigned to a user or a review
was requested from the user for each potential reviewer and returns the user with the smallest amount

Expand Down Expand Up @@ -67,7 +66,7 @@ def determine_reviewer(potential_reviewers: List[str], repo: Repository) -> str:
return selected_reviewer


def get_packs_support_levels(pack_dirs: Set[str]) -> Set[str]:
def get_packs_support_levels(pack_dirs: set[str]) -> set[str]:
"""
Get the pack support levels from the pack metadata.

Expand All @@ -86,7 +85,7 @@ def get_packs_support_levels(pack_dirs: Set[str]) -> Set[str]:
return packs_support_levels


def get_packs_support_level_label(file_paths: List[str], external_pr_branch: str) -> str:
def get_packs_support_level_label(file_paths: list[str], external_pr_branch: str) -> str:
"""
Get The contributions' support level label.

Expand Down Expand Up @@ -143,7 +142,7 @@ def get_packs_support_level_label(file_paths: List[str], external_pr_branch: str
return get_highest_support_label(packs_support_levels) if packs_support_levels else ''


def get_highest_support_label(packs_support_levels: Set[str]):
def get_highest_support_label(packs_support_levels: set[str]) -> str:
"""
Get the highest support level.

Expand Down Expand Up @@ -206,7 +205,7 @@ def main():
branch_prefix = 'contrib/'
new_branch_name = f'{branch_prefix}{pr.head.label.replace(":", "_")}'
existant_branches = content_repo.get_git_matching_refs(f'heads/{branch_prefix}')
potential_conflicting_branch_names = [branch.ref.lstrip('refs/heads/') for branch in existant_branches]
potential_conflicting_branch_names = [branch.ref.removeprefix('refs/heads/') for branch in existant_branches]
# make sure new branch name does not conflict with existing branch name
while new_branch_name in potential_conflicting_branch_names:
# append or increment digit
Expand Down