My team has recently transitioned to a GitHub Actions CI/CD workflow and we are encountering an issue that I'm uncertain how best to resolve.
First, I'll describe our current branching strategy:
We are a Salesforce stack shop that uses the Org Development model. This means that each developer has their own sandbox, and in addition we have Integration, UAT, and Production environments.
We have created 3 long-lived branches in git that are meant to represent each of these non-developer sandboxes (int
, uat
, main
). The intended workflow is as follows:
- All
feature
branches should be based frommain
. - Once a
feature
branch is considered ready for QA, a Pull Request is opened to compare the branch toint
. Once squashed and merged, a GitHub Action will deploy the delta to the Integration environment. - Once QA is complete, a Pull Request is created to compare the
feature
branch touat
. Once squashed and merged, a GitHub Action will deploy the delta to the UAT environment. - After UAT sign-off, a Pull Request is created to compare the
feature
branch tomain
. Once squashed and merged, a GitHub Action will deploy the delta to the Production environment. - If at any point
main
should be updated, thefeature
branch should berebased
on top ofmain
.
The issue we have encountered is that after a feature
branch has been merged into both int
and main
, our int
branch still seems to think that it is behind the main
branch. Example:
feature/A
withcommit1
has been squashed and merged intoint
,uat
andmain
via Pull Requests and subsequently deployed to their relevant environments.feature/B
is then created based onmain
, which includes the changes fromfeature/A
.feature/B
is ready to be merged intoint
, and a Pull Request is created.- At this point, git does not see that
commit1
is already represented inint
and wants to re-merge this commit intoint
.
Looking into it, I can see that commit1
has a different hash in the int
branch than the one in main
. So, I believe I understand why git does not see these as the same commit, but I'm unsure what has caused the hash to change.
I'm certain I'm overlooking something here, or perhaps misunderstanding what is happening with git behind the scenes. Any help would be greatly appreciated.