-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
cargo registry - respect renamed dependencies #32430
base: main
Are you sure you want to change the base?
Conversation
This is my first PR to gitea and first ever two lines of go code so please keep that in mind :) From what I can tell there is some sort of testing machinery in tests/integration/api_packages_cargo_test.go . Should I update that to test this? |
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.
Looks fine to me, but I'm not certain if that is doing everything it should.
It's probably best if @KN4CK3R looks at it as well.
The links i used:
|
modules/packages/cargo/parser.go
Outdated
@@ -137,14 +137,15 @@ func parsePackage(r io.Reader) (*Package, error) { | |||
dependencies := make([]*Dependency, 0, len(meta.Deps)) | |||
for _, dep := range meta.Deps { | |||
dependencies = append(dependencies, &Dependency{ | |||
Name: dep.Name, | |||
Name: dep.ExplicitNameInToml, |
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.
This should probably default to dep.Name
if dep.ExplicitNameInToml
is not set
It's better to have a test for that. |
rust allows renaming dependencies such as when depending on multiple versions of the same package. This is not supported by gitea as discovered in #31500 . This PR tries to address that.
Not yet tested