Repository navigation
build: each package's release notes are its version's changelog section - #77
Open
CaffeinatedCoder wants to merge 1 commit into
Open
CaffeinatedCoder wants to merge 1 commit into
CaffeinatedCoder wants to merge 1 commit into
Conversation
The ReleaseNotesFromChangelog target writes the section under '## $(Version)' of CHANGELOG.md into every nuspec, as the plain text nuget.org shows (measured on package pages: it escapes the notes and links bare URLs, nothing else), with one line linking the whole changelog. Every package carries the whole section: the areas name topics, not packages, and every satellite depends on the base package. A missing or empty section, a relative link, or notes over 35,000 characters fail the pack, naming the file. PackageReleaseNotesTests holds the packed nuspecs to the section, and runs the target on a sample changelog of every Markdown shape and of MSBuild-special text, in LF and CRLF, and on the four it must refuse. Closes #75 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 #75
Problem
PackageReleaseNoteswas a link toCHANGELOG.mdatblob/main. nuget.org's Release Notes tab and Visual Studio's Updates tab showed that link instead of the version's notes, and a reader of an older version landed on today's file.Change
ReleaseNotesFromChangelog(src/Directory.Build.targets, beforeGenerateNuspec) setsPackageReleaseNotesto the section under## $(Version)in the rootCHANGELOG.md, up to the next##. Previews andUnreleasedsections count too, so a CI pack carries the notes of the commit it was built from. One footer line follows:Full changelog: https://github.com/CaffeinatedCoder/CodoMetis.TypeKit/blob/main/CHANGELOG.md. The link inDirectory.Build.propsis gone.CHANGELOG.md, when the section is missing, empty, has a relative link (nuget.org can't resolve one), or makes notes longer than nuget.org's 35,000 characters.CONTRIBUTING.md(Releasing, steps 1 and 4) says so. The empty-section rule has one consequence: the commit that opens the next version (step 4) must write the section's first line, or every pack fails, the conventions fixture's included.2.3.0changelog line.How nuget.org renders release notes (measured 2026-10-20, from the package pages' HTML)
The notes are plain text. nuget.org HTML-escapes them, turns each line break into
<br />, and links bare URLs. It does nothing else:## v35.6.5,* PR 622: …,`Internet.Avatar()`## v35.6.5<br />* PR 622: …, backticks shown as they are[Issue #1221](https://github.com/…/issues/1221)[Issue #1221](<a href="https://…/1221">https://…/1221</a>), brackets and parentheses shownthanks ocoanet (https://github.com/…/pull/431)(<a href="…/431">…/431</a>), the closing parenthesis left out of the link…/Changelog.md#4.5.1.So the target writes
[text](url)astext (url), drops backticks and**, and writes a### Fixedsubheading asFixed.-list markers stay, since they read fine as plain text. Nuke.Common makes the same choice: its notes are plain•bullets.Filtering: none, each package carries the whole section
The areas don't map onto the seven packages:
OpenAPI:18 times,EF Core:4,Generators:1). 2.1.0 and earlier lead with bold feature names or nothing.OpenAPIis AspNetCore.JSONcovers converters in core and generated code in Generators. Analyzer rules ship in Analyzers, but CMTK1xxx come from Generators.Fault<T1, T2>touched core, AspNetCore and Testing.CodoMetis.TypeKit, and that package brings the analyzers. A core or analyzer change therefore reaches every satellite's consumer, so filtering by area would hide it from the very readers it affects.Since every package carries the whole section, no package ever has an empty one, and there is no "no changes for this package" line.
Tests
PackageReleaseNotesTests(conventions,Packsfixture, next toPackageReadmeTests):releaseNotesequals the version's section in plain text plus the footer. The test derives the expected text again, line by line, rather than with the target's regexes.releaseNotescontains no Markdown (`,**,](,#at the start of a line).dotnet msbuild -t:ReleaseNotesFromChangelog -getProperty:PackageReleaseNotes, on a sample changelog given throughReleaseNotesChangelog) writes every shape as plain text: a subheading, code, bold, a link holding code, and text that MSBuild would expand or unescape (50%3B; $(Foo) @(Bar) %(Baz) ' " < & — ü). It is checked with LF and with CRLF, and the section is picked out from between a later and an earlier version.CHANGELOG.md.The sample tests are there because a seed showed they were needed. Today's 2.3.0 section has no Markdown, so a target that kept backticks passed the nuspec tests.
Seeds (each applied alone, then restored):
PackageValidationBaselineVersion's section (wrong section)Condition="false")<releaseNotes>"## 2.3.0renamed (missing section)###keptErrordisabled (missing, empty, relative link, length)Full conventions suite locally (macOS): 1521 passed.
Finding filed: #76. The changelog's own links point at
blob/main, so they have the same problem one level down.🤖 Generated with Claude Code