-
Notifications
You must be signed in to change notification settings - Fork 114
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
Setting level per crate in a workspace #461
Comments
It sounds like you are wanting to run Say |
Correct, more precisely in gitlab's CI, but yeah, some kind of CI/CD.
Actually I'd like to stick with cargo release per workspace just as it is now, but I'd like to have a bit more fine-grained control over bump level so that if only one crate needs major bump then I don't have to bump major version for all other crates. |
And as for how to achieve that -- I was thinking whether I could have a |
If its in the |
That's how I imagined it. A developer who, for example, breaks the public API, in the same commit changes the
I see, I'm not saying it's by the book -- I just couldn't figure out a better way to do that. I imagine a release PR where two crates are updated at the same time (see OP above) where one must be bumped with major and the other one with minor, though I don't know how to configure Even if I configure the CI to run
I know that it might sounds like configuring the CD flow (ie. level) dynamically in the codebase itself is off, though that's how gitops approaches this kind of workflow and IMHO it's not that bad. After all the PR maintainer (approver) double checks that the version bump in the codebase, specified by the developer, is about right. |
Who is responsible for lowering it?
While I'm not fully versed in gitops, I assume gitops tends to focus on moving towards a fixed state and that actions are idempotent. Tracking the release level in a file does not qualify as idempotent. Its a big smell when you have to rely on review and checklists for process safety. These should be baked into the process or are sytemic failures. Without re-evaluating from the ground up how I would build what you are wanting but starting from where you are, what I think I would explore is tracking what the next version should be in absolute terms and not by level, maintaining a list of the release order and having a script that steps through it, doing the release for each crate only if the intended version isn't already released. I'd maybe have a tool where dev can say With all of that said, this seems like a fairly specialized use case that has problems that doesn't seem like supporting per-crate levels and a skip level justify the upfront implementation and associated complexity. |
#530 added a For doing things in actions, I recommend checking out #117, #119, and #528. I'm closing this as a mix of resolved and closing in favor of those issues. |
Lets have a single repo workspace with 3 crates as directories in that repository
the-lib
andthe-db
are0.1.0
whilethe-cli
is0.2.0
. Now, I'm starting to use cargo release, so I manually runcargo release <LEVEL=release>
and I'm left with 3 new tags. All good so far. Now it's time to make it automated as soon as a new release PR to themain
is merged.Due to the fact that (usually) the CI is per repository and not per directory (ie. crate), I need to have some generic flow that works depending on the conditions. Now the problem I faced is that when running
cargo release
in the root (ie. workspace) directory, I need to specify theLEVEL
for all crates. However, what ifthe-lib
introduced breaking API changes and I want to bump it's major (ie.0.1.0
->1.0.0
) whilethe-cli
(that depends onthe-lib
) should merely be bumped with minor0.2.0
->0.3.0
and at the same time have it's crates dependencies (ie.the-lib
) updated from^0.1.0
to^1.0.0
.the-db
was not changed at all so I'd like to skip it's version bump completely (not even make it a patch) but I don't have a "skip" LEVEL and any other options will leave me with an unnecessary version bump or an error that I'm trying to publish an already published package.Ideally (I think) the decision on what should be the bump level I'd like to leave to the person that introduced those changes. So if I was the one who changed
the-lib
that it is not backwards compatible anymore, I should also be the one to somehow store that information in the code (think: gitflow). Perhaps I could use per-craterelease.toml
for that?Right now I'm thinking to use pre-release hooks but I still don't know what should those hooks do exactly to achieve my goal. Any suggestions? thanks!
The text was updated successfully, but these errors were encountered: