Skip to content

Commit

Permalink
ci-connector-ops: change required reviewers logic (#21158)
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere authored Jan 10, 2023
1 parent 6033b11 commit 524f071
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions tools/ci_connector_ops/ci_connector_ops/sat_config_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,16 @@ def find_changed_ga_connectors() -> List[str]:
return [connector_name for connector_name in changed_connector_names if utils.get_connector_release_stage(connector_name) == "generally_available"]

def find_mandatory_reviewers() -> List[Union[str, Dict[str, List]]]:
teams = []
ga_connector_changes = find_changed_ga_connectors()
backward_compatibility_changes = utils.get_changed_acceptance_test_config(diff_regex="disable_for_version")
test_strictness_level_changes = utils.get_changed_acceptance_test_config(diff_regex="test_strictness_level")
if ga_connector_changes:
teams += GA_CONNECTOR_REVIEWERS
if backward_compatibility_changes:
teams += [{"any-of": list(BACKWARD_COMPATIBILITY_REVIEWERS)}]
return [{"any-of": list(BACKWARD_COMPATIBILITY_REVIEWERS)}]
if test_strictness_level_changes:
teams += [{"any-of": list(TEST_STRICTNESS_LEVEL_REVIEWERS)}]
return teams
return [{"any-of": list(TEST_STRICTNESS_LEVEL_REVIEWERS)}]
if ga_connector_changes:
return list(GA_CONNECTOR_REVIEWERS)
return []

def check_test_strictness_level():
connectors_with_bad_strictness_level = find_connectors_with_bad_strictness_level()
Expand Down
4 changes: 2 additions & 2 deletions tools/ci_connector_ops/tests/test_sat_config_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def ga_connector_file_change_expected_team(tmp_path, ga_connector_file):

@pytest.fixture
def ga_connector_backward_compatibility_file_change(tmp_path, ga_connector_file):
expected_teams = list(sat_config_checks.GA_CONNECTOR_REVIEWERS) + [{"any-of": list(sat_config_checks.BACKWARD_COMPATIBILITY_REVIEWERS)}]
expected_teams = [{"any-of": list(sat_config_checks.BACKWARD_COMPATIBILITY_REVIEWERS)}]
backup_path = tmp_path / "ga_acceptance_test_config.backup"
shutil.copyfile(ga_connector_file, backup_path)
with open(ga_connector_file, "a") as ga_acceptance_test_config_file:
Expand All @@ -71,7 +71,7 @@ def ga_connector_backward_compatibility_file_change(tmp_path, ga_connector_file)

@pytest.fixture
def ga_connector_test_strictness_level_file_change(tmp_path, ga_connector_file):
expected_teams = list(sat_config_checks.GA_CONNECTOR_REVIEWERS) + [{"any-of": list(sat_config_checks.TEST_STRICTNESS_LEVEL_REVIEWERS)}]
expected_teams = [{"any-of": list(sat_config_checks.TEST_STRICTNESS_LEVEL_REVIEWERS)}]
backup_path = tmp_path / "ga_acceptance_test_config.backup"
shutil.copyfile(ga_connector_file, backup_path)
with open(ga_connector_file, "a") as ga_acceptance_test_config_file:
Expand Down

0 comments on commit 524f071

Please sign in to comment.