I have a CI pipeline that creates snapshot artifacts with constant version numbers after each commit to the development branch. Then the snapshots are deployed to the stages (dev, test) sequentially by hand. After successful testing, we merge everything into master and build a final release version for prod.

Deploying snapshots to test doesn't really make sense, because after a successful test by QA, someone could commit a change with a new bug and the whole test is obsolete.

So I need a way to quarantine the snapshot version being tested.

Approaches I found by googling around:

a) Separate branches for each environment. Good quarantine, but could cause chaos when merging all branches.

b) Create a release artifact and bump the patch number for each deployment to the testing stage: Great that commits after release are ignored. But seems a bit overkill, we need to keep track of version numbers for 20 microservices somehow.

c) Git tags are good for keeping track of which commit is in which environment. But googling "git tags staging" gives the impression that this is not the way to go.

d) Let CI write the commit hash into the version number. Seems to be the simplest solution so far.

What is the best practice strategy for quarantining snapshot artifacts and their commits before release?

Or for what buzzword do I need to search?

  • If qa has already tested a snapshot, why don‘t you just deploy that same snapshot to prod? You can tag the commit where the snapshot was taken from if you want to know which source version is currently deployed.
    – TheFogger
    Commented Apr 10 at 4:33
  • "Deploying snapshots to test doesn't really make sense, because after a successful test by QA, someone could commit a change" -- I don't understand this sentence; if someone commits a change, then the snapshot remains unchanged, the new commit results in a different snapshot; any new bug will not be present in the existing snapshot - Snapshots are immutable. Commented Apr 10 at 6:38
  • @TheFogger because we release on fixed release dates Commented Apr 10 at 7:08
  • @Theo5423324 Sorry, I don‘t understand what a fixed release date has to do with it. On the date of the release, take the most recent snapshot that has passed qa and deploy it to prod. What I am getting at is that git flow might not be a good fit for you.
    – TheFogger
    Commented Apr 10 at 8:53

1 Answer 1


I think gitflow would want you to create a release branch from dev and deploy that to your test server. Bug fixes go on this branch and its eventually merged into master and deployed to live.

You can continue on the dev branch with new features for the next release.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.