github/branch-deploy

Identical Merge Commit Check - Issues

GrantBirki opened this issue · 3 comments

Identical Merge Commit Check - Issues

I have noticed that if the last "commit" on a PR is a merge commit from clicking the Update Branch button (on a PR), that when said PR is merged, the commit checks are different and the "merge commit check" fails and a fresh deployment is triggered again.

This is certainly a bug and should be resolved.

Reproduction Steps

  1. Open a PR with a single commit (could be anything)
  2. Push a commit to the $default_branch (main in most cases)
  3. Go back to your PR and click the Update Branch button
  4. Deploy your PR
  5. Merge the PR and witness the repo be deployed again because the commits are "different"

Example

Branch is updated:

Screenshot 2023-08-14 at 5 59 03 PM

Deploy command is issued:

.deploy

PR is merged:

Screenshot 2023-08-14 at 5 57 31 PM

Merge Commit Check on main runs:

latest commit on main excluding the merge commit: d9bd...
latest deployment sha: 13d5...
latest deployment is not identical to the latest commit on the default branch

Inspecting the merge commit on main from where the PR was merged:

Screenshot 2023-08-14 at 6 01 30 PM

^ the final screenshot seems to point to the issue. There are two parents leading to the final commit on main being brand new. The first one being where we hit the Update Branch button on our pull request (resulting in 13d5...) and the other one being the latest commit prior to this PR that was merged into main

Either way, the resulting commit on main is completely different from the commit of the latest PR that was deployed so this is a bug that needs to be resolved. I volunteer myself lol

I tried for quite a while to get this bug fixed without any luck. It seems this is getting marked up as a "known issue" for now unless someone has a brilliant idea on how to resolve this.

Everything works as expected in its current state except for when you click the "update branch" button in the GitHub UI, deploy, then merge. There is some sort of dark magic going on with parent commits, merge commits, or something of the sorts. I'm going to "phone a friend" internally at GitHub for support.

All the logic that occurs behind this check takes place in this file

Resolved through the amazing help from @chrisgavin 🌟