Skip to content

Conversation

@ScrapCodes
Copy link
Member

PR 585 from incubator repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than getting these from a jar file I'd just look at the current classpath and search for org.apache.spark classes:

You can follow the code here:
http://dzone.com/snippets/get-all-classes-within-package

@pwendell
Copy link
Contributor

Hey @ScrapCodes this is looking good. I think ideally the way this should work is the following. After we run sbt/sbt assembly test in the build script we should run ./spark-class org.apache.spark.tools.GenerateMIMAIgnore and then run the MIMA checker. The generation script should create a file in a well known location (e.g. .mima-excludes) and the MIMA script should read that file and create excludes automatically.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add logic here that reads from .mima-excludes and ignores classes defined in there.

@ScrapCodes
Copy link
Member Author

./spark-class org.apache.spark.tools.GenerateMIMAIgnore and then run the MIMA checker. The generation script should create a file in a well known location (e.g. .mima-excludes) and the MIMA script should read that file and create excludes automatically.

I am not very sure, but won't this automatic creation of excludes forfeit the purpose of having mima at all. What would happen if a class was public in version 1 and become private[x] in 1.2. Then we would simply ignore it but it is a violating of binary compatibility.

@AmplabJenkins
Copy link

@pwendell
Copy link
Contributor

@ScrapCodes yes you are correct. We'll miss those cases - but without proper MIMA support I don't think we can fix that. Do you see an alternative solution that would catch those types of errors?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think maybe we should not include this file in the repo (e.g. put it in .gitigntore) and just generate it automatically inside of ./dev/run-test. Otherwise we'll have to update this all the time.

@pwendell
Copy link
Contributor

@ScrapCodes by the way - I don't think this forfeits all of the functionality. If someone goes and makes a class private that was not previously private it's an obvious change in visibility and something we can easily see during reviews. The much bigger issue are when people change functions and traits in a way that actual breaks compatibility but is hard to detect/notice (for instance, if you change a val to a def in a trait, it is invalid). Those cases are the hardest ones and they will still be caught here.

@pwendell
Copy link
Contributor

Hey @ScrapCodes FYI I think I'm gonna take a crack a this tonight using this patch as a starting point. I found a few other issues when doing more review and it's fairly complicated, so I may just submit a second patch. Details fourthcoming... :)

@tgravescs
Copy link
Contributor

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.

5 participants