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

require extra review for breaking change messages #31361

Merged
merged 15 commits into from
Oct 16, 2023
Prev Previous commit
Next Next commit
better logic
  • Loading branch information
pedroslopez committed Oct 16, 2023
commit dabc53604b80e43ff9e6be99adf6ea198eadc550
Original file line number Diff line number Diff line change
@@ -59,25 +59,40 @@ def get_bypass_reason_changes() -> Set[utils.Connector]:
return bypass_reason_changes.intersection(find_changed_important_connectors())


def find_mandatory_reviewers() -> List[Union[str, Dict[str, List]]]:
def find_mandatory_reviewers() -> List[Dict[str, Union[str, Dict[str, List]]]]:
important_connector_changes = find_changed_important_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")
ga_bypass_reason_changes = get_bypass_reason_changes()
breaking_change_changes = utils.get_changed_metadata(diff_regex="breakingChanges")
breaking_change_changes = utils.get_changed_metadata(diff_regex="upgradeDeadline")

required_reviewers = []

if backward_compatibility_changes:
required_reviewers.append({"any-of": list(BACKWARD_COMPATIBILITY_REVIEWERS)})
required_reviewers.append({
"name": "Backwards Compatibility Test Skip",
"teams": list(BACKWARD_COMPATIBILITY_REVIEWERS)
})
if test_strictness_level_changes:
required_reviewers.append({"any-of": list(TEST_STRICTNESS_LEVEL_REVIEWERS)})
required_reviewers.append({
"name": "Acceptance Test Strictness Level",
"teams": list(TEST_STRICTNESS_LEVEL_REVIEWERS)
})
if ga_bypass_reason_changes:
required_reviewers.append({"any-of": list(GA_BYPASS_REASON_REVIEWERS)})
required_reviewers.append({
"name": "GA Acceptance Test Bypass",
"teams": list(GA_BYPASS_REASON_REVIEWERS)
})
if important_connector_changes:
required_reviewers.append({"any-of": list(GA_CONNECTOR_REVIEWERS)})
required_reviewers.append({
"name": "GA Connectors",
"teams": list(GA_CONNECTOR_REVIEWERS)
})
if breaking_change_changes:
required_reviewers.append({"any-of": list(BREAKING_CHANGE_REVIEWERS)})
required_reviewers.append({
"name": "Breaking Changes",
"teams": list(BREAKING_CHANGE_REVIEWERS)
})

return required_reviewers

@@ -98,7 +113,7 @@ def write_review_requirements_file():

if mandatory_reviewers:
requirements_file_content = [
{"name": "Required reviewers from the connector org teams", "paths": "unmatched", "teams": mandatory_reviewers}
dict(r, paths="unmatched") for r in mandatory_reviewers
]
with open(REVIEW_REQUIREMENTS_FILE_PATH, "w") as requirements_file:
yaml.safe_dump(requirements_file_content, requirements_file)