emgarten / Sleet

A static nuget feed generator for Azure Storage, AWS S3, and more.
MIT License
362 stars 43 forks source link

Implement retention policy #104

Closed sebastienros closed 4 years ago

sebastienros commented 4 years ago

Delete packages based on:

Not by date. Just in order to keep a limited set of packages.

emgarten commented 4 years ago

I like the version based approach to limit packages, this would be easy to use and straight forward to implement in Sleet.

It could work by:

LordMike commented 4 years ago

Possibly add a retention-clean command that has a --no-op / --dry-run option.

Concerns / use cases (focusing on SemVer - ie. 3 components + prerelease tag):

I could envision a situation where I'd also want different rules. An example is a speedy development cycle, where we might want to keep ALL pre-releases for the CURRENT/LATEST version, but a limited set of the non-latest versions.. And then finally, for the previous major version, we might keep no pre-releases at all.

I don't know yet how to describe this in rules.

emgarten commented 4 years ago

Package retention has been added in https://www.nuget.org/packages/Sleet/3.1.8

@LordMike I'm going to start with the basic scenarios for package retention. I've included --dry-run per your suggestion, I think that is a great idea. For more complex pruning scenario I'm interested in how these could be described or if an extension point is needed for this.