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

Code Freeze via the Dashboard #792

Open charliegroll opened 2 years ago

charliegroll commented 2 years ago

It'd be great if we could pause the queue and halt all kodiak merges via the dashboard (ideally per repo, but per org would be a good start). If we have an ongoing incident and 5 merges queued up, it'd be great to not allow any to merge. On top of that, we would need to still be able to cut the line/deploy during an incident, but I assume prioritized merges would fit that bill.

chdsbd commented 2 years ago

Hey @charliegroll, this sounds like a nice enhancement!

Prioritized merges should help during an incident. When you add the priority label to a PR, if there is a PR being merged by Kodiak, Kodiak will continue to merge that PR and then pickup the prioritized PR afterwards. Basically Kodiak doesn't cancel the existing merge.

To halt all merges, you might be able to use this GitHub App: https://www.mergefreeze.com/ I haven't used it, so I can't really speak to how well it works, but I've seen other organizations using it.

I think implementing this feature in Kodiak is doable. We'd need to update the Dashboard (UI and API) to store some state about a merge freeze for a repository in the GitHub Bot's Redis instance. Then we could update the bot to check that Redis state when evaluating PRs.

So this feature would touch all parts of the app, but it isn't too complicated from my POV. It's actually pretty similar to how the paywall works at the moment.

chdsbd commented 2 years ago

@charliegroll Do you think the mergefreeze app would work for your use case or do you think this would be better as a part of Kodiak?

charliegroll commented 2 years ago

@chdsbd that looks like it would work for our use case, thanks for the tip!