Is there an event notifying about the change of "mergeable" field of a PR?

I’m looking for a way of telling how long has a PR stayed in a non-mergeable state.

Is there a webhook, an event on PR’s timeline, or any workaround that I could use for that?

So far I didn’t find any and hitting the API periodically doesn’t work for me, as it only gives me a snapshot at the time of querying.

HI @david-sabata,

Thank you for being here! Out of the box I can’t think of anything. You could sign up for scheduled reminders as the product is in beta there might be a possibility for feedback to include some kind of analytics to show what you’ve described in your use case. Please note that the Scheduled Reminders feature does require a beta signup for your Organization, which can be done here:

https://github.com/features/reminders/signup

Curious to see if anyone else in the community might have any other ideas here

Is there a state on the PR object that states that it is non mergeable?

If so, the only way of changing this state is a commit on the PR.
I would subscribe to the push event and check the state of the PR after each commit (push).
If the PR changed to a mergeable state, then the time of the change is the time of that commit.

Hi Ilia, that’s a great idea!

In fact, it doesn’t have to be a commit on the PR. It can be a commit to its base branch, causing the PR to have a merge conflict.

But that is something that I should be able to detect and check all open PRs. The solution probably wouldn’t scale well (depending on the traffic in base branches), but is better than nothing.

Thank you :slight_smile: