Skip to content

Commit 920c1c6

Browse files
authored
suppress branch protection warning (#915)
1 parent f8bf385 commit 920c1c6

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## 0.59.1 - 2026-03-12
11+
12+
### Fixed
13+
14+
- Suppress warning about null branch protection rules. (#912)
15+
1016
## 0.59.0 - 2026-03-12
1117

1218
### Changed

bot/kodiak/queries/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -718,9 +718,10 @@ def get_branch_protection(
718718
*, pull_request: Dict[str, Any]
719719
) -> Optional[BranchProtectionRule]:
720720
try:
721-
return BranchProtectionRule.parse_obj(
722-
pull_request["baseRef"]["branchProtectionRule"]
723-
)
721+
rule = pull_request["baseRef"]["branchProtectionRule"]
722+
if rule is None:
723+
return None
724+
return BranchProtectionRule.parse_obj(rule)
724725
except (ValueError, KeyError, TypeError):
725726
logger.warning("Could not parse branch protection", exc_info=True)
726727
return None

0 commit comments

Comments
 (0)