Skip to content
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

Adding Packages Api #2551

Merged
merged 7 commits into from
Sep 8, 2022
Merged

Adding Packages Api #2551

merged 7 commits into from
Sep 8, 2022

Conversation

JonruAlveus
Copy link
Collaborator

fixes #2360

Copy link
Contributor

@timrogers timrogers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to add this ❤️ I've reviewed commit-by-commit and it looks good to me from an API and basic implementation perspective, but I'm not a .NET expert, so let's wait for @nickfloyd to return from holiday before we merge (if that's okay!).

Octokit/IGitHubClient.cs Show resolved Hide resolved
Octokit/Helpers/ApiUrls.cs Show resolved Hide resolved
Octokit/GitHubClient.cs Show resolved Hide resolved
Octokit/Clients/IPackagesClient.cs Show resolved Hide resolved
Copy link
Contributor

@nickfloyd nickfloyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this all looks fantastic @JonruAlveus - other than the typos, this looks g2g! ❤️

{
public interface IObservablePackagesClient
{
IObservablePackageVersionsClient PackageVersions { get; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is one of those weird API domains where package versions are a subset of packages, yet a package version is a package.

What you've done here feels like it works - I'm glad you approached the relationship this way to help reduce namespace confusion - I think leaving PackageVersions out of this interface would've made things a bit more clumsy.

github.Packages.PackageVersions.GetAllForUser
github.Packages.GetAllForOrg

feels more elegant than something like (though possible):

github.PackageVersions.GetAllForUser
github.Packages.GetAllForOrg

While, as you've implemented, it can lead to a bit more verbose API call, I think the expression feels more natural ❤️ solid work here!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It is a little odd. I took my inspiration from the GitHub Api docs where it's all grouped together in one Packages section.

I've just pushed a final fix for the typos also.

@nickfloyd nickfloyd merged commit cf9db5f into octokit:main Sep 8, 2022
@nickfloyd
Copy link
Contributor

release_notes: Added Packages and Package versions APIs

@nickfloyd nickfloyd added Type: Feature New feature or request and removed category: feature labels Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Packages API
3 participants