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

Update to Cats Effect 3.4.0 #642

Merged
merged 4 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ jobs:

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/series/0.1')
run: mkdir -p modules/mtl/native/target modules/lightstep-grpc/target modules/log/jvm/target modules/noop/jvm/target modules/mock/target modules/examples/target target modules/log/native/target .js/target modules/core/native/target modules/docs/target modules/lightstep-http/target modules/datadog/target modules/xray/jvm/target modules/opentracing/target modules/noop/native/target modules/xray/js/target modules/core/js/target modules/noop/js/target modules/core/jvm/target .jvm/target modules/jaeger/target .native/target modules/opencensus/target modules/honeycomb/target modules/log/js/target modules/mtl/js/target modules/newrelic/target modules/log-odin/target modules/mtl/jvm/target modules/opentelemetry/target modules/lightstep/target project/target
run: mkdir -p modules/mtl/native/target modules/lightstep-grpc/target modules/log/jvm/target modules/noop/jvm/target modules/mock/target modules/examples/target target modules/log/native/target .js/target modules/core/native/target modules/docs/target modules/lightstep-http/target modules/datadog/target modules/xray/.jvm/target modules/opentracing/target modules/noop/native/target modules/xray/.js/target modules/core/js/target modules/noop/js/target modules/core/jvm/target .jvm/target modules/jaeger/target .native/target modules/opencensus/target modules/honeycomb/target modules/log/js/target modules/mtl/js/target modules/newrelic/target modules/log-odin/target modules/mtl/jvm/target modules/opentelemetry/target modules/lightstep/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/series/0.1')
run: tar cf targets.tar modules/mtl/native/target modules/lightstep-grpc/target modules/log/jvm/target modules/noop/jvm/target modules/mock/target modules/examples/target target modules/log/native/target .js/target modules/core/native/target modules/docs/target modules/lightstep-http/target modules/datadog/target modules/xray/jvm/target modules/opentracing/target modules/noop/native/target modules/xray/js/target modules/core/js/target modules/noop/js/target modules/core/jvm/target .jvm/target modules/jaeger/target .native/target modules/opencensus/target modules/honeycomb/target modules/log/js/target modules/mtl/js/target modules/newrelic/target modules/log-odin/target modules/mtl/jvm/target modules/opentelemetry/target modules/lightstep/target project/target
run: tar cf targets.tar modules/mtl/native/target modules/lightstep-grpc/target modules/log/jvm/target modules/noop/jvm/target modules/mock/target modules/examples/target target modules/log/native/target .js/target modules/core/native/target modules/docs/target modules/lightstep-http/target modules/datadog/target modules/xray/.jvm/target modules/opentracing/target modules/noop/native/target modules/xray/.js/target modules/core/js/target modules/noop/js/target modules/core/jvm/target .jvm/target modules/jaeger/target .native/target modules/opencensus/target modules/honeycomb/target modules/log/js/target modules/mtl/js/target modules/newrelic/target modules/log-odin/target modules/mtl/jvm/target modules/opentelemetry/target modules/lightstep/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/series/0.1')
Expand Down
16 changes: 14 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.typesafe.tools.mima.core._

ThisBuild / tlBaseVersion := "0.1"

val scala212Version = "2.12.17"
Expand All @@ -6,8 +8,8 @@ val scala30Version = "3.2.0"

val collectionCompatVersion = "2.8.1"

val catsVersion = "2.8.0"
val catsEffectVersion = "3.3.14"
val catsVersion = "2.9.0"
val catsEffectVersion = "3.4.0"

// Publishing

Expand Down Expand Up @@ -290,6 +292,7 @@ lazy val noop = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.nativeSettings(commonNativeSettings)

lazy val xray = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("modules/xray"))
.dependsOn(core)
.enablePlugins(AutomateHeaderPlugin)
Expand All @@ -307,6 +310,15 @@ lazy val xray = crossProject(JSPlatform, JVMPlatform)
.jsSettings(
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)),
)
.settings(
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[DirectMissingMethodProblem]("natchez.xray.XRayEnvironment.env"),
ProblemFilters.exclude[MissingTypesProblem]("natchez.xray.XRayEnvironment$"),
ProblemFilters.exclude[MissingClassProblem]("natchez.xray.XRayEnvironmentCompanionPlatform"),
ProblemFilters.exclude[MissingClassProblem]("natchez.xray.process"),
ProblemFilters.exclude[MissingClassProblem]("natchez.xray.process$"),
)
)

lazy val mock = project
.in(file("modules/mock"))
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

package natchez.xray

import cats._
import cats.data._
import cats.effect._
import cats.effect.std.Env
import com.comcast.ip4s.{IpAddress, SocketAddress}
import natchez.Kernel

Expand All @@ -15,18 +17,21 @@ trait XRayEnvironment[F[_]] {
def kernelFromEnvironment: F[Kernel]
}

object XRayEnvironment extends XRayEnvironmentCompanionPlatform {
object XRayEnvironment {
def apply[F[_]: XRayEnvironment]: XRayEnvironment[F] = implicitly

implicit def instance[F[_]: Sync]: XRayEnvironment[F] =
@deprecated("Use overload with `Env` constraint", "0.1.5")
def instance[F[_]](F: Sync[F]): XRayEnvironment[F] = instance(F, Env.make(F))

implicit def instance[F[_]: Functor: Env]: XRayEnvironment[F] =
new XRayEnvironment[F] {
override def daemonAddress: F[Option[SocketAddress[IpAddress]]] =
OptionT(Sync[F].delay(env.get("AWS_XRAY_DAEMON_ADDRESS")))
OptionT(Env[F].get("AWS_XRAY_DAEMON_ADDRESS"))
.subflatMap(SocketAddress.fromStringIp)
.value

override def traceId: F[Option[String]] =
Sync[F].delay(env.get("_X_AMZN_TRACE_ID"))
Env[F].get("_X_AMZN_TRACE_ID")

override def kernelFromEnvironment: F[Kernel] =
OptionT(traceId)
Expand Down