[repo-assist] Fix #3603: paket pack reads Package-prefixed metadata from SDK-style csproj - #4417
Open
github-actions[bot] wants to merge 1 commit into
Conversation
…perties SDK-style csproj files conventionally use Package-prefixed MSBuild properties (PackageReleaseNotes, PackageProjectUrl, PackageIconUrl, PackageLicenseExpression, PackageLicenseUrl, PackageRequireLicenseAcceptance, PackageTags) instead of the legacy plain property names. GetTemplateMetadata() previously only read the plain names, so 'paket pack' silently dropped this metadata for SDK-style projects. Added propOrPackage/propMapOrPackage helpers that try the plain property name first (preserving legacy behavior) and fall back to the Package-prefixed name. This matches the convention already used by Paket.Restore.targets, which maps PackageReleaseNotes to ReleaseNotes when invoking PackTask. Added regression tests verifying the fallback works and that a plain property still takes precedence when both are present. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dsyme
marked this pull request as ready for review
September 1, 2026 15:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Closes #3603
Root cause
ProjectFile.GetTemplateMetadata()(used bypaket packto read NuGet metadata directly from.csprojfiles) only read the legacy plain MSBuild property names:ReleaseNotes,ProjectUrl,IconUrl,LicenseExpression,LicenseUrl,RequireLicenseAcceptance,Tags.SDK-style (new-format)
.csprojfiles conventionally set thePackage-prefixed equivalents instead:PackageReleaseNotes,PackageProjectUrl,PackageIconUrl,PackageLicenseExpression,PackageLicenseUrl,PackageRequireLicenseAcceptance,PackageTags. As a result,paket packsilently produced packages missing release notes (and other metadata) for SDK-style projects using these properties.This is also inconsistent with Paket's own
Paket.Restore.targets, which already mapsPackageReleaseNotes→ReleaseNoteswhen invokingPackTask.Fix
Added
propOrPackage/propMapOrPackagehelpers inGetTemplateMetadata()that try the plain property name first, then fall back to thePackage-prefixed name. This preserves existing behavior for legacy-style projects (plain name always wins if present) while fixing the gap for SDK-style projects.Trade-offs
Only extended fields with an established
Package-prefixed MSBuild convention (matching whatPaket.Restore.targetsalready expects). Fields likeTitle,Owners,Summary,Readme,Language,Icon,Copyright, and repository info were left unchanged since they don't have an equivalent SDK convention.Test Status
dotnet buildsucceeds with no new warnings/errors.tests/Paket.Tests/Packaging/PackageProcessSpecs.fsverifying the fallback and that plain properties still take precedence — both pass.PackagingProcesstest module: 5/6 pass; the one pre-existing failure (Loading assembly metadata works, a version-string mismatch) is unrelated to this change and reproduces onmasteras well.Add this agentic workflow to your repo
To install this agentic workflow, run