chdsbd / kodiak

🔮 A bot to automatically update and merge GitHub PRs
https://kodiakhq.com
GNU Affero General Public License v3.0
1.03k stars 65 forks source link

Branch Protection Not Recognized by Kodiak #893

Open lodmfjord opened 1 week ago

lodmfjord commented 1 week ago

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

chdsbd commented 1 week ago

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 commented 6 days ago

The issue in this query is the matchingRefs call:

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