now that Octopus has added Channels, there is a problem with the Retention Policy and how it counts releases.
we have code in our source control that we build from two different branches each night, one for QA and one for Release. at the end of the build process, we send a command to Octopus (using Octo.exe) to create a release, so one is created in the QA channel and one in the Release channel. Each of these channels are using a different lifecycle (a QA lifecycle that includes only the QA environments in one stage, and a Release lifecycle that has staging and production stages.) pretty standard for using channels.
the retention policy for both lifecycles is set to retain 3 releases.
so here’s the problem:
when the retention policy runs, it works it way through the lifecycles. it gets to the QA lifecycle first, and starts the process, keeping a few releases because they’re on the dashboard, then starts counting the other releases to determine what it can delete. it counts up to 3, and then sees a 4th release and deletes it. so far behaving correctly.
then it moves on and gets to the Release lifecycle. when it starts looking at the releases, it skips the first few because they’re on the dashboard, but when it moves on the older releases, when it gets to the first one, it says it should be deleted because the number of releases being retained has already reached 3!
so the releases retained for the project in the QA lifecycle are being counted against the releases for the same project in the Release lifecycle. this is not normally a problem, but this morning, the retention policy happened to run between when the releases were created and when they get used (a few hours later.) and so the most recent release in the Release lifecycle got deleted because it hadn’t been deployed yet and the counter had already reached 3 because of the earlier work in the QA lifecycle. and therefore the release that was then run was yesterday’s release, today’s having just been deleted.
I think the release counter needs to be reset to 0 for each lifecycle when running through the retention policy.
does this make sense? I can attach the output of a run of the retention policy if that will help.