-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add support for deleting packages on new GitHub Packages architecture #83
Conversation
expect(result.versions.length).toBe(numVersions) | ||
done() | ||
}) | ||
const RATE_LIMIT = 99 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RATE_LIMIT was a limitation due to limitation of graphql api. Do we have the same limitation with REST or can it be updated/removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The delete version rest API works for a single version deletion only; hence no concept of rate-limiting here. However, I still think that we should rate-limit deletions in a single workflow. We can decide on the limit value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rate limit is 1000 requests per repository per hour when using GITHUB_TOKEN and 5000 requests per user per hour when using PAT. Considering the limit with GITHUB_TOKEN, I think 100 is sufficient as we would not want this workflow to exhaust a significant part of limit and possibly cause issue with other workflows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to 100 - 2de4236
src/delete.ts
Outdated
new Date(a.created_at).getTime() - new Date(b.created_at).getTime() | ||
) | ||
}) | ||
/* | ||
Here first filter out the versions that are to be ignored. | ||
Then update input.numOldeVersionsToDelete to the no of versions deleted from the next 100 versions batch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the batch part from the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the comment in 2de4236
action.yml
Outdated
|
||
package-type: | ||
description: > | ||
Type of the package containing the version to delete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the language here can be clearer since this is a customer facing help string for the param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to 👇 (2de4236)
Type of package. Can be one of container, maven, npm, nuget, or rubygems.
4833470
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Overview
Package registries on the new GitHub Packages architecture, including container registry, npm and nuget packages, no longer expose data through the GraphQL API. This action currently relies on using GraphQL to get and delete versions, thus making it incompatible with the new architecture
In this PR, we replace the GraphQL dependency with GitHub REST API for Packages along with some other changes and improvements
Changes
min-versions-to-keep
is given. Now all versions are first fetched and then processed in a single batchChanges in action parameters
package-type
param which is required in the REST APIsrepo
param as it is no longer neededpackage-name
param required even ifpackage-version-ids
is specifiedRelated