Skip to content

Synchronize GitHub Releases with the in-repo changelog#811

Merged
Mark-Simulacrum merged 5 commits into
rust-lang:masterfrom
emilyalbini:github-releases
Sep 7, 2020
Merged

Synchronize GitHub Releases with the in-repo changelog#811
Mark-Simulacrum merged 5 commits into
rust-lang:masterfrom
emilyalbini:github-releases

Conversation

@emilyalbini

Copy link
Copy Markdown
Member

This PR adds a new handler to triagebot that synchronizes the GitHub Releases with the changelog present inside a repository itself. It's meant to be used for rustc, but it's designed to be easily extensible. Namely, I want to implement support for keep a changelog to synchronize rustwide's changelog in a future PR.

The handler can be enabled by adding this snippet to a triagebot.toml:

[github-releases]
format = "rustc"
project-name = "Rust"
changelog-path = "RELEASES.md"
changelog-branch = "master"

The handler will run when either a new tag is pushed, or when a new commit on the changelog-branch branch is pushed. It will create releases named "{project-name} {tag}" with the relevant section of the changelog as their body. It will also automatically update old releases if the changelog was updated after the fact.

The only supported format right now is rustc, which maps to rustc's RELEASES.md file. It's possible to add new formats by changing the src/changelogs/ module, so this handle can be used for other Rust projects too.

You can see the result of running this in my fork of rustc.

This PR is best reviewed commit-by-commit.
r? @Mark-Simulacrum

@emilyalbini

Copy link
Copy Markdown
Member Author

A future improvement would be to check the diff and only run this on push if the changelog-path file is changed, instead of every push.

@Mark-Simulacrum Mark-Simulacrum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good overall.

Comment thread Cargo.toml
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@pietroalbini to confirm -- this should be good to merge, right? No outstanding problems?

@emilyalbini

Copy link
Copy Markdown
Member Author

There are no outstanding problems I can see, no.

@Mark-Simulacrum Mark-Simulacrum merged commit 87d3faf into rust-lang:master Sep 7, 2020
@emilyalbini emilyalbini deleted the github-releases branch September 8, 2020 08:25
@emilyalbini

Copy link
Copy Markdown
Member Author

tmandry added a commit to tmandry/rust that referenced this pull request Sep 9, 2020
…k-Simulacrum

Enable GitHub Releases synchronization

This PR enables the triagebot feature to automatically populate [GitHub Releases](https://github.com/rust-lang/rust/releases) for this repository based on the changelog. See rust-lang/triagebot#811 for the implementation of this feature on triagebot's side, and more insights on how it works.

Note: once this lands people subscribed to the ~~firehose~~ rust-lang/rust repository will probably receive a ton of notifications for all the releases being created, but this should be a one-time thing.

r? @Mark-Simulacrum
cc @rust-lang/release
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.

2 participants