YACC doesn't do any checking for pull request merge commits made through the Bitbucket UI, even if the "Exclude Merge Commits" option is not enabled.
We need to handle the PULL_REQUEST_MERGE trigger in YaccHook (see PR)
We need to filter out dry run merges in YaccHook, since Bitbucket runs dry run merges to display diffs in pull requests
Even after the the two steps above, pull request commits are not checked.
This is because RepositoryHookCommitFilter.ADDED_TO_REPOSITORY doesn’t get called back for merge commits added through the pull request UI. This seems like a Bitbucket bug.
We can work around this by explicitly checking the refChange.getToHash() commit whenever the trigger is a pull request. Or SimplePullRequestMergeHookRequest.getMergeHash()
Note, users may raise support requests due to the change in behavior – we could add a new option to ignore pull request commits and set it to “true” by default. A little hacky. Maybe we just deal with the support requests…