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

changelog creator #8195

Closed
wants to merge 2 commits into from
Closed

Conversation

Alizter
Copy link
Collaborator

@Alizter Alizter commented Jul 13, 2023

This PR adds an interactive script that adds a changelog entry to doc/changes/. This can be invoked using

make changelog

The script will ask you some (optional) information about your change / PR and then create the entry file. It comes with a small cram test about its basic behaviour. The changelog entry is correctly formatted and laid out etc.

Another rule with alias @compile-changelog will compile the changes in doc/changes and diff them to the CHANGES.md changelog. This is meant to be called during each release. This can be invoked using

make compile-changelog

This will run this rule which will diff. This can be then promoted.

Motivation

Having a single CHANGES.md file is nice and simple, but it causes a lot of unnecessary work when rebasing and resolving conflicts.

  • It's hard to have to resolve conflicts in the changelog when there are many PRs that touch a similar area.
  • Older PRs might need to update where the changelog entry is being added, which can be easily missed.

This PR solves both these issues by making each entry its own file and leaving it to the release master to compile the end changelog.

Sorry, something went wrong.

@ocaml-benchmarks
Copy link

#8195 (b7eb3ed) changes the metrics as follows in comparison to main (a0145b2) when running on fermat (bench/monorepo/bench.Dockerfile):

Benchmark: default

Test: dune monorepo benchmarks

  • build from scratch changed by 0.2%
  • null build changed by -1.8%
  • watch mode: changing file in 'base' library changed by 0.4%
  • watch mode: changing file in 'file_path' library changed by 13.8%
  • watch mode: fixing error in file in 'base' library changed by 0.6%
  • watch mode: fixing error in file in 'file_path' library changed by 16.1%
  • watch mode: introducing error in file in 'base' library changed by -6.6%
  • watch mode: introducing error in file in 'file_path' library changed by -3.7%

@Alizter Alizter force-pushed the ps/branch/changelog_creator branch from b7eb3ed to d16aff5 Compare July 14, 2023 16:21
@tmattio
Copy link
Collaborator

tmattio commented Jul 14, 2023

Is it something that you'd find interesting to have in dune-release @Leonidas-from-XIV? I'm sure other projects would find this useful, in fact, that's something that would be of interest to Frama-C I believe (cc @bobot @AllanBlanchard)

@Leonidas-from-XIV
Copy link
Collaborator

Sure, we could have a feature where dune-release looks at UNRELEASED and prepends it to CHANGES.md (potentially asking for a version) before tagging a release.

@Alizter
Copy link
Collaborator Author

Alizter commented Jul 17, 2023

Please note that there is no UNRELEASED file in this PR, but rather a directory with separate files for the entries. There is an action that prepends all of them. Having separate files allows us to completely avoid merge conflicts which are a bit menial to resolve.

@Leonidas-from-XIV
Copy link
Collaborator

Quick observation: I think it would be useful if the helper script were to save my username (or at least have it as an CLI option), given my GH username is rather long and prone to typos.

@Alizter Alizter force-pushed the ps/branch/changelog_creator branch from d16aff5 to 0a9e8c2 Compare July 18, 2023 12:10
@Alizter
Copy link
Collaborator Author

Alizter commented Jul 18, 2023

@Leonidas-from-XIV I've changed it so that the username is always written to doc/changes/username and read from there if it exists. This has been added to .gitignore. I've also made it so that it errors if a changelog entry clashes with an preexisting one.

All of this behaviour is in the cram test.

@Alizter Alizter marked this pull request as ready for review July 21, 2023 12:13
@Alizter Alizter requested a review from christinerose as a code owner July 21, 2023 12:13
@Alizter Alizter marked this pull request as draft July 21, 2023 12:14
@Alizter Alizter marked this pull request as ready for review July 24, 2023 09:50
@Alizter Alizter requested review from rgrinberg and emillon July 24, 2023 09:50
@Alizter Alizter force-pushed the ps/branch/changelog_creator branch 2 times, most recently from aaf2985 to 9529a14 Compare August 2, 2023 12:58
@Alizter Alizter force-pushed the ps/branch/changelog_creator branch from 9529a14 to c64daaf Compare August 19, 2023 01:30

Verified

This commit was signed with the committer’s verified signature.
Alizter Ali Caglayan
Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter force-pushed the ps/branch/changelog_creator branch from c64daaf to 72cae15 Compare August 19, 2023 01:33

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@rgrinberg
Copy link
Member

I'm closing this until @emillon wants to use this.

@rgrinberg rgrinberg closed this Aug 28, 2023
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.

None yet

5 participants