Skip to content

Update version to 59.2.0, update changelog generation to git-cliff - #10451

Merged
alamb merged 14 commits into
apache:mainfrom
Jefffrey:better-changelog-generation
Aug 3, 2026
Merged

alamb merged 14 commits into
apache:mainfrom
Jefffrey:better-changelog-generation

Conversation

@Jefffrey

@Jefffrey Jefffrey commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Note (from @alamb): This PR contains both:

  1. Update the version to 59.2.0
  2. Add 59.2.0 CHANGELOG; Rendered preview: https://github.com/Jefffrey/arrow-rs/blob/better-changelog-generation/CHANGELOG.md
  3. Update dev/release/readme.md to use git-cliff rather than changelog_generator
  4. Remove other script

git-cliff was a much nicer experience than the changelog generator (specifically it ran much faster)


Testing out git-cliff for generating our changelogs. In this PR I've included the config file, as well as an example changelog for upcoming 59.2.0 release.

To install git-cliff can either cargo install or do via brew

cargo install git-cliff
brew install git-cliff

Then we need to ensure we have the tags locally:

# If remote for the apache remote is named differently ensure swap to the name here
git fetch origin --tags
  • git-cliff operates via checking the commits since latest tag, so if we don't locally have the tags it'll generate a changelog since the start of time 🙂

Then run command:

git-cliff --tag 59.2.0 --unreleased --output EXAMPLE_CHANGELOG.md
  • Set github token via GITHUB_TOKEN environment variable, or can add to command via --github-token
  • This will create a changelog for all commits since the last non-rc tag on this branch, named 59.2.0 (we change this for each release), into a separate file

Then can see what the generated changelog is like in this PR. git-cliff also supports prepending onto an existing changelog, in which case it removes the header (specified in the config), prepends new body, then re-adds the header:

git-cliff --tag 59.2.0 --unreleased --prepend CHANGELOG.md
  • You could even have both --output and --prepend so long as they don't point to the same file

On categorization

git-cliff looks only at PRs; it ignores issues. I prefer this approach as it makes it more clear which code we actually shipped. There was also an issue with our previous approach in that github-changelog-generator didn't ignore issues closed as not planned/duplicate which can add noise to the changelog. By focusing only on PRs we don't need to worry about this, and we also don't need to bother labeling issues from their PRs anymore.

However, we need to ensure our PRs have good labeling. This can come from maintainers adding labels, or having workflows to do some of this automation. For example we could:

For now I've been going around to some PRs and adding labels to get some better categorization in this example.

Speed

Oh also its blazing fast 😃 (well compared to old approach)

arrow-rs (better-changelog-generation)$ time git-cliff --tag 59.2.0 --unreleased --output EXAMPLE_CHANGELOG.md
WARN  git_cliff_core::changelog > process_commits: 1 commit(s) were skipped due to field error(s) (run with `-vv` for details)

________________________________________________________
Executed in   31.60 secs    fish           external
   usr time    4.35 secs    0.27 millis    4.35 secs
   sys time    3.75 secs    1.49 millis    3.75 secs
  • that warning is only popping because its from the commit of this branch, aka not a PR squash commit

Further work

Need to update release instructions if going with this approach; also want to test out patch releases (aka test when we're not generating for commits off main)

@Jefffrey Jefffrey added the development-process Internal changes; PRs with this label are excluded from changelog label Jul 28, 2026
@Jefffrey

Jefffrey commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor Author

@alamb we could try test this out for upcoming release? 👀

I haven't updated the release instructions, but it would essentially cut out the need for running existing update changelog script and the label issues script too

Edit: if we do wanna use this for 59.2.0 release I can go in and label a few more PRs to get a better changelog

@alamb

alamb commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Yes, I would love to try this out. I personally think the github changelog generator is quite long in the tooth and I would welcome this change.

@alamb

alamb commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Another potential option would be to port the datafusion generate-changelog script: https://github.com/apache/datafusion/blob/main/dev/release/generate-changelog.py

However I think it would be good to try another tool and see how it goes

@Jefffrey

Copy link
Copy Markdown
Contributor Author

Regarding the changelog file, do we prefer keeping this approach of having latest changelog in CHANGELOG.md and historical in CHANGELOG-old.md or would we want them combined? If we combine them then we can use the --prepend feature to completely automate it, otherwise I think we'd still need a manual step to copy existing CHANGELOG.md into CHANGELOG-old.md before generating new CHANGELOG.md.

Though one thing to keep in mind is having a single big CHANGELOG.md might be slow to open for some people

Another potential option would be to port the datafusion generate-changelog script: https://github.com/apache/datafusion/blob/main/dev/release/generate-changelog.py

I think git-cliff can achieve almost the same things as this script, with the exception of the contributor stats at the end (though we don't do that here). It might be possible to get that to work if we want in git-cliff.

@alamb

alamb commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Though one thing to keep in mind is having a single big CHANGELOG.md might be slow to open for some people

Yeah, the total changelog for arrow-rs is now pretty large (there is lots of good stuff in there https://github.com/apache/arrow-rs/blob/main/CHANGELOG-old.md)

@Jefffrey

Copy link
Copy Markdown
Contributor Author

I did a quick test where I imitated a 58.5.0 release, and it seems to generate changelog fine

  • Checked out 58.4.0 to local branch
  • Created some commits
  • Ran command
  • Changelog showed only those new commits I created, didn't get confused with branches

So looks like the use_branch_tags = true option works quite well in ensuring it picks the right tag to consider as latest release you want to compare to (so long as you ensure you're on the same branch as previous release, aka 58_maintenance branch)

@Jefffrey
Jefffrey marked this pull request as ready for review July 31, 2026 04:05
Comment thread dev/release/README.md
Now prepare a PR to update `CHANGELOG.md` and versions on `main` to reflect the planned release.

Do this in the root of this repository. For example [#2323](https://github.com/apache/arrow-rs/pull/2323)
First copy the contents of `CHANGELOG.md` into `CHANGELOG-old.md`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I noticed we never had an explicit step for this? I don't think our existing changelog script did this either

@Jefffrey

Copy link
Copy Markdown
Contributor Author

Another potential option would be to port the datafusion generate-changelog script: https://github.com/apache/datafusion/blob/main/dev/release/generate-changelog.py

Out of curiosity, how long on average does it take to run the DataFusion version? (Though DataFusion does have more commits per release, at least for major ones) @alamb

@alamb

alamb commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

I am starting to test this out for the 59.2.0 release. As long as I am able to replicate the results my plan is to update + merge this PR

@alamb alamb changed the title Better changelog generation via git-cliff Update version to 59.2.0, update changelog generation to git-cliff Jul 31, 2026

@alamb alamb 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.

This now looks great to me -- but since I made some changes to it since @Jefffrey say, it is probably good to get another set of eyes on the change too before we merge it

Comment thread cliff.toml
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{%- for commit in commits %}
- {% if commit.remote.pr_title %}{{ commit.remote.pr_title | trim }}{% else %}{{ commit.message | split(pat="\n") | first | upper_first | trim }}{% endif %}\

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.

I changed this to use remote.pr_title first and then fall back to commit message.

@alamb

alamb commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Ok, we are good - see #9880 (comment)

@alamb
alamb merged commit 782e5a6 into apache:main Aug 3, 2026
10 checks passed
@alamb

alamb commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Thanks again @Jefffrey -- git-cliff is great

@Jefffrey
Jefffrey deleted the better-changelog-generation branch August 3, 2026 14:54
@alamb

alamb commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Out of curiosity, how long on average does it take to run the DataFusion version? (Though DataFusion does have more commits per release, at least for major ones) @alamb

@Jefffrey it takes about the same amount of time as git-cliff (it is WAAAY faster than changelog generator)

alamb pushed a commit that referenced this pull request Aug 7, 2026
since we're using git cliff now, cleaning up this unused file

reference:

- #10451
MassivePizza pushed a commit to massive-com/arrow-rs that referenced this pull request Aug 19, 2026
…0581)

since we're using git cliff now, cleaning up this unused file

reference:

- apache#10451
neilconway pushed a commit to neilconway/arrow-rs that referenced this pull request Oct 8, 2026
# Which issue does this PR close?

<!--
It is not necessary to raise an issue, but it is encouraged if it is a
non-trivial
enhancement/bug.

If this PR relates to an existing issue, but does not fully resolve it,
please change
the wording below from "Closes #NNN" to "Relates to #NNN" or "Part of
#NNN" to avoid
false closing an issue.
-->

- Closes apache#10529

# Rationale for this change

<!--
Why are you proposing this change? If this is already explained clearly
in the
issue then this section is not needed. Explaining clearly why changes
are proposed
helps reviewers understand your changes and offer better suggestions for
fixes.

Please try to explain the problem you are trying to solve in terms of
the user-visible
behavior, rather than the implementation.
-->

From issue:

> Our changelog generation relies on categorizing included PRs by their
labels, see:
> 
> - apache#10451
> 
> That means we should ensure PRs merged to main have labels such as
`bug`, `enhancement`, `performance`, `security`, `development-process`,
etc.
> 
> Whenever we create issues they usually get tagged as either bug or
enhancement based on the template, so if a PR is created and links to
the issue (`Closes apache#123`) then it would be good to be able to copy the
labels from the issue to the PR so maintainers don't need to manually do
this for every PR.
> 
> Looks like this project might accomplish this:
https://github.com/michalvankodev/copy-issue-labels
> 
> Look into introducing this (and ensuring it does what we need).

# What changes are included in this PR?

<!--
There is no need to duplicate the description in the issue here but it
is
sometimes worth providing a summary of the individual changes in this
PR.
-->

Instead of pulling in another action, just achieve it simply with
actions github script. This implementation was drafted by codex and
iterated to get the simplest form, then I did some further editing of
the code.

New workflow that runs only on PR open, and if PR closes an issue (just
linking it doesnt trigger this) then it fetches labels from that issue,
and if is one of the 4 whitelisted labels copies it onto the PR

# Are these changes tested?

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they
covered by existing tests, if so identify these tests)?

If this PR claims a performance improvement, please include evidence
such as
benchmark results.

DO NOT simply paste a list of commands ran to verify the code; this is
what our
CI is for and it pollutes the PR. ONLY explain if testing was included
with this
PR, or why it wasn't.
-->

Tested in my fork:

- Jefffrey#2
- Jefffrey#4
- Jefffrey#6
- Jefffrey#7
- Jefffrey#8
- Jefffrey#9
- Jefffrey#10

# Are there any significant user-facing changes?

<!--
Significant user-facing changes include:
- Breaking public API change
- Significant change to existing functionality (e.g. function returns
something different)

These need to be explicitly called out to ensure we have proper
documentation if
required and to ensure we follow proper semantic versioning.

DO NOT restate the changes of this PR; if a bug was fixed and already
explained
above, we don't need this to be restated as a user-facing change.
-->

Just dev process changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development-process Internal changes; PRs with this label are excluded from changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changelog generation is complicated / takes a long time

2 participants