Git Product home page Git Product logo

Comments (6)

rkuhn avatar rkuhn commented on August 28, 2024

The list should preferably be parsed from a plain-text file which is easy to version-control.

from mima.

havocp avatar havocp commented on August 28, 2024

I'm thinking we put the list right in the sbt config. Basically you'd do:

   findBinaryIssues <<= findBinaryIssues map { unfiltered =>
       unfiltered filter { problem =>
           // screen out problems here
       }
   }

I guess Josh you're suggesting one more level of indirection, where we'd have:

 val ignoredBinaryIssues = TaskKey[List[core.ProblemFilter]]("mima-ignored-binary-issues", "Filters for binary compatibility issues to be ignored.")

And then we'd automatically use that list in the default findBinaryIssues? Sounds fine.

Is there any reason we need an external text file, assuming we have a nice little API or DSL to build up the list of ignored issues?

I'm thinking the API or DSL would let you match on:

  • the type hierarchy in Problems.scala (e.g. MemberProblem or MissingFieldProblem)
  • the relevant name(s), like class or member name
  • previous-artifact (all issues become un-ignored by default if you change previous-artifact?)

Is that a good start? I'm sure the list of stuff to match on might grow over time. I think we could just allow you to write a function, to do unusual matching, so the convenience API/DSL would only need to support/encourage the common things.

Do we need the investigator/comment explaining the exceptions to be strings in the code, or could those be comments in your sbt build file?

I would have to mess with the syntax for this a bit. Maybe we want the syntax to generate something like:

type ProblemFilter = (Problem) => Boolean

class SimpleProblemFilter[T : ClassManifest](val symbolName: String, val oldVersion: String) extends ProblemFilter {
  override def apply(problem: Problem) = {
    // implement me
  }
}

The syntax would be to avoid typing SimpleProblemFilter[MissingFieldProblem]("foo", "1.2") since that's a bit noisy. You'd type something more like (MissingField, "foo", "1.2") perhaps. Or ProblemFilter("1.2", Seq((MissingField, "foo"))) ... i don't know, something along those lines.

Another aspect of this is, probably each time we print a problem, we should print a second line illustrating the problem filter you'd have to type in to ignore it? Otherwise it's probably a little bit annoying to figure out.

from mima.

havocp avatar havocp commented on August 28, 2024

OK here is a possible patch: https://gist.github.com/2878457
And here is how you'd use it in Akka: https://gist.github.com/2878474 (minus explanatory comments)
You might want to move the list of filters into its own .scala file but that's obviously possible.

I didn't do the thing with specifying the old version the filter would apply to, because I couldn't come up with a great way to do it, and maybe it isn't useful anyway.

The API here is pretty cheesy but it does let you write an arbitrary function, so I guess there would at least be some way to do anything you want to do, and the exclude[FooProblem]("bar") should support all the common cases.

If you have an issue, it now tells you how to ignore it:

[error]  * method <<(akka.dispatch.PromiseStreamOut)scala.util.continuations.ControlContext in class akka.dispatch.DefaultPromise does not have a correspondent with same parameter signature among (akka.dispatch.Future)scala.util.continuations.ControlContext, (java.lang.Object)scala.util.continuations.ControlContext
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.dispatch.DefaultPromise.<<")
[error]  * class akka.dispatch.SharingMailbox does not have a correspondent in new version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("akka.dispatch.SharingMailbox")

You still get a count of ignored issues, like:

[info] akka-actor: found 353 potential binary incompatibilities (filtered 2)

and at debug loglevel (if you do last in sbt) you can get the details on filtered stuff:

[debug] akka-actor: filtered out: method <<(akka.dispatch.PromiseStreamOut)scala.util.continuations.ControlContext in class akka.dispatch.DefaultPromise does not have a correspondent with same parameter signature among (akka.dispatch.Future)scala.util.continuations.ControlContext, (java.lang.Object)scala.util.continuations.ControlContext
[debug]   filtered by: ExcludeByName[IncompatibleMethTypeProblem]("akka.dispatch.DefaultPromise.<<")
[debug] akka-actor: filtered out: class akka.dispatch.SharingMailbox does not have a correspondent in new version
[debug]   filtered by: ExcludeByName[MissingClassProblem]("akka.dispatch.SharingMailbox")

Anyway, feel free to suggest improvements. I guess this would solve the problem but it wouldn't hurt to spend a couple hours making it a little nicer if people have any ideas for that.

from mima.

jsuereth avatar jsuereth commented on August 28, 2024

Looks good! comments in the Gist

Also, should we add the same feature to the UI and CLI?

On Tue, Jun 5, 2012 at 6:24 PM, Havoc Pennington <
[email protected]

wrote:

OK here is a possible patch: https://gist.github.com/2878457
And here is how you'd use it in Akka: https://gist.github.com/2878474(minus explanatory comments)
You might want to move the list of filters into its own .scala file but
that's obviously possible.

I didn't do the thing with specifying the old version the filter would
apply to, because I couldn't come up with a great way to do it, and maybe
it isn't useful anyway.

The API here is pretty cheesy but it does let you write an arbitrary
function, so I guess there would at least be some way to do anything you
want to do, and the exclude[FooProblem]("bar") should support all the
common cases.

If you have an issue, it now tells you how to ignore it:

[error]  * method
<<(akka.dispatch.PromiseStreamOut)scala.util.continuations.ControlContext
in class akka.dispatch.DefaultPromise does not have a correspondent with
same parameter signature among
(akka.dispatch.Future)scala.util.continuations.ControlContext,
(java.lang.Object)scala.util.continuations.ControlContext
[error]    filter with:
ProblemFilters.exclude[IncompatibleMethTypeProblem]("akka.dispatch.DefaultPromise.<<")
[error]  * class akka.dispatch.SharingMailbox does not have a
correspondent in new version
[error]    filter with:
ProblemFilters.exclude[MissingClassProblem]("akka.dispatch.SharingMailbox")

You still get a count of ignored issues, like:

[info] akka-actor: found 353 potential binary incompatibilities (filtered
2)

and at debug loglevel (if you do last in sbt) you can get the details on
filtered stuff:

[debug] akka-actor: filtered out: method
<<(akka.dispatch.PromiseStreamOut)scala.util.continuations.ControlContext
in class akka.dispatch.DefaultPromise does not have a correspondent with
same parameter signature among
(akka.dispatch.Future)scala.util.continuations.ControlContext,
(java.lang.Object)scala.util.continuations.ControlContext
[debug]   filtered by:
ExcludeByName[IncompatibleMethTypeProblem]("akka.dispatch.DefaultPromise.<<")
[debug] akka-actor: filtered out: class akka.dispatch.SharingMailbox does
not have a correspondent in new version
[debug]   filtered by:
ExcludeByName[MissingClassProblem]("akka.dispatch.SharingMailbox")

Anyway, feel free to suggest improvements. I guess this would solve the
problem but it wouldn't hurt to spend a couple hours making it a little
nicer if people have any ideas for that.


Reply to this email directly or view it on GitHub:

#3 (comment)

from mima.

havocp avatar havocp commented on August 28, 2024

Cool, I sent a pull (unless you want to block on having UI/CLI patch)

I guess the UI and CLI raise some extra questions, like where you want to store your exceptions list (a file passed in on command line?) and in what format. Maybe we should open a new issue to track/discuss that?

from mima.

jsuereth avatar jsuereth commented on August 28, 2024

Please open a new ticket, yeah....

On Wed, Jun 6, 2012 at 10:21 AM, Havoc Pennington <
[email protected]

wrote:

Cool, I sent a pull (unless you want to block on having UI/CLI patch)

I guess the UI and CLI raise some extra questions, like where you want to
store your exceptions list (a file passed in on command line?) and in what
format. Maybe we should open a new issue to track/discuss that?


Reply to this email directly or view it on GitHub:

#3 (comment)

from mima.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.