Skip to content

Commit

Permalink
Update contribution reviewers (demisto#27791)
Browse files Browse the repository at this point in the history
* update reviewers, update code standards

* fix type hint

* 3.x to 3.10
  • Loading branch information
dorschw authored and xsoar-bot committed Jul 26, 2023
1 parent 1200ed7 commit b1d4f8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
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.10'
- 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

0 comments on commit b1d4f8c

Please sign in to comment.