getnelson / quiver

A reasonable library for modeling multi-graphs in Scala
http://verizon.github.io/quiver/
Apache License 2.0
5 stars 3 forks source link

Scala 2.13, Scala.JS, Microsite, Mdoc, dropping 2.11 and 2.10 #5

Closed keynmol closed 4 years ago

keynmol commented 4 years ago

New "site": http://quiver-site-example.surge.sh/quiver/

Closes #4

Lots of changes here:

Drop 2.11, publish for 2.12 and 2.13
Move build to simpler multi-module
Publish all modules for Scala.js 1.x
Update all the dependencies
Move from tut to mdoc
Add scalafmt plugin
Change site to sbt-microsites (couldn't get sbt-site to work with mdoc)

It's a lot here, but changes are mostly due to gradual yak shaving. ~There's some versioning changes brought in, I was hoping to be able to release more frequently, from CI and using dynver~

rossabaker commented 4 years ago

sbt-rig is geared toward automated releases on merges to master. It uses CI build numbers for the patch version, and gives an experience similar to dynver. It has docs built in, and making it work with modern tools like microsites and mdoc may be another small-sized yak, but I imagine not too difficult.

Adding the project to scala-steward would also help keep the dependencies fresh.

keynmol commented 4 years ago

@rossabaker

after a lot of dances around scoverage and 2.13 (no SJS1, problems with 2.13, project hasn't been released in a while), I got this into a CI passing state.

I'm going to leave the decision to stick with sbt-rig to the maintainers.

Would be happy to help set up quiver with modern tooling, as I think adding mdoc and microsite support to an archived sbt-rig project would be of little gain. Admittedly, I don't know what the status is with all those archived projects under Verizon org and whether there are official forks with release rights and maintainers that have time.

My hope is that this PR looks good enough to at least release quiver for all the platforms and versions and that I didn't break anything particularly badly :)

rossabaker commented 4 years ago

I'm curious what MiMa thinks of the change from Stream to LazyList. Did we maintain binary compatibility with that, or do we need to bump the version.sbt? This is important, because when we merge, the rig infrastructure will tag and release it. Otherwise, this looks good to me.

I don't think anybody is actively maintaining Rig anymore. We had problems with the public Travis CI infrastructure, and the Rig-based, private infra was much more reliable. @timperrett replicated it when the projects moved from Verizon. I defer to him on release infra, but am willing to help set up the variables for sbt-ci-release if there's a mandate to switch.

keynmol commented 4 years ago

That's a good point, I'll run MiMa on here (is it part of sbt-rig? if not I'll add it here explicitly)

Also I think I've spotted that fold is not stack-safe, and weird behavior in nmap and emap (probably because of not using lazy mapValues anymore) - I just want to check whether it's actually due to my changes and add tests for that.

I went all-hot on new tooling just because my first experience of setting up sonatype publish happened around the same time and I was riding on a high from how easy it was :D So whatever works right now is fine as long as it can be used to release quiver for 2.12 and 2.13

rossabaker commented 4 years ago

sbt-rig does not integrate MiMa, but I imagine would play nicely alongside it.

Old as it is, I fully expect it's still capable of releasing this, and if it doesn't release cleanly when we hit the green button here, I'll help figure out why not.

keynmol commented 4 years ago

You were right, because of the shims for LazyList it will fail bincompat:

[quiver] λ ++2.12.11; coreJVM/mimaReportBinaryIssues 
[info] Setting Scala version to 2.12.11 on 6 projects.
[info] Reapplying settings...
[info] set current project to quiver (in build file:/root/projects/quiver/)
[info] Compiling 7 Scala sources to /root/projects/quiver/core/.jvm/target/scala-2.12/classes ...
[info] Cleaning datadir [/root/projects/quiver/core/.jvm/target/scala-2.12/scoverage-data]
[info] Beginning coverage instrumentation
[info] Instrumentation completed [1032 statements]
[info] Wrote instrumentation file [/root/projects/quiver/core/.jvm/target/scala-2.12/scoverage-data/scoverage.coverage]
[info] Will write measurement data to [/root/projects/quiver/core/.jvm/target/scala-2.12/scoverage-data]
[error] core: Failed binary compatibility check against io.verizon.quiver:core_2.12:7.0.19! Found 10 potential problems
[error]  * static method getLPaths(java.lang.Object,scala.collection.immutable.Stream)scala.collection.immutable.Stream in class quiver.package's type is different in current version, where it is (java.lang.Object,scala.collection.compat.immutable.LazyList)scala.collection.compat.immutable.LazyList instead of (java.lang.Object,scala.collection.immutable.Stream)scala.collection.immutable.Stream
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("quiver.package.getLPaths")
[error]  * static method getLPath(java.lang.Object,scala.collection.immutable.Stream)scala.Option in class quiver.package's type is different in current version, where it is (java.lang.Object,scala.collection.compat.immutable.LazyList)scala.Option instead of (java.lang.Object,scala.collection.immutable.Stream)scala.Option
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("quiver.package.getLPath")
[error]  * static method getPath(java.lang.Object,scala.collection.immutable.Stream)scala.Option in class quiver.package's type is different in current version, where it is (java.lang.Object,scala.collection.compat.immutable.LazyList)scala.Option instead of (java.lang.Object,scala.collection.immutable.Stream)scala.Option
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("quiver.package.getPath")
[error]  * method getPath(java.lang.Object,scala.collection.immutable.Stream)scala.Option in object quiver.package's type is different in current version, where it is (java.lang.Object,scala.collection.compat.immutable.LazyList)scala.Option instead of (java.lang.Object,scala.collection.immutable.Stream)scala.Option
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("quiver.package.getPath")
[error]  * method getLPath(java.lang.Object,scala.collection.immutable.Stream)scala.Option in object quiver.package's type is different in current version, where it is (java.lang.Object,scala.collection.compat.immutable.LazyList)scala.Option instead of (java.lang.Object,scala.collection.immutable.Stream)scala.Option
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("quiver.package.getLPath")
[error]  * method getLPaths(java.lang.Object,scala.collection.immutable.Stream)scala.collection.immutable.Stream in object quiver.package's type is different in current version, where it is (java.lang.Object,scala.collection.compat.immutable.LazyList)scala.collection.compat.immutable.LazyList instead of (java.lang.Object,scala.collection.immutable.Stream)scala.collection.immutable.Stream
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("quiver.package.getLPaths")
[error]  * method bf(scala.collection.immutable.Queue)scala.collection.immutable.Stream in class quiver.Graph has a different result type in current version, where it is scala.collection.compat.immutable.LazyList rather than scala.collection.immutable.Stream
[error]    filter with: ProblemFilters.exclude[IncompatibleResultTypeProblem]("quiver.Graph.bf")
[error]  * method bft(java.lang.Object)scala.collection.immutable.Stream in class quiver.Graph has a different result type in current version, where it is scala.collection.compat.immutable.LazyList rather than scala.collection.immutable.Stream
[error]    filter with: ProblemFilters.exclude[IncompatibleResultTypeProblem]("quiver.Graph.bft")
[error]  * method lbf(scala.collection.immutable.Queue)scala.collection.immutable.Stream in class quiver.Graph has a different result type in current version, where it is scala.collection.compat.immutable.LazyList rather than scala.collection.immutable.Stream
[error]    filter with: ProblemFilters.exclude[IncompatibleResultTypeProblem]("quiver.Graph.lbf")
[error]  * method lbft(java.lang.Object)scala.collection.immutable.Stream in class quiver.Graph has a different result type in current version, where it is scala.collection.compat.immutable.LazyList rather than scala.collection.immutable.Stream
[error]    filter with: ProblemFilters.exclude[IncompatibleResultTypeProblem]("quiver.Graph.lbft")

Given it's changes in the public API, shall I set the version in version.sbt to 8.0.0-SNAPSHOT?

rossabaker commented 4 years ago

Yep! Bump the major version just like that, and rig will release it with a semver-compliant version: 8.0.z, where z is a monotonically increasing build number on Tim's infrastructure.

keynmol commented 4 years ago

I'll bump the version and then ~will do 1 attempt to return 2.11 back into cross-build - I misread the description of scala-collection-compat thinking it was only for 2.12~ silly me, latest cats is not on 2.11

keynmol commented 4 years ago

@rossabaker shall we try merging? I can't imagine the release breaking unless the fork is not setup for the io.getnelson org on sonatype, but the site won't be published - I hope to address that later

rossabaker commented 4 years ago

Thanks for reminding me. I thought I had already!

timperrett commented 4 years ago

@keynmol quiver 8.0.9 is now released, thanks for your patience - this is now fully automated for future contributions 😄