Skip to content

Fix empty CHANGELOG entries for releases whose notes GitHub generated - #81

Merged
iancooper merged 3 commits into
mainfrom
bugfix/update-changelog-empty-entry
Nov 2, 2026
Merged

iancooper merged 3 commits into
mainfrom
bugfix/update-changelog-empty-entry

Conversation

@iancooper

Copy link
Copy Markdown
Member

Symptom

When 9.0.1 was published, after-release.yml ran eng/update-changelog.ps1 and opened #67 with an entry that held only ## 9.0.1 and no bullets. It was filled by hand afterwards.

Confirmed root cause

The script found the start of the content by position: Select-Object -Skip 1 always dropped line 1, assuming it was the ## What's Changed heading, and the loop then stopped at the first ##. That holds for upstream Polly's published notes. Our generated notes start differently: <!-- Release notes generated using configuration in .github/release.yml at main -->, a blank line, then ## What's Changed. So the comment was dropped, the heading survived, and the loop broke before reading any bullet.

Evidence, from running the script on throwaway copies:

Release notes Bullets before After
Real 9.0.1 notes (CRLF) 0 19
9.0.1 with the comment and blank line removed 19 19
9.0.0 (hand-written prose then bullets, no heading) 9 9

The full diagnosis is in bugfixes/0002-update-changelog-empty-entry/bugfix.md.

Change

  • eng/update-changelog.ps1:
    • Skip ## headings until the first bullet has been copied. The next ## after that still ends the entry.
    • Drop the positional Skip 1, which also silently lost the first bullet when the notes started with one.
    • Split on \r?\n instead of `n, so CRLF notes no longer leave a \r on every copied line.
  • eng/update-changelog.Tests.ps1: new Pester regression tests.
    • Three were red before the fix: comment-first notes, CRLF notes, and notes starting with a bullet.
    • Two are guards that already passed: 9.0.0-style notes and upstream-style notes.
  • .github/workflows/lint.yml: a Test PowerShell scripts step installs Pester at a pinned PESTER_VERSION: '6.2.0', alongside PSSCRIPTANALYZER_VERSION, and runs every *.Tests.ps1 file.
  • .github/wordlist.txt: adds CRLF.

New dependency: Pester 6.2.0, a test-only PowerShell module, approved for this fix.

Out of scope, possible follow-ups:

  • The @login regex would turn @github-actions[bot] into [@github-actions](…)[bot]. It can't fire today, because copying stops before ## New Contributors.
  • A missing <!-- next-release --> marker would put the entry at the top of the file.
  • Failing loudly when no bullets are found.

Verification

  • Pester: 5/5 pass.
  • PSScriptAnalyzer 1.24.0, run on the whole repository with CI's settings: 0 issues.
  • markdownlint and the spellcheck pass on the new bugfix.md.
  • actionlint and zizmor aren't installed locally, so this PR's lint run is the first check of the workflow change.
  • No .NET, src/ or public API change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U6RM4Rd2HejEcaWDY3qovL

…t with GitHub's comment

Root cause: update-changelog.ps1 dropped line 1 of the release notes by position, assuming it was
the "## What's Changed" heading, then stopped at the first "##". GitHub-generated notes for this
repository start with a "<!-- Release notes generated ... -->" comment and a blank line, so the
heading survived and ended the entry before any bullet (empty 9.0.1 entry in #67).

Also splits on \r?\n, so CRLF notes no longer leave a carriage return on each copied line.
Adds Pester regression tests and a pinned Pester 6.2.0 step to the lint workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U6RM4Rd2HejEcaWDY3qovL
@iancooper iancooper self-assigned this Nov 2, 2026
@iancooper iancooper added documentation Improvements or additions to documentation 3- Done labels Nov 2, 2026
@iancooper
iancooper merged commit 1268d1f into main Nov 2, 2026
14 of 15 checks passed
@iancooper
iancooper deleted the bugfix/update-changelog-empty-entry branch November 2, 2026 08:46
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3- Done documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant