Skip to content

Support for sbt 1.0

Compare
Choose a tag to compare
@jeffmay jeffmay released this 17 Aug 00:19
· 17 commits to main since this release
118afbb

sbt 1 support!

First release to supporting sbt 1! You can read about the features in the sbt 1.0 and sbt 1.1 blog posts.

Cross building will continue to publish 0.13 versions for some time.

#11

semVerPreRelease removed

semVerPreRelease referred to major=0 versions as described in http://semver.org/#spec-item-4, but "pre-release" has an entirely different meaning: http://semver.org/#spec-item-9. Confusing!

I'm removing to simplify. There are enough seams for users to add the capability back in their own build.sbt if desired.

semVerLimit deprecated/ignored

The initial intent behind semVerLimit was to highlight any breaking changes in PR that would require major version bumps. Unfortunately, semVerLimit does not provide sufficient information to other plugins (like the shading plugin https://github.com/AudaxHealthInc/rally-versioning/pull/77) about staged major releases. gitVersioningSnapshotLowerBound has since superseded it.

semVerLimit is now deprecated and if set, will log a deprecation warning and that the value will be ignored.

Logging Clarifications

I have received lots of questions from engineers about SemVer's logging. It's currently high noise/low signal.

This is a passing test run from an example project:

> test
[info] [SemVer] Checking ENABLED with LIMIT target semVerLimit=1.999.999
[info] [SemVer] Checking ENABLED with LIMIT target semVerLimit=1.999.999
[info] [SemVer] Checking ENABLED with LIMIT target semVerLimit=1.999.999
[info] [SemVer] Checking ENABLED with LIMIT target semVerLimit=1.999.999
[info] [SemVer] Checking ENABLED with LIMIT target semVerLimit=1.999.999
[info] [SemVer] Checking ENABLED with LIMIT target semVerLimit=1.999.999
[info] [SemVer] Checking ENABLED with LIMIT target semVerLimit=1.999.999
[info] [SemVer] Check type: comparing most recent release with post-tag changes
[info] [SemVer] Check starting (prev=0.3.0 vs curr=1.999.999) ...
[info] [SemVer] Check aborted: limit=1.999.999 allows major upgrades, no check needed.
[info] [SemVer] Check type: comparing most recent release with post-tag changes
[info] [SemVer] Check starting (prev=0.3.0 vs curr=1.999.999) ...
[info] [SemVer] Check type: comparing most recent release with post-tag changes
[info] [SemVer] Check aborted: limit=1.999.999 allows major upgrades, no check needed.
[info] [SemVer] Check type: comparing most recent release with post-tag changes
[info] [SemVer] Check starting (prev=0.3.0 vs curr=1.999.999) ...
[info] [SemVer] Check aborted: limit=1.999.999 allows major upgrades, no check needed.
[info] [SemVer] Check type: comparing most recent release with post-tag changes
[info] [SemVer] Check type: comparing most recent release with post-tag changes
[info] [SemVer] Check starting (prev=0.3.0 vs curr=1.999.999) ...
[info] [SemVer] Check starting (prev=0.3.0 vs curr=1.999.999) ...
[info] [SemVer] Check aborted: limit=1.999.999 allows major upgrades, no check needed.
[info] [SemVer] Check aborted: limit=1.999.999 allows major upgrades, no check needed.
[info] [SemVer] Checking ENABLED with LIMIT target semVerLimit=1.999.999
[info] [SemVer] Check starting (prev=0.3.0 vs curr=1.999.999) ...
[info] [SemVer] Check aborted: limit=1.999.999 allows major upgrades, no check needed.
[info] [SemVer] Check type: comparing most recent release with post-tag changes
[info] [SemVer] Check starting (prev=0.3.0 vs curr=1.999.999) ...
[info] [SemVer] Check aborted: limit=1.999.999 allows major upgrades, no check needed.
[info] [SemVer] Checking ENABLED with LIMIT target semVerLimit=1.999.999
[info] [SemVer] Checking ENABLED with LIMIT target semVerLimit=1.999.999
[info] [SemVer] Check type: comparing most recent release with post-tag changes
[info] [SemVer] Check starting (prev=0.3.0 vs curr=1.999.999) ...
[info] [SemVer] Check aborted: limit=1.999.999 allows major upgrades, no check needed.
[info] [SemVer] Check type: comparing most recent release with post-tag changes
[info] [SemVer] Check starting (prev=0.3.0 vs curr=1.999.999) ...
[info] [SemVer] Check aborted: limit=1.999.999 allows major upgrades, no check needed.
[info] [SemVer] Check type: comparing most recent release with post-tag changes
[info] [SemVer] Check starting (prev=0.3.0 vs curr=1.999.999) ...
[info] [SemVer] Check aborted: limit=1.999.999 allows major upgrades, no check needed.
[success] Total time: 5 s, completed Sep 5, 2017 11:26:06 PM

New strategy is to include the relevant failure information in the failure exception. On success, we log at debug or below, just like the majority of other sbt tasks.

Errors are now at the end of the build and look like this:

06:21:34 [error] (api/*:semVerCheck) com.rallyhealth.sbt.semver.SemVerVersionTooLowException: Your changes have new functionality and binary incompatibilites which violates the http://semver.org rules for a Minor release (1.21.0 => 1.21.1).
06:21:34 [error] 
06:21:34 [error] Specifically, MiMa detected the following binary incompatibilities:
06:21:34 [error] (1/2) Backward -> abstract method withExtension(java.lang.Object,java.lang.Object)java.lang.Object in interface com.rallyhealth.interceptor.v1.typeclass.WithExtension does not have a correspondent in current version
06:21:34 [error] (2/2) Backward -> abstract method withSemVerViolation(java.lang.Object,java.lang.Object)java.lang.Object in interface com.rallyhealth.interceptor.v1.typeclass.WithExtension is present only in current version
06:21:34 [error] 
06:21:34 [error] These changes would require a Major release instead (1.21.0 => 2.0.0).
06:21:34 [error] You can adjust the version by adding the following setting:
06:21:34 [error]   .settings(gitVersioningSnapshotLowerBound := "2.0.0")
06:21:34 [error] Total time: 19 s, completed Jul 10, 2018 6:21:34 AM

Bugfix: gitVersioningSnapshotLowerBound

Fixed a regression where gitVersioningSnapshotLowerBound incorrectly produced release versions when HEAD was a tagged version. Now it always produces a SNAPSHOT version anytime it modifies the version (as reflected by the name and original implementation).