Repository navigation
Packages: show the version's changelog section as NuGet release notes - #139
Merged
Merged
Conversation
src/Directory.Build.targets sets PackageReleaseNotes before GenerateNuspec from the package's own CHANGELOG.md, rendered as nuget.org shows it: plain text, so links read "text (url)" and code marks, bold and "### " go. One footer links the changelog at the version's tag. The pack fails, naming the file, on a missing changelog, a missing or empty section, or notes over 35,000 characters, and the changelog joins NuGetPackInput so a repack does not keep stale notes. PackagingConventionTests packs each project and compares the nuspec's releaseNotes with a renderer of its own, runs the target on seeded changelogs (a preview heading, MSBuild syntax in the text, each fail-closed case) and repacks after an edit. The consumer smoke test checks the feed that ships carries the notes. Closes #136 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 20, 2026
Closed
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.
Closes #136
Problem
PackageReleaseNoteswas not set, so nuget.org's Release Notes tab and Visual Studio's Updates tab showed nothing for any version, while each package'ssrc/<package>/CHANGELOG.mdalready held exactly that text.Change
src/Directory.Build.targets(new; reaches the three shipping projects only): a target beforeGenerateNuspecreads the## [$(PackageVersion)]section of the package's ownCHANGELOG.md, up to the next##, previews included, and setsPackageReleaseNotes. One footer line links the changelog at the version's tag (…/blob/v5.5.0/src/<package>/CHANGELOG.md), so it never points at a latermain.GenerateNuspechasInputs/Outputs, and the changelog was none of its inputs. The target adds it toNuGetPackInput; without that, a changelog edit followed by a repack into the same folder kept the old notes (seen, then guarded).Packaging:line under### Changedin 5.5.0 of the root and all three package changelogs (SQL Server gains the section).PackagingConventionTestsrow and the smoke-test paragraph describe the rule; CONTRIBUTING says a package section must read well as plain text.How nuget.org renders release notes (measured 2026-10-20)
bunit2.12.5, whose nuspec notes hold### Fixed,-bullets, backticks and[@user](url)links, andBogus35.6.5 (## v35.6.5,*bullets, backticks). The page HTML shows all of it literally:### Fixed<br />,`WrapperBase.WrappedElement`,[@psu-prog](<a href="https://github.com/psu-prog" rel="nofollow">…</a>).DisplayPackage.cshtmlrenders the field withHtml.PreFormattedText, which HTML-encodes it, turns\ninto<br />, keeps runs of spaces as , and links barehttp(s)URLs. Its URL pattern has no parentheses, so a link stops before). There is no Markdown step.[text](url)becomestext (url)(the URL is still linked, and…anchor)).ends cleanly), backticks and**are dropped, and### FixedbecomesFixed.-bullets stay, since they read as bullets in plain text. Visual Studio's Updates tab shows the same field; I did not measure it.Sample, the SQL Server package's packed notes:
Tests
PackagingConventionTests.ReleaseNotes.cs, five cases. They spawndotnetand pack for real (--no-build, in the test run's configuration), about 2 s in all:releaseNotesfrom the nuspec inside the.nupkg, and compares it with a line-by-line renderer of the test's own. It does not reuse the target's regexes.11.0.0-preview.20that shares the prefix, and$(Version),@(Compile),%3B,;,%and apostrophes in the text.test/consumer-smoke-test.sh: every package in the feed must carry notes ending in its changelog link. This covers the artifacts thepackjob and the release workflow build.Seeded defects, each run against the suite:
##section, not the version'sCHANGELOG.mdBeforeTargets="GenerateNuspecs"(hook lost)<Error>removed<Error>removedNuGetPackInputline removedCannot set the release notes of EFCore.ComplexIndexes.SqlServer: …/CHANGELOG.md has no '## [5.5.0]' sectionFull non-integration suite: 565 passed (Debug; the packaging, changelog, CLAUDE.md and link classes also in Release with
CI=true).test/consumer-smoke-test.shpassed against a fresh pack.🤖 Generated with Claude Code