* septicmk forked v6d-io/v6d to septicmk/v6d
* septicmk added commits to septicmk/v6d:main
* septicmk created a pull request from septicmk/v6d:main to v6d-io/v6d:main
* septicmk force pushed septicmk/v6d:main with the head commit of v6d-io/v6d:main
* Github closed the pull request and displayed a "merge" notification
The UX issue is that septicmk did not have write permission to v6d-io and did not actually merge any commit into it, but GitHub says "septicmk merged commit 61f3741 into v6d-io:main". Commit 61f3741 was authored by sighingnow and was already on v6d-io:main.
So in this case no authorized merge actually happened, the PR was just updated to have no difference from the actual repository's main branch, but GitHub makes it seem like a merge happened.
The behavior is not reproducible in GitLab, where empty merge requests can be created, and remain in the open state, also with zero changes at some later point. Added in GitLab 9.2 as part of the issue to new branch and wip/draft merge request flow: https://gitlab.com/gitlab-org/gitlab-foss/-/issues/28558
Closing the "zero changes" merge request have confused in my previous experience when I continue to push re-added commits to the original pull request branch.
So in effect, unauthorized merges (PR looking merged; email notifications being sent) are possible if they are "zero-commit-merges" that don't actually change any state in the git repository.
Thus, in the underlying data structure behind the GitHub interface, there really isn't an "event" here to identify. The PR branch points to the same commit as the base branch, therefore both branches are in the state of existing as "merged" with one another.
So GitHub would have to track changes to the PR branch that result in this state separately from the existing "merge from GUI" and "push PR branch to master" changes, which I could imagine is fraught with edge cases that could result in what you consider a merge event ending up as a closed event.
Do I understand correctly that these are the events that happened:
* septicmk forked v6d-io/v6d to septicmk/v6d
* septicmk created a pull request from septicmk/v6d:main to v6d-io/v6d:main
* septicmk merged sighingnow's commit 61f3741 to septicmk/v6d:main (perhaps while updating their fork?)
* GitHub says septicmk merged commit 61f3741 to septicmk/v6d:main?
If so is that not right? They did merge a commit in their fork at septicmk/v6d:main, didn't they?
Does GitHub say anywhere that they merged commit to v6d-io/v6d:main? That would be very interesting and a real issue!
I agree the big "Merged" button on top of the pull request is very misleading, perhaps a UX bug! But no unauthorized merge actually happened here, did it?