-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 of Chocolatey in packages has flaws #31168
Comments
I tested choco commands Here are the detailed requests:
|
Fixes issue when running `choco info pkgname` where `pkgname` is also a substring of another package Id. Relates to #31168 --- This might fix the issue linked, but I'd like to test it with more choco commands before closing the issue in case I find other problems if that's ok. --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Fixed with #31188 |
Fixes issue when running `choco info pkgname` where `pkgname` is also a substring of another package Id. Relates to go-gitea#31168 --- This might fix the issue linked, but I'd like to test it with more choco commands before closing the issue in case I find other problems if that's ok. --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Backport #31188 Fixes issue when running `choco info pkgname` where `pkgname` is also a substring of another package Id. Relates to #31168 --- This might fix the issue linked, but I'd like to test it with more choco commands before closing the issue in case I find other problems if that's ok. I'm pretty inexperienced with Go, so feel free to nitpick things. Not sure I handled [this](https://github.com/tdesveaux/gitea/blob/70f87e11b5caf1ee441ae71c7eba1831f45897d4/routers/api/packages/nuget/nuget.go#L135-L137) in the best way, so looking for feedback on if I should fix the underlying issue (`nil` might be a better default for `Value`?). Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Fixes issue when running `choco info pkgname` where `pkgname` is also a substring of another package Id. Relates to go-gitea#31168 --- This might fix the issue linked, but I'd like to test it with more choco commands before closing the issue in case I find other problems if that's ok. --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Description
We attempted using our GItea instance as a mirror of community.chocolatey.org and encountered an issue when using the command
choco info git
.Our instance host both git and GitVersion packages.
Running
choco info git
returns information for the GitVersion package.This is due to a shortcut in the implementation of the
$filter
argument.Running with verbose
choco info --verbose --ignore-http-cache git
, we can see choco request information with a HTTP queryhttps://{host}/api/packages/{org}/nuget/Packages()?$filter=(tolower(Id) eq 'git') and IsLatestVersion&semVerLevel=2.0.0
filter
is used withtoLower(Id) eq
for match, while the implementation of Gitea assume it will always run withsubstringof
(as can be seen in tests).Using curl to send the same request, I can see Gitea returns multiple entries, where the GitVersion one is the first. I assume then choco only use the first entry from the response.
I think this should be pretty easily to reproduce as a case in the test linked before.
If needed, .nupkg can be downloaded directly from the packages page on community.chocolatey.org linked above.
Gitea Version
1.21
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
Gitea build ourselves from a fork with negligible changes (none that can concern the packages feature).
Hosted on a Debian, run from systemd.
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: