Thanks @lee-dohm for your reply.
I do understand that in GitFlow, we have a single “master” branch that is always production deployable and whatever post related with this i have seen on different forums, all are using same flow.
But in my case, the demand from business is quite different, which I’m trying to list here :
- There should be always a branch equivalent to “production” code. This is because whenever any Severity 1 comes on Production, there should be one branch where Developers can check-in the code immediately.
- We have to also plan Production deployment for Severity 2 defects (these are those defects which are not asked by Business to fix immediately, but to deploy these defects once in a two week.)
- One branch for “Release”, so that new requirement/enhancement can be continuously checked-in by different Developers in this branch. User Acceptance Testing would go from this branch for “new releases”.
So, to conclude I need to have three branch always available for Developers to check-in the code(And I believe these branches should be Remote only(can’t be local), as out of this three branch, two branches should be always pointing to dedicated environment(stage) for deploying the code so that Continuous Integration and Continuous Deployment can go on without manual intervention and User acceptance testing can go on both for points 2 and 3 said above.
Please note, I have pre-decided dates for deployment on Production for Points 2 and 3. Also, these dates are always different. Point 2 deployment is bi-weekly whereas deployment from Point 3 could be after 2-3 months.
Also, I have to have point 1 (i.e. dedicated branch equivalent to Production code), so that work in progress on 2 and 3 can go on parallelly and if any Severity1(hotfix) is required on Production, it can be done immediately.
Also, on point 2 and 3, I have different squads(30-40 developers) working dedicatedly on these.
And Point 3 commits can’t be merged into point 2 until point 3 code gets deployed on Production, as I can have an earlier date for deployment on Production for point 2. Similarly, Point 2 commits can’t be merged into Point 3 until Point 2 gets deployed on Production.
same for Point 2 as well. That brings us to another conclusion that we need to merge one branch code into another branch only after Production deployment. So local branch won’t help me here. And this is because We can’t merge each any every commit of local to “master/production” branch until User acceptance test passed on SIT Stage OR It gets deployed on Production. This also means that these commits have to be deployed in any environment and only after successful testing it can be deployed. This means commit has to be done in the remote branch so that continuous deployment can be triggered.
Now, we have one more requirement in the Agile way of working. In Git, we call it Feature branches, where Developers have to commit the code related with new feature/releases. It’s OK for Developer to commit their respective code against different feature branches. But We have business requirement of getting User acceptance testing done for these feature branches also. Please note at the same time one more User acceptance testing would be going on our UAT stage (for point 3. which is next immediate release on Production). I can’t have a different environment for different feature branches as it involves cost and effort in setting dedicated environments. So, in this case how to get feature branch User Acceptance testing done?
In the current situation, I have one environment only, where I used to get deployment from one branch (let’s say Development branch). Here, I ask Developers working on Feature streams to keep committing code into Development branch also so that User acceptance testing for new Features ( Which are next to immediate Production release) can go on.
Hence, it concludes one more branch i.e. Development branch. A Feature can have committed for 1-2 months code.
I tried to write each and every problem statement here. I, now realized that I wrote almost 1000 words.
This is the real Business case and real Problem. Could you please suggest the best solution for this
Just to conclude here, I have below problems/requirements:
- Three master type branch ( always available for Production deployment. 1 is dedicated for QuickFix on Production, 1 for Sev2s and 1 for next immediate Release on Production and on last 2 branches, I have to get User Acceptance testing done parallelly)
- Codes of one branch to merge into different branch only after Production deployment.
- One more branch as “Development” branch where all Features branch code be committed and code will be deployed on any SIT stage ( Please note during this duration another UAT would be also going on for next immediate Production release on other environment, so i can’t use same environment for Feature branches).
- How to merge 1-2 months code from Development branch into Release branch ( As Release branch is for next Production deployment and for those UATs which was not done via Development stream)
- Also, commit in local branch won’t help. As For deploying same on any SIT/UAT Stage, I need to automate deployment from a dedicated branch(In case of Git, it can be remote branch only as we have to build all codes committed by different developers, so local branch can’t help), so that continuous deployment can go on without manual intervention( manual switching to different branches for deployment ).
Hoping I’m clear in my requirement and will get answer shortly Thanks in advance!