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

Automated changelogs [WIP] #46

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Automated changelogs [WIP] #46

wants to merge 1 commit into from

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Apr 16, 2024

This adds a fully automated changelog and version pipeline, fixing #38. I looked into mainly Towncrier and Changie, but both of them weren't super integrated, so I wrote my own solution, which ended up being fairly simple.

The solution here works like this:

  • Every PR has to have a "This change is user-facing" checkbox to the PR description (checked in the default PR template), and either:

    • Uncheck it to indicate it's not a user-facing change

    • Or add a changelog by creating a file in one of changes/unreleased/{major,medium,minor}.

      The file has to be a markdown file with its first line like # (and no other lines starting with #).

  • Every week on Tuesday (presumably after the automated update PR from Monday is merged, but can also be triggered manually at any point), a version PR is opened if the main branch has any unreleased changelogs. This PR includes:

    • Depending on whether there are any major, medium or only minor changelogs, the appropriate version number is bumped in Cargo.toml

    • A new changes/released/$MAJOR.$MEDIUM.$MINOR.md file that compiles all previously unreleased changelogs into a single file. Each changelog entry is a Markdown list entry of the form

      - <title> by @<author> in #<PR>
        <optional rest of lines>

      The author and PR number is automatically determined based on which PR added the changelog file.

  • Once that PR is merged (optionally with manual updates), the release will be published, with the compiled changelog included.

    Currently there's nothing that would ever update the changelog of releases, but I don't expect that to be necessary.

This PR needs more testing and comments before it can be merged.

  • This change is user-facing

This work is sponsored by Antithesis

@infinisil infinisil force-pushed the changelogs branch 4 times, most recently from b7d30d8 to 3387bac Compare April 16, 2024 01:58
.github/workflows/regular-release.yml Outdated Show resolved Hide resolved
scripts/version.sh Show resolved Hide resolved
scripts/version.sh Outdated Show resolved Hide resolved
scripts/version.sh Outdated Show resolved Hide resolved
changes/unreleased/README.md Outdated Show resolved Hide resolved
root=$1
prNumber=$2

nonUserFacingString='this is not a user-facing change'
Copy link
Member

Choose a reason for hiding this comment

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

Think we should have a PR template to make it easier to un-comment this string?

Copy link
Member Author

@infinisil infinisil Apr 17, 2024

Choose a reason for hiding this comment

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

Yeah there's definitely something to improve here, though it's not trivial, because this doesn't take into account whether the string occurs in a comment or not. So we'd have to start using some parser.

Maybe it could be a checkbox that has to be ticked instead, something like:

  • This change is not user-facing and therefore doesn't need a changelog entry

I'm thinking this would work pretty well. Edit: Now using this with a PR template

@willbush
Copy link
Member

I can't help it

https://imgflip.com/i/8mxb05

@infinisil
Copy link
Member Author

I can't help it

https://imgflip.com/i/8mxb05

You're on point 😅 (though I had to lookup NIH!)

Tbh it really surprised me to not find anything like this existing already, it seems like a relatively straightforward idea. If there's anything that does that already I think it would be great to use it instead!

@willbush
Copy link
Member

I can't help it
https://imgflip.com/i/8mxb05

You're on point 😅 (though I had to lookup NIH!)

Tbh it really surprised me to not find anything like this existing already, it seems like a relatively straightforward idea. If there's anything that does that already I think it would be great to use it instead!

I'm just poking fun! I was reminded of it around the xz utils backdoor news when I was reading Running the “Reflections on Trusting Trust” Compiler. Made me wonder how long the idea goes back.

@infinisil infinisil force-pushed the changelogs branch 20 times, most recently from be43c10 to b84a9dc Compare April 18, 2024 02:51
@infinisil infinisil force-pushed the changelogs branch 13 times, most recently from 53a016f to 919848f Compare April 18, 2024 04:23
@infinisil infinisil mentioned this pull request Apr 18, 2024
@infinisil infinisil force-pushed the changelogs branch 3 times, most recently from 0363b55 to 3a64026 Compare April 18, 2024 20:33
@infinisil infinisil mentioned this pull request Apr 18, 2024
@infinisil infinisil force-pushed the changelogs branch 2 times, most recently from 5ac0b44 to 4077e81 Compare April 19, 2024 06:05
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

2 participants