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

Shouldn't releaseVersion always be ReleaseVersion.fromCompatibility(BinaryAndSourceCompatible) for sbt-release? #200

Open
steinybot opened this issue Apr 9, 2024 · 2 comments

Comments

@steinybot
Copy link

steinybot commented Apr 9, 2024

sbt-release has the setNextVersion release step which is where we loosly decide what the next version should be. For example, releasing 1.0.0 will set the next version to 1.0.1-SNAPSHOT. version is always the next version to release (with a SNAPSHOT qualifier) which is a requirement for MiMa.

We run versionPolicyCheck in CI so any PR with breaking changes needs to:
a) set versionPolicyIntention to something else such as BinaryCompatible
b) and bump the version such as 1.1.0-SNAPSHOT

Now if we were to run release in this state then ReleaseVersion.fromCompatibility(versionPolicyIntention.value) is going to bump the minor again and we will end up releasing 1.2.0 instead of 1.1.0.

So shouldn't releaseStepTask(setAndCommitNextCompatibilityIntention) appear before setReleaseVersion?

@steinybot
Copy link
Author

steinybot commented Apr 9, 2024

Hmm versionPolicyIntention seems to have double duties. When used in versionPolicyCheck it need to be BinaryCompatible to pass check on 1.1.0-SNAPSHOT. When used in ReleaseVersion.fromCompatibility it needs to be BinaryAndSourceCompatible to so that the release is 1.1.0.

So I guess the issue is not where releaseStepTask(setAndCommitNextCompatibilityIntention) occurs but rather releaseVersion should always be ReleaseVersion.fromCompatibility(BinaryAndSourceCompatible).

@steinybot steinybot changed the title Shouldn't versionPolicyIntention be reset before setReleaseVersion for sbt-release? Shouldn't releaseVersion always be ReleaseVersion.fromCompatibility(BinaryAndSourceCompatible) for sbt-release? Apr 9, 2024
@julienrf
Copy link
Collaborator

b) and bump the version such as 1.1.0-SNAPSHOT

Is this really required? Would it be possible to keep the version 1.0.1-SNAPSHOT until the next release process? Thus, setReleaseVersion would use ReleaseVersion.fromCompatibility(versionPolicyIntention.value) and produce version 1.1.0 in your example.

Otherwise, if your workflow needs the version to be 1.1.0-SNAPSHOT, then I think you could even use the default releaseVersion (without using ReleaseVersion.fromCompatibility at all), no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants