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

Setup MiMa #18

Merged
merged 6 commits into from
Jan 29, 2017
Merged

Setup MiMa #18

merged 6 commits into from
Jan 29, 2017

Conversation

cchantep
Copy link
Member

@cchantep cchantep commented Jan 2, 2017

No description provided.

@gmethvin
Copy link
Member

gmethvin commented Jan 2, 2017

@cchantep I don't think we need to worry about compatibility with the milestone version. We probably will break binary compatibility anyway. Once 2.6.0 is released we can set up a maintenance branch for 2.6.x.

@cchantep
Copy link
Member Author

cchantep commented Jan 2, 2017

2.6.0-M1 is the first release against which the MiMa check can be done.

set -e

sbt clean scalariformFormat test:scalariformFormat
git diff --exit-code || (
Copy link
Member

@marcospereira marcospereira Jan 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove all these lines and use sbt validateCode instead. This way, most of this file would be unnecessary since it will only call sbt tasks. Instead, you can just remove it and add the following line to the .travis.yml script section:

- sbt ++$TRAVIS_SCALA_VERSION mimaReportBinaryIssues

See #24 for more context.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

import com.typesafe.sbt.SbtScalariform._
import scalariform.formatter.preferences._

val previousVersion = "2.6.0-M1" // first from this separate repo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a better approach here is use something like play-slick. See https://github.com/playframework/play-slick/blob/6506de9228e17961cf121cee1b30044c9bf74920/build.sbt#L44-L52

Of course, after releasing a version and setting a branch for it, we should set the previousVersion variable to activate MiMa.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the point there?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cchantep The point is so the code exists to enable MiMa, and when we create a new branch for the release we can activate it to test binary compatibility.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

resolvers ++= DefaultOptions.resolvers(snapshot = true)
resolvers += Resolver.typesafeRepo("releases")

addSbtPlugin("com.typesafe.play" % "interplay" % sys.props.get("interplay.version").getOrElse("1.3.4"))
//addSbtPlugin("com.typesafe.play" % "play-docs-sbt-plugin" % sys.props.getOrElse("play.version", "2.5.10"))

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.8")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the docs, the most recent version of MiMa sbt plugin is 0.1.13.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Member

@marcospereira marcospereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comments.

@cchantep cchantep force-pushed the feature/18 branch 2 times, most recently from 94f29cf to c5b9715 Compare January 13, 2017 12:38
@@ -14,6 +14,7 @@ before_cache:
- rm -rf $HOME/.ivy2/cache/com.typesafe.play/*
- rm -rf $HOME/.ivy2/cache/scala_*/sbt_*/com.typesafe.play/*
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -print0 | xargs -n10 -0 rm
script: sbt ++$TRAVIS_SCALA_VERSION mimaReportBinaryIssues test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a script section some lines above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad (rebase hell), updated

@cchantep
Copy link
Member Author

Should be ok now

import com.typesafe.sbt.SbtScalariform._
import scalariform.formatter.preferences._

val previousVersion = Some("2.6.0-M1") // first from this separate repo
Copy link
Member

@gmethvin gmethvin Jan 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, this should be set to None since we make no binary compatibility guarantees between milestone versions. Once we release 2.6.0, we'll set to Some("2.6.0"). We can also remove the filters below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that's not a "normal" check: not thefirst version w/o a previous version, not a backward compatible release.

Even if this 2.6.0 will be a major version with some changes breaking the compat (such as the packages), I personnally prefer these breakage were "under control".

At least checking against M1, the API changes other than the packages renaming are validated (and other than what's ok to filter).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cchantep I do see your point; there is some value to knowing which APIs changed during a release. Why don't we try it, but change to 2.5.0? The artifact name is the same so it should be easy to do that. That way we'll actually know all the things that broke binary compatibility in the 2.6.0 release.

Copy link
Member Author

@cchantep cchantep Jan 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I wanted, but due to the package name change, it will detect everything inside as changed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cchantep Name changes could be handled by applying broader filters, for example, to filter out ValidationError issues, we can get pretty close by using { problem => !problem.ref.toString.contains("ValidationError") }.

If I understand correctly, the goal is to document the things that changed in this version, so it's much less useful if we use a milestone version.

Or we can just switch to None and not worry about it until we have a better solution. I don't think MiMa is well designed for this use case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal is to check that, except the package change for ValidationError, most of the API remains compatible.

The filter about ValidationError has been added. Checking against M1 is equivalent (more simple for me), as the changes between 2.5.12 and 2.6.0-M1 are only about this package change.

@cchantep
Copy link
Member Author

Updated

@gmethvin gmethvin merged commit 534ddb8 into playframework:master Jan 29, 2017
@cchantep cchantep deleted the feature/18 branch January 29, 2017 23:50
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

Successfully merging this pull request may close these issues.

3 participants