What problem would this solve?
Feature Description
When a NuGet package is published, Gitea parses the .nuspec manifest but only
extracts the url attribute from the <repository> element (stored as
RepositoryURL). The additional, officially supported attributes type,
branch and commit are discarded during parsing and are therefore never shown
on the package detail page.
Example <repository> element as defined by the NuGet spec (supported since 2016):
<repository type="git"
url="https://gitea.example.com/owner/repo.git"
branch="main"
commit="0123456789abcdef0123456789abcdef01234567" />
These attributes carry useful provenance information: they let a package consumer
see exactly which branch and commit a given package version was built from, which
is valuable for traceability and reproducibility.
Proposal
- Extend the nuspec parser (
modules/packages/nuget/metadata.go) to read the
type, branch and commit attributes of the <repository> element.
- Add corresponding fields to the
Metadata struct (e.g. RepositoryType,
RepositoryBranch, RepositoryCommit).
- Render these fields on the package detail page template
(templates/package/content/nuget.tmpl), e.g. as a small "Source" section,
ideally with the commit linked to the repo when the URL points to the same
Gitea instance.
Notes
Screenshots
N/A
What do you propose?
please extend the template und parse the 3 attributes. thx
What problem would this solve?
Feature Description
When a NuGet package is published, Gitea parses the
.nuspecmanifest but onlyextracts the
urlattribute from the<repository>element (stored asRepositoryURL). The additional, officially supported attributestype,branchandcommitare discarded during parsing and are therefore never shownon the package detail page.
Example
<repository>element as defined by the NuGet spec (supported since 2016):These attributes carry useful provenance information: they let a package consumer
see exactly which branch and commit a given package version was built from, which
is valuable for traceability and reproducibility.
Proposal
modules/packages/nuget/metadata.go) to read thetype,branchandcommitattributes of the<repository>element.Metadatastruct (e.g.RepositoryType,RepositoryBranch,RepositoryCommit).(
templates/package/content/nuget.tmpl), e.g. as a small "Source" section,ideally with the commit linked to the repo when the URL points to the same
Gitea instance.
Notes
NuspecContent, so the source data isavailable; only parsing and display are missing.
about displaying the metadata, not linking the package to a repo.
Screenshots
N/A
What do you propose?
please extend the template und parse the 3 attributes. thx