Skip to content

fix(github_nulls): Better handling of Nulls in GitHub API #39

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

Merged
merged 2 commits into from
May 25, 2023
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
12 changes: 9 additions & 3 deletions repo_manager/github/branch_protections.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,21 +285,27 @@ def check_repo_branch_protections(
diff_option(
"required_approving_review_count",
config_bp.protection.pr_options.required_approving_review_count,
this_protection.required_pull_request_reviews.required_approving_review_count,
## Had issues when the YAML defines this but the Repo has none (e.g. it's null in the cloud)
None if (this_protection.required_pull_request_reviews is None) else \
this_protection.required_pull_request_reviews.required_approving_review_count,
)
)
diffs.append(
diff_option(
"dismiss_stale_reviews",
config_bp.protection.pr_options.dismiss_stale_reviews,
this_protection.required_pull_request_reviews.dismiss_stale_reviews,
## Had issues when the YAML defines this but the Repo has none (e.g. it's null in the cloud)
None if (this_protection.required_pull_request_reviews is None) else \
this_protection.required_pull_request_reviews.dismiss_stale_reviews,
)
)
diffs.append(
diff_option(
"require_code_owner_reviews",
config_bp.protection.pr_options.require_code_owner_reviews,
this_protection.required_pull_request_reviews.require_code_owner_reviews,
## Had issues when the YAML defines this but the Repo has none (e.g. it's null in the cloud)
None if (this_protection.required_pull_request_reviews is None) else \
this_protection.required_pull_request_reviews.require_code_owner_reviews,
)
)
# for now, not checking dismissal options. Will note that in the docs
Expand Down