Skip to content

Packages: show the version's changelog section as NuGet release notes - #139

Merged
CaffeinatedCoder merged 2 commits into
mainfrom
chore/136-release-notes
Oct 20, 2026
Merged

CaffeinatedCoder merged 2 commits into
mainfrom
chore/136-release-notes

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #136

Problem

PackageReleaseNotes was not set, so nuget.org's Release Notes tab and Visual Studio's Updates tab showed nothing for any version, while each package's src/<package>/CHANGELOG.md already held exactly that text.

Change

  • src/Directory.Build.targets (new; reaches the three shipping projects only): a target before GenerateNuspec reads the ## [$(PackageVersion)] section of the package's own CHANGELOG.md, up to the next ##, previews included, and sets PackageReleaseNotes. 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 later main.
  • Fail closed: the pack fails, naming the file, on a missing changelog, a missing or empty section, or notes over nuget.org's 35,000 characters.
  • Incremental pack: GenerateNuspec has Inputs/Outputs, and the changelog was none of its inputs. The target adds it to NuGetPackInput; without that, a changelog edit followed by a repack into the same folder kept the old notes (seen, then guarded).
  • Changelogs: a Packaging: line under ### Changed in 5.5.0 of the root and all three package changelogs (SQL Server gains the section).
  • CLAUDE.md / CONTRIBUTING.md: the packaging paragraph, the PackagingConventionTests row 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)

  • Package pages: bunit 2.12.5, whose nuspec notes hold ### Fixed, - bullets, backticks and [@user](url) links, and Bogus 35.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>).
  • Source: NuGetGallery's DisplayPackage.cshtml renders the field with Html.PreFormattedText, which HTML-encodes it, turns \n into <br />, keeps runs of spaces as &nbsp;, and links bare http(s) URLs. Its URL pattern has no parentheses, so a link stops before ). There is no Markdown step.
  • So the notes are written as plain text: [text](url) becomes text (url) (the URL is still linked, and …anchor)). ends cleanly), backticks and ** are dropped, and ### Fixed becomes Fixed. - 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:

The last 5.x minor with a change of its own: the line refuses EF Core 11, whose successor is CodoMetis.EFCore.SchemaKit.SqlServer.

Changed answers

- Indexes: a unique complex index over nullable columns gets EF Core's IS NOT NULL filter, … (#88 (https://github.com/…/issues/88), Upgrading (https://github.com/…/upgrading.md#unique-indexes-over-nullable-columns-on-sql-server)).
…
Full changelog: https://github.com/CaffeinatedCoder/EFCore.ComplexIndexes/blob/v5.5.0/src/EFCore.ComplexIndexes.SqlServer/CHANGELOG.md

Tests

PackagingConventionTests.ReleaseNotes.cs, five cases. They spawn dotnet and pack for real (--no-build, in the test run's configuration), about 2 s in all:

  • Packed notes = section: packs each project, reads releaseNotes from 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.
  • Awkward content: runs the target on a seeded changelog with CRLF line endings, a preview heading, a neighbouring 11.0.0-preview.20 that shares the prefix, and $(Version), @(Compile), %3B, ;, % and apostrophes in the text.
  • Fail closed (4 rows): no file, no section, an empty section, over 35,000 characters. Each must fail and name the changelog.
  • Repack: packs twice into one folder with a changelog edit between, and expects the second pack to carry the edit.

test/consumer-smoke-test.sh: every package in the feed must carry notes ending in its changelog link. This covers the artifacts the pack job and the release workflow build.

Seeded defects, each run against the suite:

Seed Caught by
Target takes the first ## section, not the version's awkward-content test and the "no section" row. The real-changelog test passes, since 5.5.0 is first today, which is why the seeded test exists
Target reads the root CHANGELOG.md packed-notes test
BeforeTargets="GenerateNuspecs" (hook lost) packed-notes test. The smoke-test check also fails all three packages of a feed packed that way
Section runs to end of file packed-notes, awkward-content, fail-closed
Empty/missing-section <Error> removed fail-closed
35,000 <Error> removed fail-closed
Link rewrite removed packed-notes, awkward-content
NuGetPackInput line removed repack test
5.5.0 section deleted from the SQL Server changelog the pack fails with Cannot set the release notes of EFCore.ComplexIndexes.SqlServer: …/CHANGELOG.md has no '## [5.5.0]' section

Full non-integration suite: 565 passed (Debug; the packaging, changelog, CLAUDE.md and link classes also in Release with CI=true). test/consumer-smoke-test.sh passed against a fresh pack.

🤖 Generated with Claude Code

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]>
@CaffeinatedCoder CaffeinatedCoder added this to the 5.5.0 milestone Oct 20, 2026
@CaffeinatedCoder CaffeinatedCoder added chore Build, CI, packaging, refactoring with no behaviour change package/core Affects EFCore.ComplexIndexes package/postgresql Affects EFCore.ComplexIndexes.PostgreSQL package/sqlserver Affects EFCore.ComplexIndexes.SqlServer area/release Versioning, changelogs, release wiring labels Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/release Versioning, changelogs, release wiring chore Build, CI, packaging, refactoring with no behaviour change package/core Affects EFCore.ComplexIndexes package/postgresql Affects EFCore.ComplexIndexes.PostgreSQL package/sqlserver Affects EFCore.ComplexIndexes.SqlServer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Packages: show the version's changelog section as NuGet release notes

1 participant