dacharyc / prfocus-website

Website and documentation for the PR Focus macOS app
https://prfocus.app
5 stars 1 forks source link

[Bug] mergeable icon confusion #14

Closed masukomi closed 1 year ago

masukomi commented 1 year ago

Expected Behavior

As a user, I expect the "Mergeable" icon being green to mean that that the PR is in a state that would allow me to go to it and click merge.

Actual Behavior

It seems that "Mergeable" is actually an indication of if the PR has any conflicts or not, and not an indication of if it can be merged or not.

CleanShot 2023-09-08 at 12 14 22@2x

Desired Change

either a rewording of the icon that would more closely match expectations OR (better) a change in behavior that would leave the PR focus UI unchanged but take into account GitHub's "merging is blocked" status.

Reproduction

requires a codebase with branch protections that prevent merging without some pre-requisites having been met (must have at least one review, must have all actions passing, whatever)

  1. create a simple change that doesn't conflict but will result in the PR not being mergable owing to a the pre-merge checks having not been met.
  2. sync pr focus
masukomi commented 1 year ago

potentially useful docs links

about protected branches

there's something they refer to as the "combined status for a specific reference" which looks promising but probably isn't.

Statuses can include a context to indicate what service is providing that status. For example, you may have your continuous integration service push statuses with a context of ci, and a security audit tool push statuses with a context of security. You can then use the REST API to Get the combined status for a specific reference to retrieve the whole status for a commit.

dacharyc commented 1 year ago

Thanks for the feedback! After some investigation, it looks like there is not a simple way in GitHub's GraphQL API to determine if a pull request meets branch protections and requirements for merging. I've added a ticket for myself to look into what it would take to provide a UI indication that merging is blocked due to branch protections or other rules. Meanwhile, I'm renaming this field to "Conflicts" to better communicate the information I'm getting from the GitHub API. This change will be in the upcoming build I'm hoping to release on Monday.