Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Retention Rule for Asset Directory: Keep last N versions or filter by date
-
Unlike for the package feed retention rules, there doesn't seem to be a possibility to keep the last N versions of a file in an asset directory (with versioning enabled). In the documentation, it says that with the retention rules it should be possible to "delete old versions of assets". However, I don't see a way to achieve this in the UI, since it only can filter versions based on the number of downloads or the download dates. In our case, it isn't guaranteed that a new version of a file is downloaded, but we still would like to keep it in the asset directory.
Am I missing something here? Is there a way to enable similar retention rules for the asset directories as there are for the package feeds? Specifically, we either would like to keep the last N versions of a file, or alternatively have the option to remove all files that are older than X days.
-
Hi @zs-dahe ,
Thanks for pointing this out - I don't think anyone's noticed this before
You are correct, this is not supported - and actually it's never been supported. I just updated the documentation to clarify this.
Looking at the code, this wouldn't be trivial to implement and would introduce a fair amount of risk. We would basically have to rewrite retention rules for asset directories, which is a bit scary. I suspect that's why it was never implemented in the first place, and we just didn't update the docs (which we try to write before/during feature development).
Asset versioning is really just intended to undo an accidental change/deletion and download an old version of a file. We don't envision lots of versions of files, so it doesn't seem like a needed feature -- would be interested tot learn how you intend to use it?
Best,
Alana
-
Thank you for this clarification. We would like to use the asset directory to store the most recent version of a file that is periodically generated by an automated task (once a week). The old versions of the file are only needed as backup in case that something went wrong during the automated build. Thus, we only need the last few versions of the file and only need to access them in rare cases. The retention feature would be useful because with versioning enabled the individual versions will quickly take up considerable space.
Would it be worth trying for us to automate this retention rule through the API?
-
Hi @zs-dahe ,
Thanks for clarifying, that makes sense; that's not really the use case we intended for asset directory versioning, it was mostly a simple way for asset-directory end-users (i.e. generally not ProGet admins) to fix the occasional delete/accident. It's redundant with back-up, but the idea was that it would save administrator time at the cost of a little disk space.
Since it'd be such a large change on our end to rewrite this, it'd be best to wait until there's more demand.
Perhaps you could just not use asset versioning , and allow your backup server to handle this? Typically back-up tools will already retain a certain number of past versions of files.
Cheers,
Alana