In Azure DevOps Server 2022.1 one can create release pipelines with different stages. These stages can be configured with a certain amount of Days to retain a release and Minimum releases to keep (as long as it obeys the Maximum retention policy on project level).
Let's assume a scenario in which two stages - A and B - are the only stages and A must succeed or fail before deployment to B is even considered. The configuration is as follows:
| Stage | Days to retain a release | Minimum releases to keep |
|---|---|---|
| Stage A | 10 | 5 |
| Stage B | 5 | 3 |
I would assume that, since Stage A must be passed before Stage B, the retention settings of A overwrite those of B, so to speak: A release that was deployed to B will be retained for 5 days, which doesn't matter, because it would be retained for 10 days by A anyways. At least 3 releases that reached B will be kept, but that doesn't matter either, because A will include those 3 in its own 5 kept releases.
Am I misunderstanding something here or are there only two viable options to consider when configuring stages: Either adopt the settings of the preceding Stage A in Stage B or make sure that B has higher values in its settings than A?
Based on your description, I generated the sample release pipeline below and created several releases.
With the rules stated in the document,
Here is my understanding of how the 10 releases will be retained.
Besides, I was unable to figure out a method to get the release retention licenses and verify my hypothesis. It is recommended you go through this document and share the scenario you may encounter for further discussion.
Hope the information helps.