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

Support for Chocolatey/NuGet v2 in packages #21294

Closed
Jamie96ITS opened this issue Sep 28, 2022 · 5 comments · Fixed by #21393
Closed

Support for Chocolatey/NuGet v2 in packages #21294

Jamie96ITS opened this issue Sep 28, 2022 · 5 comments · Fixed by #21393
Labels
topic/packages type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@Jamie96ITS
Copy link

Jamie96ITS commented Sep 28, 2022

Feature Description

I'd like to suggest an addition to the Packages feature...Chocolatey packages. As an API reference, this would require NuGet v2 support(I understand there are some enhancements for a full-featured Chocolatey repo but NuGet v2 is the base). Additionally, this would change up the package view page with references to chocolatey commands, e.g. choco push and choco install instead of the dotnet NuGet commands. I personally would try to put choco:// links on the page but that protocol is unofficial.

While Chocolatey will eventually upgrade to support NuGet V3, and technically you could use Gitea's NuGet API as a repo at that point, there is no set date on that upgrade and the pages would reference dotnet commands.

Thoughts?

Screenshots

No response

@Jamie96ITS Jamie96ITS added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Sep 28, 2022
@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 7, 2022

I did not test it but can't you just use the NuGet registry as a Chocolatey registry?

@Jamie96ITS
Copy link
Author

Jamie96ITS commented Oct 7, 2022

I did not test it but can't you just use the NuGet registry as a Chocolatey registry?

Unfortunately you cannot. While you can apparently still Push packages to the registry if you drop the index.json from the API, use of the API on the client side to query and pull packages does not work. I believe this is because Gitea only supports v3 of the NuGet API? Chocolatey does not support that yet™️. It is a major overhaul for Chocolatey that has been in the works for some time now and may be quite a while longer to be finished. I’m on mobile now and will edit this/respond later to reference the open issue there. See Choco 1697 and Choco 508

So for Chocolatey, we would need the v2 version of the NuGet API, which I understand is quite old and deprecated on the NuGet side of things. Hence it would make sense to leave NuGet alone and consider it as a Chocolatey API, especially if it were ever to include any of their “enhancements”. Though I don't think those are strictly necessary, if someone were to figure them out, they don't belong with vanilla NuGet.

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 7, 2022

Ah, missed that they only support v2, thanks. I will have a look at the v2 api spec.

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 10, 2022

I have added #21393. Could you test this PR?

@Jamie96ITS
Copy link
Author

So far so good! It works for everything I use it for. I can push, list, info, and install without complaint.

wxiaoguang added a commit that referenced this issue Oct 13, 2022
Fixes #21294

This PR adds support for NuGet v2 API.

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/packages type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants