kodiak icon indicating copy to clipboard operation
kodiak copied to clipboard

Branch Protection Not Recognized by Kodiak

Open lodmfjord opened this issue 1 year ago • 2 comments

We have encountered an issue where Kodiak does not recognize the branch protection rules applied to our release/30.1.0 branch. Specifically, even though we have branch protection enabled, Kodiak is behaving as if there are no such rules in place.

Possible Cause: This issue might be due to a limitation in the GitHub API. Our repository currently has 101 branches with this specific protection rule. Does the API only return the first 100 hits?

Workaround 1: Creating a new protection rule for this branch works.

Workaround 2: Deleting one branch worked - 100 branches are then branch protected by this rule.

Additional Context: Link to a pull request

lodmfjord avatar Jun 13 '24 15:06 lodmfjord

This looks like a bug. We select the first 100 branch protection rules here: https://github.com/chdsbd/kodiak/blob/0065e640d6febdb08ea236f459c125990fd9d9cf/bot/kodiak/queries/init.py#L159

chdsbd avatar Jun 14 '24 03:06 chdsbd

The issue in this query is the matchingRefs call:

https://github.com/chdsbd/kodiak/blob/ba5073258059fbda248f5ec71eca200da77d50f5/bot/kodiak/queries/init.py#L161-L165

chdsbd avatar Jun 19 '24 20:06 chdsbd