-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retention policy when deleting packages #77
Comments
I'd like to include a policy for only deleting packages with 0 downloads or some maximum number of downloads. I'm wondering what the switch should be.
I'd want to pair it with the retain policy. For example, this might delete package versions with 0 downloads unless they are in the 5 most recent:
Does that make sense? What would your preference be for the switch name? |
Do you think this feature should have built in knowledge of SemVer or should we do more generic version string matching? For example, we could support including or excluding a version string match:
|
I like your suggestions but IMHO |
You could also introduce explicit switches such as |
Bonus feature: Show preview of packages that will be deleted and a confirmation prompt (Are you sure you want to continue?). For automation purposes this prompt must be bypassed if |
In order to prevent regressions when adding new features it would be awesome if each command have corresponding integration tests. This is trivial because we can mock |
I've got something similar to this in place (to avoid the prospect of deleting all packages in an organization 😉). By default, it only lists packages that would be deleted. You need to
I think this filter will need some unit tests at the very least. I'd be a little scared of mocking GraphQL, but it might work. 😉 Feel free to jump on this one if you have the inclination! |
MyGet
supports retention policies. Our in-house projects publishesnupkgs
for all PRs so that they may easily be tested using feature flags. All projects has been migrated away fromMyGet
after GitHub packages was GM-ed. Because there is no option for specifying retention policies using GitHub actions this means that after a PR has been merged the NuGet package still remains. If you have large packages, this wastes storage space. Ideally the package would automatically deleted when the PR has been merged but this will require us to integrate with libgi2sharp. This should not be that difficult but it consider it a nice-to-have feature.GitHub Actions supports scheduling using a cron expression. This means that if we implement support for a simple retention policy
gpr
could be used to enforce one or multiple retention policies. We should not invest too much time into this feature as it very likely GitHub will implement this feature in the nearest feature as enterprise customers will not migrate due to the cost factorgpr delete -r ${{ github.repository }} --match -prerelease -k ${{ github.token }} --retain-policy 5
gpr delete -r ${{ github.repository }} -k ${{ github.token }} --retain-policy 5
The default package name is
${{ github.repository }}
.The text was updated successfully, but these errors were encountered: