Skip to content

Incomplete parsing of metadata in .nuspec while pushing nuget packages #30265

Closed
@bheemann

Description

@bheemann

Description

The <dependencies>-element parsing of metadata in .nuspec file is incomplete.
Following nuspec dependencies documentation <dependency>-elements like:

<dependencies>
    <dependency id="PackageA" version="1.1.0" include="contentFiles, build" />
    <dependency id="PackageB" version="[1,2)" exclude="native, compile" />
</dependencies>

can be "stand-alone" or grouped (for target frameworks).

<dependencies>
    <group>
        <dependency id="RouteMagic" version="1.1.0" />
    </group>

    <group targetFramework=".NETFramework4.7.2">
        <dependency id="jQuery" version="1.6.2" />
        <dependency id="WebActivator" version="1.4.4" />
    </group>

    <group targetFramework="netcoreapp3.1">
    </group>
</dependencies>

Only the second one is implemented in gitea and mandatory for "error-free" parsing of .nuspec files.

As a result dependency-elements outside group-elements are ignored and missing in the output of metadata for the nuget package.

Tested on demo site with a random nuget package with dependencies.

As you can see in the following screenshot of metadata no dependencies are listed:
image

Gitea Version

v1.21.10

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker Compose

Database

None

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions