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

Finish migration from Scalaz to Cats #75

Merged
merged 11 commits into from
Jun 2, 2018

Conversation

adelbertc
Copy link
Member

@adelbertc adelbertc commented May 27, 2018

  • Migrate remaining NonEmptyList and Validation
  • Migrate \/ and DisjunctionT
  • Clean up CatsHelpers
  • Migrate OptionT
  • Migrate ==>> to SortedMap and migrate Order
    • To test Order laws had to bring in cats-laws.. which requires bringing in a new version of ScalaCheck.. which requires bringing in a new version of ScalaTest (yay dependencies)
  • Migrate Kleisli
  • Migrate RWST
  • Migrate Interpreter
  • Inline/port scalaz.{@@, Tag} to Cats
  • Migrate Quiver
  • Bump http4s-argonaut61 to completely remove Scalaz on classpath

@codecov-io
Copy link

codecov-io commented May 27, 2018

Codecov Report

Merging #75 into master will increase coverage by 0.29%.
The diff coverage is 72.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #75      +/-   ##
==========================================
+ Coverage   57.91%   58.21%   +0.29%     
==========================================
  Files         128      128              
  Lines        4279     4269      -10     
  Branches      104      104              
==========================================
+ Hits         2478     2485       +7     
+ Misses       1801     1784      -17
Impacted Files Coverage Δ
core/src/main/scala/TaskStatus.scala 0% <ø> (ø) ⬆️
http/src/main/scala/Main.scala 0% <ø> (ø) ⬆️
core/src/main/scala/workflows/Canopus.scala 7.14% <ø> (ø) ⬆️
http/src/main/scala/plans/Params.scala 0% <ø> (ø) ⬆️
core/src/main/scala/workflows/Magnetar.scala 34.28% <ø> (ø) ⬆️
core/src/main/scala/vault/op.scala 81.81% <ø> (ø) ⬆️
core/src/main/scala/routing/cron.scala 0% <ø> (ø) ⬆️
...e/src/main/scala/scheduler/DeploymentSummary.scala 0% <ø> (ø) ⬆️
core/src/main/scala/InstrumentedVaultClient.scala 55% <ø> (ø) ⬆️
core/src/main/scala/yaml/ManifestParser.scala 100% <ø> (ø) ⬆️
... and 60 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3946372...e356f6b. Read the comment docs.

@adelbertc adelbertc force-pushed the cats-onwards branch 2 times, most recently from 76e52b5 to 0948ae0 Compare May 27, 2018 08:46
- Also due to checking cats.Order laws for Instant, bring in cats-laws
  which brings in a new version of ScalaCheck which then requires us to
  bring in a new version of ScalaTest for bincompat. Dependencies are fun..
@adelbertc adelbertc changed the title [WIP] Finish migration from Scalaz to Cats Finish migration from Scalaz to Cats May 28, 2018
@adelbertc
Copy link
Member Author

Did the usual basic test on K8s - released a job, verified it deployed and ran, released a new version, verified old job was GC'd and expiration times worked as expected. Ready to be reviewed!

@@ -192,8 +187,7 @@ object Datacenter {

object Namespace {
implicit def namespaceOrder: Order[Namespace] =
Order[String].contramap[Namespace](_.datacenter) |+|
Order[String].contramap[Namespace](_.name.asString)
Order.whenEqual(Order.by(_.datacenter), Order.by(_.name.asString))
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with whenEqual but assuming the sematics remain the same.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep! Some discussion here: typelevel/cats#2087

import scalaz._

// Triskaidekaphobia
object BiggerApplies {
Copy link
Contributor

Choose a reason for hiding this comment

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

It was a sad day when I had to write this (or was that Ross, I can't remember), but glad it see it go. Assuming you are using mapN in places where this would have been applicable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yessir, I always wondered if they bothered to go up to 13, why not just go up the rest of the way to 22?

/** Copied and adapted from Scalaz's Tag implementation.
* https://github.com/scalaz/scalaz/blob/v7.1.17/core/src/main/scala/scalaz/package.scala
*/
private[this] type Tagged[A, T] = { type Tag = T; type Self = A; }
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious why this doesn't exist in cats. Is it something that should be added?

Copy link
Member Author

Choose a reason for hiding this comment

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

There's been a couple competing implementations and nobody has converged on something yet, I think at this point a lot of folks are waiting for SIP-35 opaque types to land.

@kaiserpelagic
Copy link
Contributor

@adelbertc where you able to test services on k8s, or just jobs? We have a decent amount of unit tests around the routing stuff so I feel pretty comfortable if you weren't able to test that.

Anyways this LGTM, seems to be pretty mechanical. Also, thanks for taking this on.

@adelbertc
Copy link
Member Author

@kaiserpelagic Just jobs, unfortunately routing is currently not implemented in the K8s backend yet (SHHHH), but now that the Cats migration is done I want to move on to doing that pretty soon. @timperrett and I have talked a couple of times of how that might look, essentially we're going to co-opt the K8s Service and Labels mechanisms.

@adelbertc adelbertc merged commit de3062d into getnelson:master Jun 2, 2018
@adelbertc adelbertc deleted the cats-onwards branch June 2, 2018 03:03
@adelbertc
Copy link
Member Author

All aboard the catboat! Or if you prefer, the catamaran.

@adelbertc adelbertc mentioned this pull request Jun 2, 2018
6 tasks
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