Skip to content

Copy the entries that are already in CHANGELOG.md when generating the changelog of a release - #134278

Merged
alexey-milovidov merged 2 commits into
masterfrom
changelog-reuse-entries
Nov 25, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
changelog-reuse-entries

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Closes: #134276

The Create Release job of v26.11.1.2942-stable failed: https://github.com/ClickHouse/ClickHouse/actions/runs/45450531725/job/138675365339

ci/tools/changelog.py requests from GitHub every pull request merged in the date range of a release, and then the author of every entry it writes. For this release these were 5341 and 2601 requests against the limit of 5000 per hour of the token. The script slept for 56 minutes until the limit was reset, and the job ran out of its two hours before the Docker images were built.

Most of these pull requests already have an edited entry in CHANGELOG.md on master (the nightly Prepare changelog job maintains it). With the new option --reuse-entries-from, a pull request that has an entry in the given file is not requested from GitHub, neither the pull request nor its author: the entry is copied as it is, under its category. The release job passes CHANGELOG.md of origin/master. Without the option the script works as before, so the nightly changelog job is not affected.

  • An entry of a pull request is a bullet that attributes it, [#N](.../pull/N) ([Author](...)), the same definition as in ci/jobs/changelog_nightly.py. A link without the author is a mention in the text of another entry.
  • The search finds the pull requests by the date of the merge, which covers more than the release, so an entry is copied only if git has the merge commit of the pull request (Merge pull request #N from ...) on the first-parent history of the changelog interval.
  • For a backport, the entry of the original pull request is copied with the Backported in prefix.
  • An entry is copied only if it says what is in the release. A bullet merged from several entries is copied, once, only if all its pull requests are merged in the interval, and never for a backport of one of them. A pull request that has an entry in two releases is not copied.
  • All other pull requests are requested from GitHub as before.

The changelog of a release under docs/changelogs now has the edited text and category of CHANGELOG.md for these pull requests instead of the text from the pull request description.

Checked on v26.11.1.2942-stable (replayed with the pull requests from the log of the failed job): 1789 of the 5313 pull requests are copied, and all of them are in the changelog that job generated. About 4400 requests remain instead of about 8000. Checked against GitHub on v26.10.12.13-stable: without the option the output is identical to the committed changelog, with it 5 of the 12 backports are copied and the requests go from 52 to 37.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The changelog of a release copies the entries that are already in CHANGELOG.md instead of requesting those pull requests from GitHub.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/134278]

Version info

  • Merged into: 26.12.1.444-master (included in 26.12 and later)

`changelog.py` requests from GitHub every pull request merged in the date
range of a release, and then the author of every entry it writes. For
`v26.11.1.2942-stable` these were 5341 and 2601 requests against the limit of
5000 per hour of the token: the script slept for 56 minutes until the limit
was reset, and the `Create Release` job ran out of its two hours before the
Docker images were built:
https://github.com/ClickHouse/ClickHouse/actions/runs/45450531725/job/138675365339

Most of these pull requests already have an edited entry in `CHANGELOG.md` on
master. With the new option `--reuse-entries-from`, a pull request that has an
entry in the given file is not requested from GitHub, neither the pull request
nor its author: the entry is copied as it is, under its category. The release
job passes `CHANGELOG.md` of `origin/master`. Without the option the script
works as before, which is what the nightly changelog job needs: it generates
the raw entries of the pull requests that are not in `CHANGELOG.md` yet.

An entry of a pull request is a bullet that attributes it,
`[#N](.../pull/N) ([Author](...))`, the same definition as in
`ci/jobs/changelog_nightly.py`. A link without the author is a mention in the
text of another entry. A bullet that attributes several pull requests is
written once.

The search finds the pull requests by the date of the merge, which covers more
than the release, so an entry is copied only if git has the merge commit of the
pull request (`Merge pull request #N from ...`) on the first-parent history of
the changelog interval. For a backport, whose branch is in the same subject,
the entry of the original pull request is copied with the `Backported in`
prefix. All other pull requests are requested as before.

On `v26.11.1.2942-stable`, 1796 of the 5313 pull requests are copied, and all
of them are in the changelog the failed job generated. About 4400 requests
remain instead of about 8000.

Closes: #134276

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [182f7fd]

Summary: ✅


AI Review

Summary

Reviewed PR #134278 at 182f7fd73109d0890aa6b035af604c76abaa7de1. The release job now reuses edited entries from CHANGELOG.md to reduce GitHub API requests. Both previous findings are addressed: grouped bullets require every attributed change to be present, and entries repeated across releases are excluded from reuse. Focused regression cases cover both fixes. No remaining actionable findings.

The new ExistingEntry representation is consumed by sorting in get_descriptions through number and by the sole writer, write_changelog, through formatted_entry. The nightly caller continues without the reuse option.

Final Verdict

Status: ✅ Approve

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This looks good.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Nov 24, 2026
@alexey-milovidov alexey-milovidov self-assigned this Nov 24, 2026
Comment thread ci/tools/changelog.py Resolved
Comment thread ci/tools/changelog.py Resolved
Two cases where a copied bullet was wrong, from the review of
#134278:

- A bullet merged from several entries was copied for any of its pull
  requests. The bullet of #121325 (`cctz` 2026d) and #124249 (2026e) would be
  copied for the backport of the former into `v26.9.3.38-stable` and announce
  the latter, which is not in that release.
- A pull request with an entry in two releases got both of them: #124907 is
  under `Performance Improvement` in 26.11 and under `New Feature` in 26.10,
  with different wording.

The bullets and the pull requests they attribute now make groups, connected by
the attributions. The bullets of a group are copied only if they are all in one
release and every pull request of the group is merged in the changelog
interval; for a backport, the group has to be the original pull request alone.
All other pull requests are requested from GitHub as before.

On `v26.11.1.2942-stable` this leaves 1789 of the 5313 pull requests copied
instead of 1796.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Nov 24, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 25, 2026
Merged via the queue into master with commit c93b930 Nov 25, 2026
196 checks passed
@alexey-milovidov
alexey-milovidov deleted the changelog-reuse-entries branch November 25, 2026 00:33
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

changelog.py: copy the entries that are already in CHANGELOG.md instead of requesting every pull request from GitHub

2 participants