Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add merge-conflict notifications #1856

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Nov 8, 2024

This adds a new handler which will post comments on PRs when there is a merge conflict. I have appreciated this feature in homu, and I think it would be helpful for repositories that are not using homu.

A high-level overview:

  • There is a new [merge-conflict] conflg table to enable the feature. It supports labels just like homu.
  • There are two separate events that it listens to:
    • A push to a repo branch will trigger a scan through all open PRs for PRs that have new conflicts.
    • A push to a PR, which either adds a conflict or resolves an existing conflict. This also includes opening/reopening PRs.
  • State is stored in the database so that only one conflict comment is posted.
    • After the conflict is resolved, the comment will be hidden.
  • This is complicated by the fact that the mergeable status of a PR is updated both lazily and asynchronously. That is, GitHub doesn't bother computing it until you ask for it, which it then returns null. Then, GitHub has an async background task which computes the value. There is no notification (AFAIK) when that is done, so we just poll again after a delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant