1

I am currently implementing a Trunk Based Development workflow utilizing Short Lived Feature Branches in a project I am working on. Recently I have realized my release strategy is less than optimal, and I'm working to move to a Branch For Release, strategy for creating new releases.

Given I am implementing Branch For Release, how should my version update commit be done? My inclination is that I create a release branch off of trunk, and the first commit to that release branch is the version update commit. Is this correct? Should a version update commit ever be done on trunk and possibly cherry-picked in?

If I'm doing things this way, where would my CI/CD pipeline look for the last version released in order to auto update the semantic version for the next release? Is there a standard place the version information is pulled from, or is it gleamed from the git graph itself (looking at let's say a git tag or something)?

In general, I'm just trying to really understand where this release specific information (build number is another component of this type of info) is committed / stored / retrieved from in a trunk based development branch for release workflow.

Thanks for any help in advance!

Sample Graph With Release

8
  • 1
  • 1
    In general, have a look at questions tagged git and versioning for lots of additional information. Dec 1, 2022 at 20:38
  • I would recommend against trying to use git as way of controlling your software release versions entirely (i.e. simply don't store "real" versions in git -- at best you may wish to use "tags" as a way of linking a commit to a released version stored somewhere else, but I would not treat git as the controller or source of your versions). Instead consider deferring any kind of release versioning as a "packaging" step to happen after a successful build, storing complete, built, deployable, versioned artefacts in some kind of artefact registry (which are better suited to versioning). Dec 1, 2022 at 20:42
  • 1
    To expand on @BenCottrell's comment, you also don't want to store information in Git about what is deployed to which environment. This is not a problem version control was meant to solve. Dec 1, 2022 at 20:55
  • please don't cross-post: stackoverflow.com/questions/74552819/… "Cross-posting is frowned upon as it leads to fragmented answers splattered all over the network..."
    – gnat
    Dec 1, 2022 at 21:22

0

Browse other questions tagged or ask your own question.