policy-bot
policy-bot copied to clipboard
ignore_update_merges for rebases
Could the ignore_update_merges
option be extended to ignore rebases which do not change any diff while rebasing?
This would greatly help to keep approvals if a PR gets outdated by target branch updates.
I don't think this is something we can easily support given the current architecture. ignore_update_merges
uses a cheap heuristic that only works for merge commits created in the UI as a way to avoid expensive API calls to list and compare commit tress. To support rebases, I think we'd have to:
- Track pull request state to record both the old head SHA and the new head SHA after a rebase and force push. Policy Bot is currently stateless and I'm not sure if the GitHub API has a reliable way to look up the before and after state of a PR that was force pushed.
- Compare the trees of the new and old commits to determine if any files in the PR changed.
That said, it's possible that there's a clever and cheap way to detect safe rebases that I haven't thought of yet.