-
Notifications
You must be signed in to change notification settings - Fork 134
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
Automatically handle MiMa for all versions #532
base: main
Are you sure you want to change the base?
Conversation
I think it would be easier to explicitly name the version that we are diffing against. For me, both 1.0.x and main should diff against 1.0.0 release. |
The problem is that this is brittle, if we forget to bump the version (as we just did) then we can introduce bincompat problems. The logic of what we want to do is perfectly easy to automate
Yes and this is retained |
5345b96
to
7194968
Compare
26257ed
to
b26b3ed
Compare
Okay PR is ready to review. |
b26b3ed
to
53c812b
Compare
53c812b
to
3065928
Compare
build failed because we have no 1.1.0-M0 jars to compare against. |
So this solution would be much more cleanly solved by just publishing a milestone artifact. Tagging something as milestone but not publishing its artifact is all things considered not idiomatic. We can discuss whether it makes sense to bundled a Otherwise the only other way to solve this problem is to hack some kind of workaround and/or not use milestone tags and deal with the fact that until the first release is made for a new minor the snapshots will not line up. |
Let me close and reopen to trigger a rebuild. |
checkMimaFilterDirectories := checkFilterDirectories(baseDirectory.value, version.value)) | ||
|
||
def checkFilterDirectories(moduleRoot: File, version: String): Unit = { | ||
val strippedPatchRegex = """(\d+)(.*)""".r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This regex doesn't make sense if we're matching against the whole version—if you have a version of 1.1.0
then you're extracting .1.0
as the patch version which doesn't parse as an int. Did you want something like \d+[.]\d+[.](\d+).*
?
The primary goal of this PR is to automatically handle checking for MiMa while in the process removing the hardcoding of
latestPatchOf10
(which is currently incorrect since it should be1
due to Pekko 1.0.1 being released but the fact that we forgot to increment this strengthens the argument for doing this automatically).The PR is designed to handle the following cases
1.0.x
to1.1.x
) but no version yet released. For this case we compare to the entire previous minor release (i.e.1.0.0
and1.0.1
with the example of1.1.x
)1.0.0
) which implies a snapshot in which case we just compare with1.0.0
1.0.1
released then we compare to all of the previous versions from the major series up until this one.The code is cleanly commented and its also easy to test, i.e. in
build.set
setto whatever version you want to test with and then just run
sbt mimaPreviousArtifacts
. This will give you a list of all of computed artifacts to check against.