In the world of DevOps, deploying applications on z/OS involves managing different component versions. You have two main types: FULL versions, which contain the entire application, and incremental versions, which package a specific set of file changes. These incremental versions are great for speed and efficiency, as they typically represent a developer's latest committed changes. However, this can lead to situations where different versions share some common files while also having their own unique ones.
This brings us to a critical aspect of application deployment: Rollbacks.
Why Do We Need to Rollback?
Let's face it, sometimes things go wrong. A deployment might introduce a bug, or a planned feature might be pulled from a product release. In a shared environment, stability is key. When a deployed version causes issues, you need a quick and reliable way to remove it and restore the environment to a known good state.
The Challenge of "Risky" Rollbacks
To handle this on z/OS, the Rollback Datasets plugin step in DevOps Deploy is your go-to tool. It’s designed to restore the artifacts that were present right before the problematic version was deployed.
To avoid accidentally undoing necessary changes, the plugin includes a fantastic feature called "Prevent Risky Rollback." This feature stops a rollback if the version you want to remove contains files that have since been updated by a newer deployment.
So, what exactly is a risky artifact?
Imagine you deployed Version 1 with a file named FILE-A. Later, you deployed Version 2, which included an updated version of that same FILE-A. If you now try to roll back Version 1, FILE-A is considered a risky artifact. Why? Because rolling it back would mean deleting the newer, active version from Version 2, potentially causing a whole new set of problems.
Action: Rollback Version-1 from the Dev environment
Result : The rollback process succeeds removing the FILE-A and FILE-B from the environment as they were non-existent before Version-1. This action has inadvertently removed the file FILE-A of Version-2