Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 28 21:28

    joroKr21 on master

    Update sbt-sonatype to 3.9.15 (… (compare)

  • Nov 28 21:28
    joroKr21 closed #1553
  • Nov 28 16:23
    scala-steward opened #1553
  • Nov 24 06:42

    joroKr21 on master

    Update fs2-core to 3.4.0 (#1552) (compare)

  • Nov 24 06:42
    joroKr21 closed #1552
  • Nov 22 16:46
    scala-steward opened #1552
  • Nov 22 11:28
    tpetillot closed #1551
  • Nov 22 11:28
    tpetillot commented #1551
  • Nov 22 11:28
    tpetillot commented #1551
  • Nov 22 11:28
    tpetillot commented #1551
  • Nov 22 11:28
    tpetillot commented #1551
  • Nov 22 10:50
    joroKr21 commented #1551
  • Nov 22 10:11
    tpetillot assigned #1551
  • Nov 22 10:11
    tpetillot opened #1551
  • Nov 21 16:47

    vkostyukov on v0.34.1

    (compare)

  • Nov 21 16:47

    vkostyukov on master

    Setting version to 0.34.1 Setting version to 0.35.0-SNAPS… (compare)

  • Nov 21 16:38

    tpetillot on master

    Release 0.34.1 (compare)

  • Nov 21 16:37

    tpetillot on v0.34.1

    (compare)

  • Nov 21 16:34

    tpetillot on v0.34.1

    (compare)

  • Nov 20 21:43

    joroKr21 on master

    Update sbt-wartremover, wartrem… (compare)

Nicolas Rinaudo
@nrinaudo
is this something that's likely to be fixed, or is finched not being maintained anymore?
Ryan Plessner
@rpless
hey @nrinaudo I've tried this out with a couple of small examples on both the old finch artifacts and the finchx artifacts and can't seem to reproduce. what versions of finch, shapeless, and scala are you using (just want to make sure I'm trying the same things as you)?

is finched not being maintained anymore?

I wouldn't say unmaintained, but definitely less active recently

Nicolas Rinaudo
@nrinaudo
Let me confirm. It's actually caused by a refined dependency, let's see if I can work out the details
so from what I can see, finchx depends on shapeless 2.3.3, and refined on 2.3.6
Nicolas Rinaudo
@nrinaudo
this seems kind of odd, I'd have assumed patch versions of shapeless to be binary compatible..
Nicolas Rinaudo
@nrinaudo

there you go, here's a minimal test case.
build file:

libraryDependencies ++= Seq(
  "com.github.finagle" %% "finchx-circe" % "0.32.1",
  "com.chuusai" %% "shapeless" % "2.3.6"
)

Main file:

import io.finch._
import cats.effect.IO

object Main extends App with Endpoint.Module[IO] {
  val hello: Endpoint[IO, String] = get("hello") { Ok("Hello, World!") }
}
output:
[error] /path/to/project/src/main/scala/Main.scala:5:55: Symbol 'type shapeless.ops.FnToProductInstances.Aux' is missing from the classpath.
[error] This symbol is required by 'value io.finch.internal.Mapper.ftp'.
[error] Make sure that type Aux is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
[error] A full rebuild may help if 'Mapper.class' was compiled against an incompatible version of shapeless.ops.FnToProductInstances.
[error]   val hello: Endpoint[IO, String] = get("hello") { Ok("Hello, World!") }
[error]                                                       ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 0 s, completed 26-May-2021 16:38:12
Ryan Plessner
@rpless
oh thanks @nrinaudo. I can repro that now, I was trying with shapeless 2.3.7 which seems to work. The release notes of 2.3.7 indicate there was an accidental breaking change in 2.3.6 that was reverted in 2.3.7 https://github.com/milessabin/shapeless/releases/tag/v2.3.7. would it be possible for you to use that version?
Nicolas Rinaudo
@nrinaudo
Probably! Thanks for working it out, that’s great
Nicolas Rinaudo
@nrinaudo
Guess I was just unlucky : there's a new version of refined being released as we speak that upgrades to the "good" version of shapeless
Kris
@lambdakris

Hi, I'm new to things like Finch and Cats Effect and trying a few experiments. I tried to adapt the https://github.com/finagle/finch#hello-world example using scala 3 and I am getting an encoder error.

My build.stb looks like

val scala3Version = "3.0.2"

lazy val root = project
  .in(file("."))
  .settings(
    name := "scala3-simple",
    version := "0.1.0",

    scalaVersion := scala3Version,

    libraryDependencies ++= Seq( 
        "com.github.finagle" % "finchx-core_2.13" % "0.32.1",
        "com.github.finagle" % "finchx-circe_2.13" % "0.32.1",
        "io.circe" % "circe-generic_2.13" % "0.14.1"
    )
  )

My Main.scala looks like

import cats.effect.IO
import io.finch._
import com.twitter.finagle.Http
import com.twitter.util.Await

object Main extends App with Endpoint.Module[IO] {
  val api: Endpoint[IO, String] = get("hello") { 
    Ok("hello") 
  }

  Await.ready(Http.server.serve(":8080", api.toServiceAs[Text.Plain]))
}

When I try to sbt run, I get the following error message:

[error] -- Error: C:\Users\Kris.garcia\Code\open\birdir\src\main\scala\Main.scala:11:68
[error] 11 |  Await.ready(Http.server.serve(":8080", api.toServiceAs[Text.Plain]))
[error]    |                                                                    ^
[error]    |An Endpoint you're trying to convert into a Finagle service is missing one or more encoders.
[error]    |
[error]    |  Make sure A is one of the following:
[error]    |
[error]    |  * A com.twitter.finagle.http.Response
[error]    |  * A value of a type with an io.finch.Encode instance (with the corresponding content-type)
[error]    |  * A coproduct made up of some combination of the above
[error]    |
[error]    |  See https://github.com/finagle/finch/blob/master/docs/src/main/tut/cookbook.md#fixing-the-toservice-compile-error
[error]    |.
[error]    |I found:
[error]    |
[error]    |    io.finch.ToResponse.valueToResponse[cats.effect.IO, String,
[error]    |      ("text/plain" : String)
[error]    |    ](cats.effect.IO.ioEffect, io.finch.Encode.encodeStringAsTextPlain,
[error]    |      shapeless.Witness.apply[T]
[error]    |    )
[error]    |
[error]    |But method apply in object Witness does not match type shapeless.Witness.Aux[("text/plain" : String)].
[error]    |
[error]    |One of the following imports might make progress towards fixing the problem:
[error]    |
[error]    |  import shapeless.~?>.idKeyWitness
[error]    |  import shapeless.~?>.idValueWitness
[error]    |  import shapeless.~?>.witness
[error]    |
[error] one error found
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 9 s, completed Sep 11, 2021, 4:39:25 PM

Now, I did try adding the different shapeless imports as suggested, but unfortunately the error itself was not resolved.

Could anybody offer some insight or suggestions?

Sergey Kolbasov
@sergeykolbasov
shapeless literal types (witness) don't play well with Scala 3, sadly
Kris
@lambdakris
OOoohh, that makes sense, thanks @sergeykolbasov!
Jack Treble
@JackTreble
Hey :wave: I'm looking to upgrade to scala 2.13, when updating finch-core to 0.32.1 it seems its not available in maven, is it possible to get this resolved? unless I'm misunderstanding the release notes?
Sergey Kolbasov
@sergeykolbasov
I'm not sure we've released the old finch, only finchx (Endpoint[F])
1 reply
Jack Treble
@JackTreble
Ah i see, From reading the release notes i thought that this was the last version that would support twitter futures, https://github.com/finagle/finch/releases/tag/v0.32.1
This release is expected to be the last one for finchx prefixed artifacts. Starting from the next update we're going to decommission the Future-based finch artifacts and replace it with polymorphic one.
when did future based finch stop being released? https://github.com/finagle/finch/releases/tag/v0.31.0 dosent suggest it would be the last
Dermot Haughey
@hderms
Is there any way to compose two endpoints A, B such that if A returns an Error, B is never run? Right now it seems like :: will run both endpoints no matter what the result of the first one is. Basically I'm looking for an operator like :: but which fails fast
it seems like here: https://github.com/finagle/finch/blob/117129bb2c7089250cb227842e5c05cf579e3ec7/core/src/main/scala/io/finch/Endpoint.scala#L235 if the first endpoint is matched then we run the second one, regardless of whether the first one returned an error
Dermot Haughey
@hderms
am I right in considering this potentially a bug or is there some reason the semantics should be such that we run both endpoints sequentially but ignore the error from the first endpoint from the perspective of failing fast. However, I can confirm the Output resulting from the error in A is returned, as expected
this: https://github.com/finagle/finch/blob/117129bb2c7089250cb227842e5c05cf579e3ec7/core/src/main/scala/io/finch/Endpoint.scala#L203-L205 seems to imply that it's a conscious choice to power the error accumulation but perhaps there's reason to suspect, given what I've said, that we should also have another combinator which does not run the second endpoint
looks like it's an outstanding issue: finagle/finch#978
Nicolas Rinaudo
@nrinaudo

I'm in the process of trying to upgrade some finch-based services to Scala 2.13.8, and am encountering some weird weird issues.

In order to debug, I tried to take one of the finch examples (the div endpoint) and compile it with 2.13.8, which fails. I then downgrading to 2.13.6, which was the version I was using previously, and that failed too.

Kind of at a loss here. Here's my buildfile:

libraryDependencies ++= Seq(
  "com.github.finagle" %% "finchx-circe" % "0.32.1"
)

libraryDependencies ++= Seq(
  "io.circe" %% "circe-generic" % "0.13.0",
  "com.twitter" %% "finagle-stats" % "20.9.0",
  "com.twitter" %% "twitter-server" % "20.9.0"
)

scalaVersion := "2.13.6"

I simply copy and pasted the code:

import cats.effect.IO
import com.twitter.finagle.Http
import com.twitter.util.Await
import io.finch._

/**
  * A tiny Finch application that serves a single endpoint `POST /:a/b:` that divides `a` by `b`.
  *
  * Use the following sbt command to run the application.
  *
  * {{{
  *   $ sbt 'examples/runMain io.finch.div.Main'
  * }}}
  *
  * Use the following HTTPie commands to test endpoints.
  *
  * {{{
  *   $ http POST :8081/20/10
  *   $ http POST :8081/10/0
  * }}}
  */
object Main extends App with Endpoint.Module[IO] {

  // We can serve Ints as plain/text responses since there is cats.Show[Int]
  // available via the cats.instances.int._ import.
  def div: Endpoint[IO, Int] = post(path[Int] :: path[Int]) { (a: Int, b: Int) =>
    Ok(a / b)
  } handle { case e: ArithmeticException =>
    BadRequest(e)
  }

  Await.ready(Http.server.serve(":8081", div.toServiceAs[Text.Plain]))
}

And am getting the following error:

[error] /path/to/tests/finch/src/main/scala/Main.scala:32:57: An Endpoint you're trying to convert into a Finagle service is missing one or more encoders.
[error] 
[error]   Make sure Int is one of the following:
[error] 
[error]   * A com.twitter.finagle.http.Response
[error]   * A value of a type with an io.finch.Encode instance (with the corresponding content-type)
[error]   * A coproduct made up of some combination of the above
[error] 
[error]   See https://github.com/finagle/finch/blob/master/docs/src/main/tut/cookbook.md#fixing-the-toservice-compile-error
[error]   Await.ready(Http.server.serve(":8081", div.toServiceAs[Text.Plain]))
[error]                                                         ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 3 s, completed 16-Feb-2022 15:12:32
Am I doing anything obviously bad?
Nicolas Rinaudo
@nrinaudo
Yes, I am. I was missing an explicit dependency on cats. This now compiles with 2.13.8
sorry for the noise, I'll go back to working out on my initial problem :)
Nicolas Rinaudo
@nrinaudo
For the record, my problem was that I thought I was upgrading to 2.13.8 but mistakenly set 2.13.7, which is all kinds of messed up
1 reply
Bo Sun
@hellsun24
hey guys, I am getting this error while sending a 5MB payload to fingle server: Request Entity Too Large with code 413. how should I fix this ?
Ryan Plessner
@rpless
I think this was answered in the finagle chat, but I'll also answer here. finagle has a max request size of 5 MB by default, you probably want to increase that with Http.withMaxRequestSize
tpetillot
@tpetillot
@joroKr21 are you available here? So that we can discuss the takeover of the updates.
Georgi Krastev
@joroKr21
Yeah I'm here. But in general my availability is very spotty :smile:
Georgi Krastev
@joroKr21
@tpetillot WDYT on auto-merging scala-steward PRs? I'm a big fan of automation :smile:
tpetillot
@tpetillot
Sure! Maybe after this first update pass?
Georgi Krastev
@joroKr21
Yes :thumbsup:
tpetillot
@tpetillot
I merged finagle/finch#1451, but we can still discuss about your point on next major bumps.
Vladimir Kostyukov
@vkostyukov
Maybe we should talk here about the broken release. I think what's left is to figure out why gpg can't see the key.
Nicolas Rinaudo
@nrinaudo
Is there any plan for a release of 0.34.0? I'm running into bincompat issues that seem very related to twitter/util@3685d72, and I'd like to know if I should deploy a local fix while you polish things off or if it makes sense for us to wait a bit
Just to remove any possible ambiguity, my message is not meant to rush you or pressure you in any way. If you already plan on releasing it soon, great! If not, I'm happy to wait with local workarounds
Georgi Krastev
@joroKr21
I think the next release will be pretty big because we already merged CE3 migration
There's still some PRs pending review that need to go in
What is the compatibility issue that you're facing?
Nicolas Rinaudo
@nrinaudo
today is a little bit complicated for me but I'll detail later, but the general idea is that I'm getting bincomp issues with some metrics related classes (abstract in the lib, concrete in the JAR)
it's some sort of unhealthy interaction between - I'm not sure. I have it down to finch, finagle-prometheus and finagle at the moment. Solving it is done by hardwiring a more recent version of finagle-metrics in my dependencies, which finch already does in master but not in the latest release
Georgi Krastev
@joroKr21
Finch doesn't use finagle-metrics. Therefore you should be able to explicitly specify the newer Finagle version in your dependencies. I think that's a reasonable solution.
Nicolas Rinaudo
@nrinaudo
That is our current solution, yes
It’s perfectly reasonable
Alex Khvatov
@khvatov
maybe a silly question, but is there a way to consume REST API using finangle/finch? I need to pass thorugh (proxy) REST API calls to another service.
Mayank Gupta
@MayankG82797144_twitter
Hi, i would like to implement finch endpoint returning protobuf message. Any example would help