-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Another similar project: cargo smart-release
#13
Comments
No action required. |
Hi Byron! Thanks for reaching out. I had a look at cargo-smart-release before writing release-plz, it's a great project!
My ultimate goal is to create a flow that works entirely in CI. |
You are welcome, thanks for your reply and questions. Here we go.
It knows where the crate lives and then finds all commits that change anything within its root path (without rename tracking though). It stops if it reached a commit that is tagged by the previous tag that it created itself. This means the change tracking only works if the releases are marked with tags, and it's crucial to help with segmenting the history to be able to build changelogs. It appears that
There is no desire to bind it to GitHub or its CI and it's only meant to be used locally. Having CI do most of the work is definitely a unique selling point of I can highly recommend to put |
For me, I don't think I can fully trust in commits to determine what is safe to release. This mostly stems from if you have a repo with multiple "things" in it, like a workspace of crates. Observing myself, I've seen times where a commit is marked as Oh, I guess this just bumps the version only. Since that gives the developer an opportunity to review it (as long as the automation doesn't blind them to reviewing it), that works. I'm used to the fully automated release tools like @MarcoIeni a couple of questions
Also, @Byron as an aside, I think you'd find this RFC conversation starting with cart's post interesting as it could be useful for gitoxide as well (save myself the trouble of finding a way to message you ;) ).
atm So when we do this, we take the current crate version and construct a tag name from that and then compare that to
Like with @Byron, I've been avoiding coupling to a service but instead rely on the release process triggering any related workflows, like binary releases or populating the github release.
I raised a question about that when first using cargo-release and still find the topic interesting to explore though as I've streamlined my workflow with cargo-release and dealt more with the workspace problems, I've not focused as much on this as what I'm doing is "good enough" for now. Granted, one area I still need to explore is smoothing out the changelog process. |
Yes, exactly!
Yes, exactly! The idea is to open a PR or do the changes locally without doing any commits. In this way, developers can review the changes, do some manual edits and commit when they are happy.
I used conventional_commit_parser because for the version bump part I took inspiration from the cocogitto codebase.
Exactly!
No, I opened #27. If you have some ideas on how to do it, can you please leave a comment there?
What do you mean? 🤔 Anyway, thanks both for the positive feedback :) |
`cargo-release doesn't force the use of tags or a tag naming convention. It defaults to tagging and has a default tag name template. Both are configurable by users. With tags, we get the benefit of checking history but we can release without it.
So you compare against the highest version of crates.io. That assumes I'm releasing a version right after it. What if I want to patch a prior release. Let's use clap as an example. We are on clap 3.1.x. What if there is a motivating case to to a hot fix for 3.0.x or 2.x? release-plz will download the latest crate and walk the history to the origin of time, not finding a release that matches up. because 3.1.6 doesn't come before 3.0.10. While this doesn't happen often in the cargo ecosystem, ti will more so as we mature.
The downside is this doesn't take into account any changes that happen between running While I don't run into this in my own projects, I have had people ask to harden cargo-release so that it works even when new changes are made while racing for the release. See crate-ci/cargo-release#147 For now, the most we do is warn the user when the remote is ahead of the commit they are releasing. We still need to create the merge-commit, if needed, to fully close the race. |
I see, you are right. You can't do it right now, but maybe release-plz could accept a "registry version" parameter where you specify the version you want to patch. Also, you need to specify the correct git branch if you want to raise a PR (I imagine you are using a
Yes, for now I will focus on the usual workflow of trunk-based development.
Probably this is a problem for the project that does the actual release (e.g. cargo-release) instead of release-plz, which is only responsible for updating the versions (and changelog soon). I don't want to rewrite that part :) |
You still have a race. The window is between running The likelihood of hitting this race depends on the project size and coordination among those with merge-access. For me, I more so found I had forgotten to do a |
I am leaving this here in case you weren't aware. It allows me to release inter-dependent crates in the right order with changelogs automatically. The version is also determined automatically based on conventional commits.
https://github.com/Byron/gitoxide/tree/main/cargo-smart-release
I will close this issue immediately as it's just a way to send a message.
The text was updated successfully, but these errors were encountered: