calculate the next version #943
-
Hey, I would like to automatically calculate the next version based on cargo semver-checks --baseline-version 0.0.1
Checking todo_command v0.0.1 -> v0.0.1 (no change)
Checked [ 0.010s] 89 checks: 88 pass, 1 fail, 0 warn, 0 skip
--- failure struct_missing: pub struct removed or renamed ---
Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.35.0/src/lints/struct_missing.ron
Failed in:
struct todo_command::ImportFunctionCommand, previously in filesrc/import_function.rs:16
Summary semver requires new major version: 1 major and 0 minor checks failed
Finished [ 9.928s] todo_command For a human, the next version is obvious. For a machine, it's not that easy. I can do cargo semver-checks --baseline-version 0.0.1 --calculate-next-version
1.0.0 Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi @Mcdostone! Thanks for the suggestion. Could you say a bit more about the intended use case of such a feature? Where would it be used, and how? So far, we've considered it a few times for a few different use cases, but we always felt it was too risky given that there are still many breaking changes that The other open question is what to do about warning-level lints (the lint shown in your example output is an error-level lint, but some lints will only warn). Should the version bump recommendation of warning-level lints be heeded in this hypothetical feature, or not? I'd love to understand your use case better, and see if there's perhaps a different way to approach solving the problem! |
Beta Was this translation helpful? Give feedback.
-
Hey, sorry for being vague. I'm working on a github action pipeline. One of the workflow consists of preparing a release branch. At this time, this workflow is manually triggered and 1 input is required ( # .github/workflows/prepare-for-release.yml
on:
workflow_dispatch:
inputs:
bump:
type: choice
required: true
description: Run 'cargo semver-checks' to help you decide
options:
- major
- minor
- patch In a few words, the workflow:
I would like to get rid of the manual workflow dispatch and automatically generate the PR without user input. Regarding your second question, merging the PR to I'm aware that it's risky to 100% trust It's my first time using your tool so there may be a better approach. Thanks for your help |
Beta Was this translation helpful? Give feedback.
I'm worried that the existence of such a flag might lead other folks (who might not be as thoughtful as you!) into making bad versioning decisions. If it's alright with you, I'd prefer if you just script it based on the existing output for now.
Tangentially, I've been designing a workflow around
cargo-semver-checks
where we can label PRs assemver:minor
orsemver:major
etc. based on the tool output. Then release workflows could check the PRs being released for major/minor labels and update versions accordingly. And since PR labels can be edited by humans as well as by thecargo-semver-checks
workflow, we could rely on PR reviewers to set thesemver:major
label in cases where there's break…