This is happening on our Forgejo instance, but I believe the exact same issue would happen on GitHub with its Rebase-Merge style, which is basically identical.
In https://github.com/kiegroup/git-backporting/blob/main/src/service/git/github/github-client.ts#L49 and then https://github.com/kiegroup/git-backporting/blob/main/src/service/git/git-util.ts#L51 what the logical basically does is:
If the PR is:
- closed
- its merge_commit_sha commit only has one parent
- that merge_commit_sha is different than the HEAD commit sha of the PR
Then ultimately inferSquash() returns true, and as a result, only the HEAD commit of the PR is cherry-picked.
The only problem is: All those conditions are also true for a pull request that was "Rebase then ff" merged.
It's closed, the merge commit only has one parent, and unless the PR was fully up to date, it will be different than the PR head sha.
I'm not immediately sure how else to properly detect a squash-merged PR vs. a rebase merged one, but the current logic misidentifies rebase+ff merged ones, and misses potentially all but one commit from them.
This is happening on our Forgejo instance, but I believe the exact same issue would happen on GitHub with its Rebase-Merge style, which is basically identical.
In https://github.com/kiegroup/git-backporting/blob/main/src/service/git/github/github-client.ts#L49 and then https://github.com/kiegroup/git-backporting/blob/main/src/service/git/git-util.ts#L51 what the logical basically does is:
If the PR is:
Then ultimately inferSquash() returns true, and as a result, only the HEAD commit of the PR is cherry-picked.
The only problem is: All those conditions are also true for a pull request that was "Rebase then ff" merged.
It's closed, the merge commit only has one parent, and unless the PR was fully up to date, it will be different than the PR head sha.
I'm not immediately sure how else to properly detect a squash-merged PR vs. a rebase merged one, but the current logic misidentifies rebase+ff merged ones, and misses potentially all but one commit from them.