eclipse-csi / otterdog

OtterDog is a tool to manage GitHub organizations at scale using a configuration as code approach. It is actively used by the Eclipse Foundation to manage its numerous projects hosted on GitHub.
https://otterdog.readthedocs.org
Eclipse Public License 2.0
24 stars 4 forks source link

Support merge queue settings for branch protection rules #86

Closed eclipse-csi-bot closed 1 week ago

eclipse-csi-bot commented 1 year ago

In GitLab by @netomi on Jul 27, 2023, 13:41

mnonnenmacher commented 8 months ago

@netomi We will need the merge queue for our repository https://github.com/eclipse-apoapsis/ort-server. As long as this feature is not implemented, can this be manually configured for a repository or would otterdog revert these settings if it runs?

netomi commented 8 months ago

we can manually set the merge queue for now, the remaining settings of a branch protection rule can be setup with otterdog. The unknown setting will not be touched.

mnonnenmacher commented 8 months ago

Ok, thanks for the confirmation.

netomi commented 8 months ago

so far I encountered nobody using that feature, if there is interest in it I will raise priority accordingly and make sure that is supported asap.

netomi commented 8 months ago

Some research reveals that there is currently no API to create a merge queue, see also this request: https://github.com/orgs/community/discussions/50893

The graphql API allows to query existing merge queue, but there is no mutation to create one.

netomi commented 8 months ago

https://github.com/orgs/community/discussions/77614

mnonnenmacher commented 1 month ago

@netomi https://github.com/orgs/community/discussions/77614 was closed because they can now be configured for rulesets: https://docs.github.com/en/graphql/overview/changelog#schema-changes-for-2024-07-24

So if Otterdog can support that we might just switch from a branch protection rule to a ruleset, although so far I have not looked into the ruleset feature at all.

netomi commented 1 month ago

ty for the pointer. Rulesets are the same as branch protection rules, just better and more consistent. I expect at some point in time GitHub will deprecate branch protection rules in favor of ruleset.

netomi commented 1 month ago

Created https://github.com/eclipse-csi/otterdog/issues/282 and will merge soon as the implementation is finished.

I wonder if they will add API support for merge queues in branch protection rules as well. In the UI they already point you to rulesets if you want to create a branch protection rule:

image

So as I said before, my guess is they have internally already deprecated them and will not invest any more time into supporting them.

Rulesets are the way to go.

netomi commented 1 week ago

this will probably never be supported by GitHub's API, support for merge queues is not there for rulesets and they are the way to go, so closing for now.