I think I can get close enough, without a lot of complexity, by using the retention rules, and setting them fairly tight since it's a dev feed and these packages are meant to be transient.
We don't have a package promotion process right now, although it's on my roadmap. These rules may have to be revisited when i implement that.
Right now I've got it set for:
- Delete unused versions not requested in last 30 days.
We are not great at deleting old branches, so this might actually be better than a branch-delete trigger. And if someone comes along and needs an old branch build, they can just rebuild it.
We don't really use the connector feature for our own feeds (or any), so i think this will do it.
I got a little confused at the combination of "keep only last 5 versions" plus the 30-day window. From what i've read in the docs, all conditions must pass for the item to be deleted. How do i set up, "keep only the last 5 versions, but when nothing has been requested for 30 days, delete them all"?
This solution has the benefit of simplicity and native functionality. I don't have to write a hacky, multi-tool process to manage it.