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

Improve generate-release workflow involving editing and merging notes and guides #1650

Merged

Conversation

TrialDragon
Copy link
Member

@TrialDragon TrialDragon commented Oct 16, 2024

Objective

Fixes #1354
Fixes #1350 I believe
Adds support for Meta category labels to the generate-release tool solving #1646 (comment)

This PR aims to make the release notes and migration guides generators easier to use with merged release notes, and edited release notes. (Also, overall improving the tool in slight ways as I go along, by accident).

Solution

It now tracks whether a PR exists by the release note and migration guide metadata, and allows for multiple PRs per a note or guide, and PR URLs per note or guide. It should only ever create a file if a PR is not included in any notes or guides metadata, so no more overwriting note files or note or guide metadata if it isn't a new PR as far as the generator is concerned. If a release note or migration guide PR is removed from the entries, and has no notes or guides associated with it's number, it will be regenerated and appended to the end of the metadata file whilst preserving the preexisting notes or guides.

This PR also edits the Zola page templates to create the URls from the prs list in the metadata, and migrated the 0.14 release note and migration guides to work with this system.

The Contributing guide and generate-release README.md have been slightly updated.

Testing

Run the tool: cargo run -p generate-release -- --from v0.14.2 --to main --release-version 0.15 release-notes to initially generate, then modify the notes entries in release-content/0.15/release-notes/_release-notes.toml and or in the related PR files, then re-run the tool to see how it doesn't modify your edits, but if you removed a PR completely (isn't in any of the notes associated metadata), then it will regenerate that one note and appends it to the end of the file while preserving the other notes.

cargo run -p generate-release -- --from v0.14.2 --to main --release-version 0.15 migration-guides to do the same for migration guides (same testing methodology, too).

To test the Zola pages, you can follow the instructions in generate-release's README.md for generating a release to create the initial files. Then, run zola serve to A) see the site start up locally, hopefully without errors (be aware that the contributors subcommand may produce WX\shixi as a contributor name, which breaks Zola, and so has to be deleted for Zola to work), and B) check the mock news post to see if everything looks correct, or acceptable.

It now tracks whether a PR exists by the PRs metadata, and allows for mutliple PRs per a note, and PR URLs per note. It should only ever create a file if a PR is not included in any notes metadata, so no more overwriting note files or note metadata if it isn't a new PR as far as the generator is concerned.
@TrialDragon
Copy link
Member Author

TrialDragon commented Oct 16, 2024

There should probably be a documentation pass to double check it's good once it is functional, but before it is ready for review (mostly a note for myself, so I don't forget). Especially for updating the README.md for the tool, and the relevant sections in the Contributing Guide.

@BD103 BD103 self-requested a review October 16, 2024 13:20
@BD103
Copy link
Member

BD103 commented Oct 16, 2024

Ping me once this is ready for review! :)

@alice-i-cecile alice-i-cecile added this to the Release v0.15 milestone Oct 17, 2024
@TrialDragon
Copy link
Member Author

A note for whomever generates the contributors list for 0.15; for some reason there is a contributor listed as WX\shixi which contains an invalid escape sequence which breaks Zola; you will probably have to delete this entry after the file has been generated. I don't know if it's a bug with the contributor part of the generator tool, or if somehow, at some point, we had a contributor with this name.

@TrialDragon TrialDragon marked this pull request as ready for review October 19, 2024 01:43
@TrialDragon
Copy link
Member Author

@BD103 The PR is ready for review.

@@ -4,12 +4,14 @@ This CLI tool is used to generate all the skeleton files required to create a ne

For a bit more background see this issue: <https://github.com/bevyengine/bevy-website/issues/1163>

All commands assume they are ran in the `/generate-release` folder.
The commands can be run from anywhere inside the workspace folder.
Copy link
Member

Choose a reason for hiding this comment

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

😍

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's obvious, but this is true as long as the .env file is at the root. cargo run -p generate-release wasn't working in the project root, then I realised that I had my .env file in the /generate-release folder (from the previous release). 😓

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe it's obvious, but this is true as long as the .env file is at the root. cargo run -p generate-release wasn't working in the project root, then I realised that I had my .env file in the /generate-release folder (from the previous release). 😓

Should be a warning in the README now.

@@ -1,779 +1,779 @@
[[guides]]
title = "Overhaul `Color`"
url = "https://github.com/bevyengine/bevy/pull/12163"
prs = ["12163",]
Copy link
Member

Choose a reason for hiding this comment

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

Much nicer!

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Very nice :) The migration guide label is wrong; I'm going to merge a one line fix for that.

Copy link
Contributor

@doup doup left a comment

Choose a reason for hiding this comment

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

It's really nice to have this as a non-destructive workflow, much better 👌👌👌
I left some nits, maybe the most relevant ones are the README ones

@@ -4,12 +4,14 @@ This CLI tool is used to generate all the skeleton files required to create a ne

For a bit more background see this issue: <https://github.com/bevyengine/bevy-website/issues/1163>

All commands assume they are ran in the `/generate-release` folder.
The commands can be run from anywhere inside the workspace folder.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's obvious, but this is true as long as the .env file is at the root. cargo run -p generate-release wasn't working in the project root, then I realised that I had my .env file in the /generate-release folder (from the previous release). 😓

generate-release/README.md Outdated Show resolved Hide resolved
generate-release/README.md Outdated Show resolved Hide resolved
generate-release/src/migration_guides.rs Outdated Show resolved Hide resolved
generate-release/README.md Outdated Show resolved Hide resolved
generate-release/src/migration_guides.rs Outdated Show resolved Hide resolved
generate-release/src/release_notes.rs Outdated Show resolved Hide resolved
Co-authored-by: Asier Illarramendi <asier@illarra.com>
@BD103
Copy link
Member

BD103 commented Oct 19, 2024

Awesome, I'm so happy this is finally happening! I opened up TrialDragon#7 in case you agree to remove the trailing comma in the TOML.

@TrialDragon TrialDragon added S-Ready-For-Final-Review Ready for a maintainer to consider for merging and removed S-Needs-Review labels Oct 19, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 19, 2024
Merged via the queue into bevyengine:main with commit 43685e7 Oct 19, 2024
10 checks passed
@TrialDragon TrialDragon deleted the trialdragon/1354_merging_multiple_prs branch October 19, 2024 20:06
@teohhanhui
Copy link

teohhanhui commented Oct 20, 2024

@TrialDragon:

A note for whomever generates the contributors list for 0.15; for some reason there is a contributor listed as WX\shixi which contains an invalid escape sequence which breaks Zola; you will probably have to delete this entry after the file has been generated. I don't know if it's a bug with the contributor part of the generator tool, or if somehow, at some point, we had a contributor with this name.

bevyengine/bevy@bca228f

I think it's a perfectly valid contributor "name". The tool should take care to escape the string instead?

@BD103
Copy link
Member

BD103 commented Oct 20, 2024

The name could be replaced by their Github handle, @CrazyboyQCD.

@alice-i-cecile
Copy link
Member

Oh wow, TIL those aren't the same...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants