Skip to content

REVIEW FIRST! Collect changelog entries from per-PR fragments - #985

Merged
mcepl merged 3 commits into
masterfrom
changelog-news-fragments
Dec 1, 2026
Merged

mcepl merged 3 commits into
masterfrom
changelog-news-fragments

Conversation

@mcepl

@mcepl mcepl commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Nearly every pull request conflicted on the top of CHANGELOG.md, because all of them appended to the same "Upcoming release" section. Following a much simplified version of CPython's blurb/NEWS.d workflow, each PR now adds a small Markdown file changelog.d/<issue>.md with its entry, so parallel PRs never touch the same file.

Contributors simply create changelog.d/<N>.md in any editor, or use the helper python bin/news.py <N> (standard library only, so it works on Windows as well as on Linux, the BSDs and macOS), which opens $VISUAL/$EDITOR/git's core.editor with a template encouraging longer, explanatory entries. python bin/news.py preview shows the pending release section, and python bin/news.py collect folds the fragments, sorted by number, into a new "# Release " section of CHANGELOG.md. For the release manager, a new portable top-level Makefile wraps it as make news N=123, make changelog-preview, make changelog and make release, the last of which also builds the documentation via docs/Makefile; that gains an explicit html rule, as its Sphinx-generated catch-all pattern rule is GNU make only. Neither make nor sh is needed to contribute.

The existing upcoming entry has been moved to a fragment, and the PR template, contributing and release-process docs updated.

Description

Please include a summary of the change and which issue is fixed.

Fixes #(issue)

Checklist (delete if not relevant):

  • I have added a changelog fragment
  • I have made corresponding changes to user documentation for new features
  • I have made corresponding changes to library documentation for API changes

@mcepl
mcepl requested a review from lieryan November 30, 2026 08:11
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.46%. Comparing base (7821940) to head (143e1f8).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #985   +/-   ##
=======================================
  Coverage   95.46%   95.46%           
=======================================
  Files         134      134           
  Lines       26946    26946           
=======================================
  Hits        25723    25723           
  Misses       1223     1223           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mcepl
mcepl force-pushed the changelog-news-fragments branch from a8fefe0 to 5cda563 Compare November 30, 2026 08:14
@mcepl mcepl changed the title Collect changelog entries from per-PR fragments REVIEW FIRST! Collect changelog entries from per-PR fragments Nov 30, 2026
@mcepl
mcepl requested a balanced review from Copilot November 30, 2026 08:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved issues drop a release-note entry, merge or overwrite changelog fragments, and execute Markdown backticks as shell commands instead of preserving literal text.

2 open issues
What changed in this PR

This PR replaces shared “Upcoming release” edits with per-PR changelog fragments, reducing merge conflicts while keeping CHANGELOG.md as the release history.

Changes:

  • Adds bin/news to create, preview, and collect fragments in numeric order.
  • Adds maintenance Make targets and an explicit documentation HTML target for BSD make compatibility.
  • Updates contributor instructions, the release process, and the PR checklist.
File Description
Makefile Adds changelog, documentation, and release targets.
docs/​release-process.rst Documents fragment collection during releases.
docs/​Makefile Adds an explicit html target for BSD make.
docs/​contributing.rst Directs contributors to create changelog fragments.
CHANGELOG.md Removes the existing upcoming-release section.
changelog.d/​README.md Explains fragment naming, formatting, and commands.
changelog.d/​985.md Adds a fragment announcing the new workflow.
bin/​news Implements fragment creation, preview, and collection.
.github/​PULL_REQUEST_TEMPLATE.md Replaces the changelog-edit checkbox with a fragment checkbox.

Review effort: Balanced

Comment thread CHANGELOG.md Resolved
Comment thread Makefile Resolved
@mcepl
mcepl added this pull request to stack #986 November 30, 2026 08:27
Nearly every pull request conflicted on the top of CHANGELOG.md,
because all of them appended to the same "Upcoming release"
section. Following a much simplified version of CPython's
blurb/NEWS.d workflow, each PR now adds a small Markdown file
changelog.d/<issue>.md with its entry, so parallel PRs never
touch the same file.

The new bin/news script (plain POSIX sh, so it works on Linux,
the BSDs and macOS) creates a fragment in $VISUAL/$EDITOR from a
template encouraging longer, explanatory entries (`bin/news 123`),
previews the pending release section (`bin/news preview`), and
folds the fragments, sorted by number, into a new "# Release
<version>" section of CHANGELOG.md (`bin/news collect`). A new
portable top-level Makefile wraps it as `make news N=123`,
`make changelog-preview`, `make changelog` and `make release`,
the last of which also builds the documentation via
docs/Makefile; that gains an explicit `html` rule, as its
Sphinx-generated catch-all pattern rule is GNU make only. The
news target passes N and TEXT to bin/news through the
environment ("$$N", "$$TEXT"), so Markdown backticks and quotes
in an entry reach the script literally instead of being
re-parsed by the shell.

The pending entry for the #223 regression tests, previously in
the "Upcoming release" section, has been moved to
changelog.d/223.md, and the PR template, contributing and
release-process docs updated.
@mcepl
mcepl force-pushed the changelog-news-fragments branch from d88420d to 18e7d47 Compare November 30, 2026 08:49
@mcepl
mcepl removed this pull request from stack #986 November 30, 2026 08:58
@mcepl

mcepl commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Note for contributors of open PRs: once this is merged, PRs which
still edit CHANGELOG.md directly will keep conflicting with
master. At the moment, these open PRs conflict only in
CHANGELOG.md:

#980, #979, #977, #970, #969, #967, #966, #964, #963, #962, #961, #959, #958, #930, #911, #910, #909, #904, #903, #902, #901, #900, #899, #897, #894, #893, #892, #890, #888, #887, #880, #878, #877, #876, #874, #866, #848

If you are the author of one of them (or of any other PR touching
CHANGELOG.md), please rebase your branch onto the current
master after this PR lands, drop your changes to
CHANGELOG.md, and put your entry into changelog.d/<N>.md
instead (<N> being the number of your PR or issue). For
example:

git remote add upstream https://github.com/python-rope/rope.git  # if not there yet
git fetch upstream
git rebase upstream/master
# whenever the rebase stops on a CHANGELOG.md conflict:
git checkout upstream/master -- CHANGELOG.md
git rebase --continue
# then add the entry and push:
python bin/changelog.py <N>   # or copy changelog.d/TEMPLATE.md to changelog.d/<N>.md
git add changelog.d/<N>.md
git commit -m "Add changelog entry"
git push --force-with-lease

The entry is one or more Markdown list items, with continuation
lines indented by two spaces:

- #<N> Short description of what changed and why, wrapped
  over several lines if needed. (@yourname)

See changelog.d/README.md for details. After this, your PR
should not run into changelog conflicts again. Thanks!

@lieryan

lieryan commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Thanks @mcepl.

I have been considering dropping the CHANGELOG.md updating requirement entirely and just having Github Release generate the changelog from PR titles and using that to populate CHANGELOG.md because of these merge conflict issues, but this actually seems like a better solution.

The original changelog workflow was setup back when we probably received just at most dozen or so PRs per year. It worked fine back then, but it hasn't really scaled to the current work pace

Probably the only thing I'd have done differently here is that I'd have written bin/news as a Python script, rather than sh script.

Requiring sh for basic contributions workflow like making changelog would increase the barrier of contributing for those coming from Windows.

Currently for first time contributors they'd need to setup their environment to have make installed only when they needed to render ./docs, because that's the workflow that was setup by Sphinx. But Sphinx also sets up make.bat workflow for Windows users, which helps ease that up. I would rather not extend the requirements to basically be on POSIX environment to make basic contributions.

For release manager, which currently is going to just be us at this point, requiring sh/make to collect changelogs and perform release management tasks is less of an issue, but the primary documented way for contributor to make changelog entries should not require make and sh.

As @lieryan pointed out in the review, requiring a POSIX shell
(and make) just to write a changelog entry would raise the
barrier for contributors on Windows, who so far only needed make
for building the documentation, and even there Sphinx provides
make.bat.

Replace the sh script with bin/news.py, which uses only the
standard library and keeps the same commands (add, preview,
collect). It looks for an editor in $VISUAL, $EDITOR and git's
core.editor, falling back to Notepad on Windows and vi elsewhere,
writes LF line endings everywhere, and numbers duplicate
fragments 1234-2.md, 1234-3.md, … instead of using a timestamp.

The contributor documentation now leads with simply creating
changelog.d/<N>.md in any editor, offers `python bin/news.py <N>`
as a helper, and mentions the make targets only as a shortcut;
these remain for the release manager and call the script via
$(PYTHON). The #985 fragment is expanded accordingly.
@mcepl

mcepl commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

@lieryan Thanks, good point. I hadn't thought about Windows contributors at all. Fixed in d5a8021:

  • bin/news is now bin/news.py, using only the standard library. It keeps the same commands (python bin/news.py <N> [text], preview, collect). For the editor it tries $VISUAL, $EDITOR and git's core.editor, then falls back to Notepad on Windows and vi elsewhere. It always writes LF line endings.
  • changelog.d/README.md, docs/contributing.rst now start with simply creating changelog.d/<N>.md in any editor. python bin/news.py <N> comes next as an optional helper, and the make targets are mentioned only as a shortcut. Contributors no longer need make or sh.
  • The make targets stay for the release manager. They now call $(PYTHON) bin/news.py, with PYTHON ?= python3.

I've also changed the instructions in my comment above for authors of open PRs.

@lieryan lieryan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good overall. Just a couple comments and a bunch of nit picks.

The most important change I'm requesting here is just how this changelog process is to be documented, we should separate the docs intended for contributors and the maintainers. The general theme here is to avoid infodumping new contributors with information they don't need about our internal processes if all they want to do is just to make a simple contribution.

Since contributing.rst and changelog.d/README are essential reading for every contributors, they need to stay as a short read and cover only what contributors need to know so they don't get overwhelmed and TL;DR them.

Comment thread bin/news.py Resolved
Comment thread bin/news.py Resolved
Comment thread bin/news.py Resolved
Comment thread changelog.d/README.md Resolved
Comment thread changelog.d/README.md Resolved
Comment thread docs/release-process.rst Resolved
Comment thread CHANGELOG.md Resolved
Comment thread changelog.d/README.md Resolved
Comment thread changelog.d/README.md Resolved
Comment thread bin/changelog.py Resolved
Ketankhunti added a commit to Ketankhunti/rope that referenced this pull request Nov 30, 2026
mcepl asked for this on python-rope#965 (2026-11-30): python-rope#985 replaces direct
CHANGELOG.md edits with per-PR fragments in changelog.d/, and the
PR base is now changelog-news-fragments. The CHANGELOG.md edit was
also the merge conflict against the new base.
Ketankhunti added a commit to Ketankhunti/rope that referenced this pull request Nov 30, 2026
mcepl asked for this on python-rope#965 (2026-11-30): python-rope#985 replaces direct
CHANGELOG.md edits with per-PR fragments in changelog.d/, and the
PR base is now changelog-news-fragments. The CHANGELOG.md edit was
also the merge conflict against the new base.
Address the review of the changelog workflow. The script is now
bin/changelog.py and everything uses "changelog" rather than a
mix of "news" and "fragment". It uses argparse for a standard,
short help, writes files with Path.write_text(), and reads its
template from changelog.d/TEMPLATE.md, which contributors can
also copy by hand and which is the only copy of the style guide.
Collecting strips the template's HTML comment and inserts the
new release above the first "# Release" heading, so that the new
warning header at the top of CHANGELOG.md stays in place.

The contributor documentation (docs/contributing.rst and
changelog.d/README.md) is cut down to what a contributor needs:
the script first, the manual alternative second, and the warning
against editing CHANGELOG.md last. The design rationale moved to
a comment in the script and implementation details (editor
detection, Windows) are no longer described. The release
checklist now collects the changelog as step 1, so that it can be
checked against the milestone.

The Makefile stays as a thin convenience wrapper. "make changelog"
is now an alias for the CHANGELOG.md file target, which depends
on the pending entries; as collecting removes them, any entry
left forces a rebuild regardless of timestamps.
@mcepl
mcepl requested a review from lieryan December 1, 2026 09:44

@lieryan lieryan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 🚀 whenever you're ready.

@mcepl
mcepl merged commit 40f4a84 into master Dec 1, 2026
41 of 42 checks passed
mcepl added a commit that referenced this pull request Dec 1, 2026
As @lieryan pointed out in the review, requiring a POSIX shell
(and make) just to write a changelog entry would raise the
barrier for contributors on Windows, who so far only needed make
for building the documentation, and even there Sphinx provides
make.bat.

Replace the sh script with bin/news.py, which uses only the
standard library and keeps the same commands (add, preview,
collect). It looks for an editor in $VISUAL, $EDITOR and git's
core.editor, falling back to Notepad on Windows and vi elsewhere,
writes LF line endings everywhere, and numbers duplicate
fragments 1234-2.md, 1234-3.md, … instead of using a timestamp.

The contributor documentation now leads with simply creating
changelog.d/<N>.md in any editor, offers `python bin/news.py <N>`
as a helper, and mentions the make targets only as a shortcut;
these remain for the release manager and call the script via
$(PYTHON). The #985 fragment is expanded accordingly.
@mcepl
mcepl deleted the changelog-news-fragments branch December 1, 2026 22:17
@mcepl
mcepl restored the changelog-news-fragments branch December 2, 2026 00:07
mcepl pushed a commit to Ketankhunti/rope that referenced this pull request Dec 2, 2026
mcepl asked for this on python-rope#965 (2026-11-30): python-rope#985 replaces direct
CHANGELOG.md edits with per-PR fragments in changelog.d/, and the
PR base is now changelog-news-fragments. The CHANGELOG.md edit was
also the merge conflict against the new base.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants