Skip to content

Conversation

@bpholt
Copy link
Member

@bpholt bpholt commented Oct 6, 2021

Fixes #341 and #380.

We still need someone to generate a gpg keypair and update the GitHub Secrets for the repository. (I'm happy to do this, but I would need to be made an admin to do so.)

final def asyncStreamEq[A](atMost: Duration)(implicit A: Eq[A]): Eq[AsyncStream[A]] = new Eq[AsyncStream[A]] {
final def eqv(x: AsyncStream[A], y: AsyncStream[A]): scala.Boolean = Await.result(
x.take(1).toSeq().join(y.take(1).toSeq()).map { case (x, y) => x == y },
x.head.join(y.head).map((Eq[Option[A]].eqv _).tupled),
Copy link
Member Author

Choose a reason for hiding this comment

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

I made this change because with the additional compiler warnings, the compiler was complaining that the implicit A: Eq[A] was unused. This is a 2.12/2.13 cross-compatible way to check equality using the Eq[A] instance.

assert(poolName1 == f.futurePoolName)
assert(poolName2 == f.ioPoolName)
assert(poolName2 == f.ioPoolName)
assert(poolName3 == f.futurePoolName)
Copy link
Member Author

Choose a reason for hiding this comment

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

poolName3 was previously unused. I'm not 100% sure if this is the right test, but it passes.

@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2021

Codecov Report

Merging #384 (eb53c40) into master (e5c27b3) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #384      +/-   ##
==========================================
+ Coverage   91.12%   91.21%   +0.08%     
==========================================
  Files          17       18       +1     
  Lines         293      296       +3     
  Branches        1        2       +1     
==========================================
+ Hits          267      270       +3     
  Misses         26       26              
Impacted Files Coverage Δ
...elevel/catbird/benchmark/RerunnableBenchmark.scala 100.00% <ø> (ø)
...ypelevel/catbird/util/effect/FutureInstances.scala 100.00% <ø> (ø)
...ypelevel/catbird/util/effect/RerunnableClock.scala 100.00% <ø> (ø)
...l/catbird/util/effect/RerunnableContextShift.scala 81.81% <ø> (ø)
...evel/catbird/util/effect/RerunnableInstances.scala 100.00% <ø> (ø)
...ypelevel/catbird/util/effect/RerunnableTimer.scala 66.66% <ø> (ø)
.../scala/org/typelevel/catbird/finagle/service.scala 100.00% <ø> (ø)
.../scala/org/typelevel/catbird/util/Rerunnable.scala 90.24% <ø> (ø)
...main/scala/org/typelevel/catbird/util/future.scala 95.34% <ø> (ø)
...org/typelevel/catbird/util/internal/Newtype1.scala 100.00% <ø> (ø)
... and 8 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 e5c27b3...eb53c40. Read the comment docs.

case Throw(err) => k(Left[Throwable, A](err))
}

()
Copy link
Member Author

@bpholt bpholt Oct 6, 2021

Choose a reason for hiding this comment

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

Explicitly return () to indicate that we're ok discarding the Future returned by fa.respond

final override def forceR[A, B](fa: Future[A])(fb: Future[B]): Future[B] =
fa.liftToTry.flatMap { resultA =>
resultA.handle(Monitor.catcher)
resultA.handle[Any](Monitor.catcher)
Copy link
Member Author

Choose a reason for hiding this comment

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

Any was the inferred type, but with sbt-tpolecat, an inferred Any ends up as an error because it is often incorrect.

@bpholt
Copy link
Member Author

bpholt commented Oct 6, 2021

I think we should probably also add a Scala Steward artifact migration and Scalafix rewrite rule to reduce the impact on users.

@felixbr
Copy link
Contributor

felixbr commented Oct 6, 2021

Nice work 👍

edit: I'm waiting for Travis to merge this, mainly because he has the publishing rights and probably needs to handle the gpg stuff.

@felixbr felixbr self-requested a review October 6, 2021 10:12
@felixbr
Copy link
Contributor

felixbr commented Oct 6, 2021

Just one small thing: The CI pipeline currently only runs for 2.12.x and 2.13.x. If it's easy to do, it would be nice to run the effect3 module with 3.0 so regressions there are also caught in PRs.

@bpholt
Copy link
Member Author

bpholt commented Oct 6, 2021

Right now, I'm not sure sbt-github-actions supports builds where the Scala versions vary in different submodules. When I've needed to do that in the past, I've had to remove the plugin and commit manually-maintained GitHub Actions workflow files.

Cite to sbt-github-actions
Any and all settings which affect the behavior of the generative plugin should be set in the ThisBuild scope (for example, ThisBuild / crossScalaVersions := rather than just crossScalaVersions := ). This is important because GitHub Actions workflows are global across the entire build, regardless of how individual projects are configured. A corollary of this is that it is not possible (yet) to have specific subprojects which build with different Scala versions, Java versions, or OSes.

That said, I tried setting it up so that util and effect3 cross-compiled with Scala 3, and ran into issues with the way twitter-util publishes its Scala 3 artifacts:

[error] Modules were resolved with conflicting cross-version suffixes in ProjectRef(uri("file:…/catbird/"), "util"):
[error]    org.scala-lang.modules:scala-collection-compat _3, _2.13
[error] stack trace is suppressed; run last util / update for the full output
[error] (util / update) Conflicting cross-version suffixes in: org.scala-lang.modules:scala-collection-compat
[error] Total time: 1 s, completed Oct 6, 2021 12:11:53 PM

It looks like util-core_3 depends on util-functions_2.13, which is probably wrong? (The util-core build is set up with some customizations for Scala 3 whereas the util-function build is not.)

I also noticed that the kind-projector λ syntax is still in place for some of the sources that would be cross-compiled, which I don't think will work for Scala 3 either, so even if the dependency stuff is resolved, this repo doesn't look like it's quite ready to run Scala 3 builds in CI yet?

Maybe I should commit the Scala 3 attempts I've made so far and push them up in a separate draft PR, that could potentially be incorporated into #371.

@felixbr
Copy link
Contributor

felixbr commented Oct 7, 2021

Ok, that looks like way too much work and if twitter/util is not published correctly for Scala 3, there isn't much we can do here.

Don't worry about it 🙂

@bpholt
Copy link
Member Author

bpholt commented Oct 28, 2021

@travisbrown FYI, just wanted to make sure you saw this PR 🙂

@bpholt
Copy link
Member Author

bpholt commented Nov 17, 2021

In light of Travis moving away from Scala OSS, it seems we need to identify someone to take over the publishing and GPG key management for this project. @felixbr are you the right person for that? My thought is to identify at least one person and then work with Travis for them to take over.

(edit: as I mentioned above, I'm happy to do take the reins too, if folks are comfortable with me being added as a maintainer.)

@bpholt
Copy link
Member Author

bpholt commented Dec 12, 2021

@felixbr friendly bump on my question above 🙂

@felixbr
Copy link
Contributor

felixbr commented Jan 31, 2022

Much like Travis I'm extremely disappointed in the Scala leadership (Odersky but also others) and last year I decided to no longer do any open-source work for Scala unless it's directly needed by my company.

Life is too short to provide free labor for terrible people.

Personally I'd be happy if you would take over this project as a maintainer since you already made some good improvements and it's bad that your contributions are blocked by my decision.
The project is under typelevel now, so a semi-automated release process will hopefully also help to distribute work between more shoulders.

@armanbilge
Copy link
Member

@bpholt I'd be happy to help move the build onto sbt-typelevel.

We still need someone to generate a gpg keypair and update the GitHub Secrets for the repository. (I'm happy to do this, but I would need to be made an admin to do so.)

We're in the process of installing org-wide secrets for these.

@bpholt
Copy link
Member Author

bpholt commented Feb 1, 2022

We're planning to migrate this repo to sbt-typelevel, but it seems cleaner to do so in a separate PR. I'm going to merge this but we'll hold off on releasing anything until that switch has been made.

@bpholt bpholt merged commit d005337 into typelevel:master Feb 1, 2022
@bpholt bpholt deleted the ci-release branch February 1, 2022 23:35
@bpholt bpholt changed the title Use sbt-ci-release Change artifact organization and root package to org.typelevel Jun 1, 2022
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.

Consider updating packaging and coordinates?

4 participants