Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 08 2020 13:09

    vlovgr on ce3

    WIP (compare)

  • Dec 08 2020 12:40

    vlovgr on gh-pages

    Deploy website Deploy website … (compare)

  • Dec 08 2020 12:40

    vlovgr on ce3

    Update sbt-mdoc to 2.2.13 Merge pull request #410 from sc… Update cats-effect, cats-effect… and 10 more (compare)

  • Dec 08 2020 12:37

    vlovgr on master

    Update kind-projector to 0.11.2 Change to use kind-projector * … Merge pull request #412 from sc… (compare)

  • Dec 08 2020 12:37
    vlovgr closed #412
  • Dec 08 2020 12:36
    codecov[bot] commented #412
  • Dec 08 2020 12:35

    vlovgr on gh-pages

    Deploy website Deploy website … (compare)

  • Dec 08 2020 12:32
    vlovgr synchronize #412
  • Dec 08 2020 12:31

    vlovgr on master

    Update cats-effect, cats-effect… Merge pull request #411 from sc… (compare)

  • Dec 08 2020 12:31
    vlovgr closed #411
  • Dec 04 2020 19:34

    vlovgr on gh-pages

    Deploy website Deploy website … (compare)

  • Dec 04 2020 19:29

    mergify[bot] on master

    Update sbt-ci-release to 1.5.5 Merge pull request #414 from sc… (compare)

  • Dec 04 2020 19:29
    mergify[bot] closed #414
  • Dec 04 2020 19:29
    codecov[bot] commented #414
  • Dec 04 2020 19:24
    scala-steward opened #414
  • Dec 02 2020 14:10

    vlovgr on gh-pages

    Deploy website Deploy website … (compare)

  • Dec 02 2020 14:05

    mergify[bot] on master

    Update refined to 0.9.19 Merge pull request #413 from sc… (compare)

  • Dec 02 2020 14:05
    mergify[bot] closed #413
  • Dec 02 2020 14:05
    codecov[bot] commented #413
  • Dec 02 2020 13:57
    scala-steward opened #413
Jente Hidskes
@Hjdskes

I've written one for the latter case:

  implicit def circeConfigDecoder[A: Decoder]: ConfigDecoder[String, A] =
    ConfigDecoder[String].mapEither {
      (_, s) => decode[A](s).leftMap {
          case ParsingFailure(message, _) => ConfigError(message)
          case DecodingFailure(message, _) => ConfigError(message)
      }
    }

This requires the circe-parser module from circe.

Viktor Lövgren
@vlovgr
@Hjdskes I'd happily accept a pull request for a ciris-circe module. :)
Jente Hidskes
@Hjdskes
@vlovgr I'll see what I can do in the time that I have :)
Viktor Lövgren
@vlovgr
@Hjdskes forgot to mention circe support was added in v1.1.1 (https://github.com/vlovgr/ciris/releases/tag/v1.1.1) in case you missed it.
Jente Hidskes
@Hjdskes
I hadn't checked yet, but that's cool! Thanks for notifying me :)
Keir Lawson
@keirlawson
Would it make sense to add a convenience method to ConfigValue[Secret[A]]to turn it in to a ConfigValue[A], ie the inverse of .secret? Obviously it is fairly simple to do .map(_.value) so perhaps not worth it? It would be useful in the case that you have values stored in some sort of secrets vault that would by default return them wrapped in Secret
Viktor Lövgren
@vlovgr
@keirlawson don't think it's worth it since, as you're saying, it's just .map(_.value)
Is that something internal which returns ConfigValue[Secret[A]] by default?
I think the third-party libraries are all unassuming and return ConfigValue[A].
Keir Lawson
@keirlawson
Yea, I made a ciris-aws-secretsmanager (to be open sourced soon!) that returns ConfigValue[Secret[String]] as it felt like that's what you would want in most cases...
Viktor Lövgren
@vlovgr
@keirlawson Nice. Is it much different from https://github.com/ovotech/ciris-aws-ssm ?
Keir Lawson
@keirlawson
nope, its a fork and then a very minor reworking :D
Jente Hidskes
@Hjdskes
Hey folks, quick question: if I'm fetching multiple parameters from SSM with ciris-aws-ssm, should I reuse the Param I get from Blocker[F].flatMap(params[F]) as much as possible, or is it fine to split credential fetching over multiple functions each of which calls Blocker[F].flatMap(params[F])?
Viktor Lövgren
@vlovgr
@Hjdskes You can reuse it. It's basically shown in the readme: https://github.com/ovotech/ciris-aws-ssm
Jente Hidskes
@Hjdskes
@vlovgr I know I can, I was wondering if I should :)
Viktor Lövgren
@vlovgr
@Hjdskes Yes, you should. It means you reuse the aws client and don't create+close a new client for every param.
Jente Hidskes
@Hjdskes
Cool, thanks @vlovgr !
Jakub Kozłowski
@kubukoz
Hi @vlovgr, have you investigated providing an Async[ConfigValue] instance? I was wondering if I could use a method like def foo[F[_]: Async] to write a custom config source.
Stack safety of flatMap might be an issue...
hmm, there is FlatMap[ConfigValue] already
I guess final def eval[F[_], A](value: F[ConfigValue[A]])(implicit F: Effect[F]): ConfigValue[A] might be my workaround.
Jakub Kozłowski
@kubukoz
btw. is there no generic derivation in ciris at the moment?
Viktor Lövgren
@vlovgr
@kubukoz Yes, flatMap cannot be expressed in a stack-safe manner, and also pure would not be what you expect, as discussed here: https://gitter.im/vlovgr/ciris?at=5dc6643b5eb2e813dbf0f3b0
There is no generic derivation, partly because there is no 'one way' to generically read a configuration.
There's also ConfigValue.async if you really need something like Async[ConfigValue].
Jakub Kozłowski
@kubukoz
For derivation, I had "one way" when you have ConfigValue instances for all the fields - but I get that it might be specific to my usecase... Maybe a module with optional derivations would be good to have, so that people don't need to reinvent the wheel if they want that?
Viktor Lövgren
@vlovgr
I'm not sure it's worth having that to just eliminate some (a, b, c, ...).parMapN(apply). Or is there something I'm missing?
I guess you also run into problems if you have two or more of the same type in your product, but want to read them differently.
Jakub Kozłowski
@kubukoz
it was that parMapN, yeah
two of the same type shouldn't be a problem for me, so I guess it's just one of the patterns
at the root type there will always be distinct types, but I see why it might not be true in the nested ones
have there been any attempts to integrate with cats-effect 3 milestones yet, @vlovgr ?
Viktor Lövgren
@vlovgr
@kubukoz yes, you can preview at https://github.com/vlovgr/ciris/compare/ce3
Biggest change with that proposal is ConfigValue[+F[_], A], similar to fs2's Stream.
Jakub Kozłowski
@kubukoz
Basically going tagless instead of free?
(didn't click yet, just judging by what the type param can get us)
Viktor Lövgren
@vlovgr
It's basically because eval/evalMap can't be expressed nicely otherwise.
Viktor Lövgren
@vlovgr
Pull request for cats-effect 3 and scala 3 is up: vlovgr/ciris#416
Viktor Lövgren
@vlovgr
Gary Aghedo
@GaryAghedo
Hey Guys, How do you would a config file from ''src/main/resources/abc.conf'' with Ciris?
Does Ciris work with typesafe config?
Viktor Lövgren
@vlovgr
@GaryAghedo you're probably looking for https://github.com/2m/ciris-hocon.

Let me know if it doesn't exist and is useful and you'd like such a PR

I prefer to use env usually but had to switch a project to files because of security considerations, this little bit came out of that

Viktor Lövgren
@vlovgr
@dimitarg it's not supported yet, so would definitely welcome a pull request
Dimitar Georgiev
@dimitarg
Cheers. I'm sort of in-between jobs, I think I'd get to it next week
Do you see this as something in core, or a separate module ?
Viktor Lövgren
@vlovgr
It can definitely be in core.