Replies: 1 comment 1 reply
-
For clarity and alignment - I expect to never need to merge main (current next) and release branches. Cherry picking commits will always suffice. Notwithstanding (probably rare) cases where a merge is equivalent to cherry-picking due to the nature (and lack of) recent changes in main. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context
Recently we discussed alternatives, @marti proposed 3 options, and I proposed a variation of one of them.
Refresher - Status Quo
We have two branches,
mainrepresenting testnet, andnextrepresenting devnet.At some point in time we merge
mainintonextto ensure we haveall changes rom
maintonext. And vice verse to start a new cycle.This works OK up to a certain point of change-rate
where merging
maintonextcauses a lot of conflicts, usually caused by eithernextbeing far ahead in the sense of breaking changes applied, but alsomaingetting "hotfixes" that are relevant to code that doesn't exist in
nextanymore.It's both error-prone and time intense.
We also chose a development target per feature/PR depending on urgency, either being merged
first into
nextor intomain. Changing this is similarly painful given a sufficentdelta between
nextandmain.Ensuring Consistency
Consistency is ensured as long as the merge is done correctly, which becomes challenging the further
nextandmaindeviate from one another.CI / CD
We do manual deployments, where we do have a 1:1 mapping between devnet and testnet to
mainandnext.The deployment itself is however brittle and comes with guaranteed downtime.
Alternative / Option 4
Instead of having two branches, we branch off at an arbitrary, agreed on point in
nextand create a new
release-${major.minor}.xrelease branch. It's going to be the sourcefor all patch releases of
${major.minor}. Once the branch is not needed anymore, we can simplystop updating it. At no point in time we have to merge
nextorrelease-${major.minor}.xever again.The git history becomes a true DAG in respect to commit histories outside of PR merges.
Ensuring consistency
Since this does not cover an automatism to transfer all changes, we have to have a deliberate manual flow of changes from
nextto the relevant feature branches.It can be summed up in one rule:
There must be an agreement, that unless something is a hotfix that is only required for a specific branch,
nextmust receive the fix first, and then a second PR can be openend against any release branchcarrying the changeset - with adaptations to the relevant branch, and a backlink to the original PR for
next.It allows for easy tracking which branches received a certain fix and which did not.
CI / CD
The flow here requires a per-branch pipeline. The definitions of
devnetandtestnetabecome indirections that we can change atomicallyby redirecting URLs from one live network to another. It comes with additional complexity.
Beta Was this translation helpful? Give feedback.
All reactions