Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a tool to automate updating changelog files #448

Open
ia0 opened this issue Apr 29, 2024 · 2 comments
Open

Create a tool to automate updating changelog files #448

ia0 opened this issue Apr 29, 2024 · 2 comments
Assignees
Labels
crate:xtask Modifies the maintainers CLI for:maintainability Improves maintainers life good first issue Good for newcomers needs:implementation Needs implementation to complete

Comments

@ia0
Copy link
Member

ia0 commented Apr 29, 2024

See this doc for a description of the problem. The goal of this issue is to write a tool that would update the CHANGELOG.md file of a crate, and if necessary the Cargo.toml too as well as all the dependents Cargo.toml and CHANGELOG.md files if any.

It should probably look something like:

cargo xtask change crates/prelude minor 'Add foo::bar module to support FooBar'
cargo xtask change crates/board major 'Change Foo::bar() to return an error'

It should also provide a CI test to make sure changelog are correctly modified in PRs:

  • Only the pre-release is modified (or the skip changelog counter) and changes are only prepended.
  • If the skip changelog counter is bumped, then there must be a pre-release.
  • The pre-release version is bumped accordingly to the highest sub-section (major, minor, patch).
@ia0 ia0 added good first issue Good for newcomers needs:implementation Needs implementation to complete crate:xtask Modifies the maintainers CLI for:maintainability Improves maintainers life labels Apr 29, 2024
@invernizzi
Copy link
Member

@ia0
Copy link
Member Author

ia0 commented Apr 29, 2024

Would https://github.com/google-github-actions/release-please-action solve this issue?

Not really. I haven't yet seen a tool that supports more than simple repositories. In particular, most tools (like release-please) rely on conventional commits which has deep issues for mono-repos (this repository contains 72 crates of which 14 are published). In particular, conventional commits don't support PRs that touch multiple crates in different ways but still with the same purpose. There is this issue trying to add mono-repo support but it has been stale for 2 years and doesn't even fix the problem. It only suggests to support multiple scopes (which also has a stale issue). But multiple scopes is not enough because changes may be of different nature to different crates. This is particularly true in Rust with proc-macro, where a change to the proc-macro crate may be minor while its usage in another crate may be major (typically api-macro and api in the case of this repository).1

However, it's a good point that a part of this task could be to look for existing tools to get inspiration or even find something working that doesn't need more setup and maintenance than writing something custom (I don't expect the tool we need to be more than 100 lines of code, in particular given most of the code will be shared with other tooling or reuse existing crates like semver or maybe git2, while I expect most of those tools to need more than 100 lines of configuration because they don't scale with the number of crates).

Footnotes

  1. That's actually something that is not automatable. The tool could either try to detect those cases or simply do something wrong which is going to be caught during review.

@exzachlyvv exzachlyvv self-assigned this Aug 9, 2024
ia0 added a commit that referenced this issue Sep 1, 2024
End goal ([bug](#448)): Create
script to automate updating CHANGELOG.md

This task will be done in 2 parts:
1. `xtask changelog ci`: validates all CHANGELOG.md files <-- this PR
2. `xtask changelog {major,minor,patch}`: automatically updates
changelogs with a new description.

---------

Co-authored-by: ia0 <[email protected]>
ia0 added a commit that referenced this issue Oct 22, 2024
Part of #448 and #208.

---------

Co-authored-by: Zachary Vander Velden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate:xtask Modifies the maintainers CLI for:maintainability Improves maintainers life good first issue Good for newcomers needs:implementation Needs implementation to complete
Projects
None yet
Development

No branches or pull requests

3 participants