Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 4

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

Solved! Go to Solution.

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.

3 Replies
Highlighted
Community Manager
Message 2 of 4

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

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


My very best,
Andrea

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Highlighted
Solution
Pilot Lvl 1
Message 3 of 4

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

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.
Highlighted
Copilot Lvl 2
Message 4 of 4

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

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 :)