We have main branch for the initial state of the training with frontend, backend skeleton and exercise descriptions.
Then we also have a solution branch and we used to have additional solution branches per exercise.
Due to the high effort maintaining changes across all these branches, we removed the other partial solution branches.
In the last training we got the feedback that participants were missing partial solution branches if they could not complete an exercise on time but wanted to continue and catch up for the next exercise.
The idea of this story is that we reintroduce these branches but add some workflow that will help us maintaining the changes:
- sync-main will merge all changes made to main to the next higher branch (solution/exercise-1). So if we update an exercise or a version in pom.xml, etc. the update will also arrive on the next solution branch (and from there upwards to all others).
- In the same way we merge changes from solution/N to solution/N+1 where the last branch is
solution/complete.
Questions/discussion:
- How to deal with conflicts? I would suggest to collect them and either just somehow report them or even automatically create a PR out of it for us to resolve manually. In any way the conflicts should then be discarded keeping so the file remains unchanged on the target branch.
- We could also go the other way around and only maintain the
solution/complete branch. Then we could even add comment markers to the code telling what sections are specific for what exercise and need to be removed to get to the state before the exercise. This could even avoid all conflicts since we only maintain one branch and could generate everything else from it. Then the workflow could even run manually so we can do various small changes to the solution and when we are ready, we would simply run the workflow to update/re-generate all the branches.
We have
mainbranch for the initial state of the training with frontend, backend skeleton and exercise descriptions.Then we also have a solution branch and we used to have additional solution branches per exercise.
Due to the high effort maintaining changes across all these branches, we removed the other partial solution branches.
In the last training we got the feedback that participants were missing partial solution branches if they could not complete an exercise on time but wanted to continue and catch up for the next exercise.
The idea of this story is that we reintroduce these branches but add some workflow that will help us maintaining the changes:
solution/complete.Questions/discussion:
solution/completebranch. Then we could even add comment markers to the code telling what sections are specific for what exercise and need to be removed to get to the state before the exercise. This could even avoid all conflicts since we only maintain one branch and could generate everything else from it. Then the workflow could even run manually so we can do various small changes to the solution and when we are ready, we would simply run the workflow to update/re-generate all the branches.