Repository navigation
docs: changelog fragments in docs/changes, assembled into WHATS_NEW.md at release - #55
Conversation
Reviewer's GuideThis PR replaces direct concurrent edits to WHATS_NEW.md with numbered changelog fragments, documented in docs/changes/README.md and assembled by a stdlib-only script. The script offers a read-only preview or validates and inserts a versioned section at release time, then removes consumed fragments; tests cover ordering, cleanup, refusal cases, and repository validation. Sequence diagram for assembling release notes from changelog fragmentssequenceDiagram
participant Maintainer
participant Script as scripts/changelog.py
participant Fragments as docs/changes
participant Notes as docs/WHATS_NEW.md
Maintainer->>Script: release(version)
Script->>Fragments: fragments()
Fragments-->>Script: numbered entries in PR order
Script->>Notes: read_text()
alt validation fails
Script-->>Maintainer: SystemExit
else valid release
Script->>Notes: write_text(versioned section + existing notes)
Script->>Fragments: unlink(fragment files)
Script-->>Maintainer: section added, fragments removed
end
Flow diagram for changelog preview and release modesflowchart TD
Start[Run scripts/changelog.py]
Mode{Version argument provided?}
Read[Read and validate numbered fragments]
Preview[Print next release section]
Release[Build versioned section]
Check[Check fragments exist and version is absent]
Write[Prepend section to WHATS_NEW.md]
Remove[Remove consumed fragments]
Stop[Stop without writing]
Start --> Mode
Mode -->|No| Read
Read -->|Valid fragments| Preview
Read -->|Invalid or none| Stop
Mode -->|Yes| Read
Read -->|Valid fragments| Release
Release --> Check
Check -->|Validation fails| Stop
Check -->|Valid release| Write
Write --> Remove
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Thank you, Dariusz! We would like to take changelog fragments as the first change after 2.5.0 is published, so the 2.5 release notes are not restructured in the middle of the release. Keeping this open until then. |
… version CONTRIBUTING.md credits the 2.5 pull requests as the release notes' community line lists them (Paweł Kiszczak #52, #62, #64, #66, #68, #71, #73, #75; Marcin Brzeżański #56; Grzegorz Brzezinka #76, #78) and adds Dariusz Koryto (#53, #58, #59, #60 and #55); the README's list names him too. docs/changes/README.md and the changelog.py help use 2.5.1, the next release, as the example.
|
Thank you, Dariusz: changelog fragments are in main (merged as you wrote them, 72b9381), the first change after 2.5.0 as promised on #54. From now on each pull request adds its entry as |
Draft for #54: changelog fragments, so open pull requests stop conflicting on the first lines of
docs/WHATS_NEW.md.Change
docs/changes/README.md: how to write a fragment. A pull request addsdocs/changes/<PR number>.mdwith the list items it would have added to WHATS_NEW.md.scripts/changelog.py(stdlib only):python scripts/changelog.pyprints the next section from the fragments and writes nothing;python scripts/changelog.py 2.4.2puts# What is new in basal 2.4.2with the fragments (in PR order) at the top of WHATS_NEW.md and removes them.tests/test_changelog.py: order, removal, the refusals, and a check that the repository's fragments are valid (so a bad fragment fails the tests).WHATS_NEW.md itself is unchanged. The open PRs would move their entry into a fragment, for example #44's paragraph as
docs/changes/44.md, word for word.Validation
tests/test_changelog.py: 5 passed; the whole suite 766 passed, 53 skipped (macOS).docs/changes/44.md, gives the same text under the new heading.If you'd rather keep editing WHATS_NEW.md directly, close this; nothing else depends on it.
Summary by Sourcery
Introduce validated changelog fragments to avoid pull request conflicts in WHATS_NEW.md and assemble release notes at release time.
New Features:
Enhancements:
Documentation:
Tests: