Artifact versioning identifies the output of a build, not just the source code that produced it. Two builds from the same commit can differ if a base image, dependency, or build tool changes. Give each published output a distinct version and record its source revision, build inputs, and checksum or digest where supported. Use semantic versions when they communicate a real compatibility contract; date-based versions or build numbers can be more useful for regularly patched machine images. Whatever the naming scheme, publish changed content as a new version rather than overwriting an existing one.
Separate the identity of an artifact from its release status. A registry tag such as stable can point to whichever version is currently approved, but the tag alone might not establish what a deployment received. Pin production deployments to an immutable reference, such as a container digest or an explicit image version that cannot be overwritten, and record that reference in deployment history. Build once and promote the tested output rather than rebuilding it for each environment. If an artifact must be copied to another registry, account, or region, verify its identity or integrity at the destination before deploying it.
For a fleet of virtual desktop session hosts, publish a new VM image version whenever the base OS, desktop applications, or host agents change. Record the build inputs and validate the candidate on a small group of hosts, including sign-in, profile loading, and application launch. Once the image is available in the target regions, roll it out in batches: provision hosts from the approved version, direct new sessions to them, and drain older hosts before removing them. Publishing the image does not patch existing hosts. If validation fails after rollout begins, keep traffic on healthy hosts or provision replacements from the previous approved image, provided it is still safe and compatible.
Retention is a balance between recovery needs, storage and replication cost, and the risk of leaving obsolete versions deployable. Define approval, deprecation, and deletion rules before automating cleanup. Keep enough known-good versions to cover the rollback window, protect versions still referenced by deployment or scale-out configurations, and block new use of vulnerable versions even if policy requires retaining them for audit. Before deleting a version, check that recovery and provisioning workflows no longer rely on it. An artifact rollback restores deployable content, not data: a previous application version may still fail against a newer database schema. Test rollback with the state and dependencies it will encounter in production.