-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Sync and Release automation #13694
Sync and Release automation #13694
Conversation
Seems that there is a CI error, but this has to be the cleanest commit history I've seen in the repo to date. Great work! 🤠 |
d260595
to
6163901
Compare
Something I'm wondering, what happens with versions like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question, and this is looking pretty good!
#[derive(Args)] | ||
struct SyncCommand { | ||
#[command(subcommand)] | ||
subcommand: SyncSubcommand, | ||
} | ||
|
||
#[derive(Subcommand)] | ||
enum SyncSubcommand { | ||
#[command(name = "update_nightly")] | ||
/// Update nightly version in rust-toolchain and `clippy_utils` | ||
UpdateNightly, | ||
} | ||
|
||
#[derive(Args)] | ||
struct ReleaseCommand { | ||
#[command(subcommand)] | ||
subcommand: ReleaseSubcommand, | ||
} | ||
|
||
#[derive(Subcommand)] | ||
enum ReleaseSubcommand { | ||
#[command(name = "bump_version")] | ||
/// Bump the version in the Cargo.toml files | ||
BumpVersion, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for these two to be subcommands in their own structs? Is there a plan to add new commands to them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, see #12759
Nah, we won't bump the version of our crates with patch versions. We're also no longer doing patch releases in Clippy. So this is not a concern. For |
There was some dependence between the different subcommands of clippy_dev. And this dependence will increased with the introduction of the sync and release subcommands. This moves the common functions to a `utils` module, to decouple the other modules.
6163901
to
4326144
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It currently has an error in the second commit (which causes a panic)
pub fn update_nightly() { | ||
// Update rust-toolchain nightly version | ||
let date = Utc::now().format("%Y-%m-%d").to_string(); | ||
replace_region_in_file( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to modify rust-toolchain
, as it doesn't contain the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good catch. That must've been lost during a rebase. Added those in the second commit. Nothing else changed in the force push.
Currently this only provides the feature to auto-update the nightly version in the `rust-toolchain` file and the `clippy_utils/README.md` file. The actual sync to and from the Rust repo will be added with the move to Josh.
Currently this only provides the feature to auto-update the versions in the `Cargo.toml` files. With the move to Josh, a command to get beta and stable release commits will be added.
4326144
to
93d5ccd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! ❤️ 🌈
This updates the documentation after #13694. It is not based on that PR chain and can be merged independently, but should be merged after that PR. This is partly pulled from #12762, but removing the Josh parts. This includes instructions on how to publish `clippy_utils`. Closes #13556 (yes, this is the final PR 🙂) r? @blyxyas changelog: `clippy_utils` is now published to crates.io
Based on #13693
Adds 2 subcommands to
cargo dev
:cargo dev sync update_nightly
: Which updates the nightly versions inrust-toolchain
andclippy_utils/README.md
cargo dev release bump_version
: Bumps the version in all relevantCargo.toml
filesThose are pulled out of #12759, which I'll rebase on this.
Next step is to update the documentation, which I'll partly pull out of #12762
r? @blyxyas (as you reviewed the first PR in the chain and were assigned to the second one)
cc #13556
changelog: none