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

ci(python,rust): Use release-drafter to draft releases with changelogs #5033

Merged
merged 4 commits into from
Oct 1, 2022

Conversation

stinodego
Copy link
Contributor

@stinodego stinodego commented Sep 29, 2022

Resolves #1423
Resolves #4391

Use release-drafter for drafting multiple releases.

See my sandbox repo where I have tested this functionality extensively.

Here's how it works:

  • Everything works based on PR labels.
  • An auto-labeler assigns labels based on the conventional commit tag of the PR title.
    • rust/python labels based on scope (i.e. feat(python)). These determine which release the PR ends up in. A PR can be in both the Rust and Python release, or in neither. If you don't specify a scope, it will not be in the changelog!
    • Labels for each of the conventional commit types build, ci, etc. Note that feat is mapped to the enhancement label.
    • breaking label for breaking changes (e.g. feat(rust)!).
    • For example, if your title starts with perf(python), it will be labeled performance and python.
  • Pull requests are categorized into the following sections based on their tags:
    • Highlights (tagged manually)
    • Breaking changes (breaking)
    • Performance improvements (performance)
    • Enhancements (enhancement)
    • Bug fixes (fix)
    • Other improvements (other tags)
  • The auto-labeler is nice, but you can always manually adjust labels. I see the following use cases for manual tag adjustments:
    • Add a highlight label to designate something as a highlight
    • Remove incorrect labels if the initial conventional commit tag was incorrect.
  • Release/tag versions are automatically incremented based on the previous release of the same type. A breaking tag will trigger a minor version bump (as we are in pre-1.0.0 still).
  • Changelog entries contain the PR name, so this name should be descriptive. The conventional commit tag will be stripped.
  • After doing a release as normal, go to Releases -> Edit release -> Publish release. This creates the release. Make sure it points to the correct tag.

Important notes

  • This introduces a new tag format: py-0.14.14 (instead of py-polars-v0.14.14) and equivalent for Rust. These tags have been added to the latest tags for both Python and Rust.
  • This assumes conventional commits according to the official specs. This requires parentheses instead of brackets for scope definition. We'll have to get used to this new approach.
  • I won't be around the next 2 weeks to address any issues that come up. Still, I think it's worth to merge this so that we can start benefitting from the autolabeler.

@stinodego stinodego added chore Maintenance work that does not impact the user highlight Highlight this PR in the changelog fix Bug fix and removed highlight Highlight this PR in the changelog fix Bug fix labels Sep 29, 2022
@ritchie46
Copy link
Member

I am so excited! This would be a huge gain! <3

@stinodego stinodego changed the title Use release-drafter to draft releases with changelogs chore: Use release-drafter to draft releases with changelogs Sep 30, 2022
@stinodego stinodego changed the title chore: Use release-drafter to draft releases with changelogs ci(python, rust): Use release-drafter to draft releases with changelogs Sep 30, 2022
@stinodego stinodego changed the title ci(python, rust): Use release-drafter to draft releases with changelogs ci(python,rust): Use release-drafter to draft releases with changelogs Sep 30, 2022
@stinodego stinodego force-pushed the changelog branch 3 times, most recently from f44f9cc to cc03d39 Compare September 30, 2022 16:47
@stinodego stinodego marked this pull request as ready for review September 30, 2022 16:48
@stinodego stinodego added python Related to Python Polars rust Related to Rust Polars labels Sep 30, 2022
@stinodego
Copy link
Contributor Author

@ritchie46 This one is ready to be merged! Unfortunately I'm not around for the next 2 weeks, and I'm sure there are some quirks to be worked out. Up to you if you want to wait until I'm back or want to go ahead and press the green button 😄

@github-actions github-actions bot removed python Related to Python Polars rust Related to Rust Polars labels Oct 1, 2022
@ritchie46
Copy link
Member

Have a nice holiday! :shipit:

@ritchie46 ritchie46 merged commit bfea491 into pola-rs:master Oct 1, 2022
@stinodego
Copy link
Contributor Author

Have a nice holiday! :shipit:

Thanks! I'm gonna see if I can make sure this first draft gets created properly.

@stinodego stinodego added python Related to Python Polars rust Related to Rust Polars labels Oct 1, 2022
@stinodego stinodego deleted the changelog branch February 22, 2023 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance work that does not impact the user python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: conventional commits automate changelog creation
2 participants