Skip to content

Commit

Permalink
Merge branch 'main' into update/series/0.6.x/twiddles-core-0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilquist authored Nov 1, 2023
2 parents dd69a3e + 99f85d1 commit 01eb69b
Show file tree
Hide file tree
Showing 90 changed files with 888 additions and 726 deletions.
59 changes: 2 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12, 2.13, 3]
scala: [2.13, 3]
java: [temurin@11]
project: [skunkJS, skunkJVM, skunkNative]
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -137,36 +137,6 @@ jobs:
export SERVER_CERT=$(cat world/server.crt)
docker-compose up -d
- name: Download target directories (2.12, skunkJS)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-skunkJS

- name: Inflate target directories (2.12, skunkJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12, skunkJVM)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-skunkJVM

- name: Inflate target directories (2.12, skunkJVM)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12, skunkNative)
uses: actions/download-artifact@v3
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-skunkNative

- name: Inflate target directories (2.12, skunkNative)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13, skunkJS)
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -287,34 +257,9 @@ jobs:
- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2
with:
modules-ignore: skunk_2.12 skunk_2.13 skunk_3 docs_2.12 docs_2.13 docs_3 skunk_2.12 skunk_2.13 skunk_3 skunk_2.12 skunk_2.13 skunk_3 tests_sjs1_2.12 tests_sjs1_2.13 tests_sjs1_3 tests_2.12 tests_2.13 tests_3 example_2.12 example_2.13 example_3 tests_native0.4_2.12 tests_native0.4_2.13 tests_native0.4_3
modules-ignore: skunk_2.13 skunk_3 docs_2.13 docs_3 skunk_2.13 skunk_3 skunk_2.13 skunk_3 tests_sjs1_2.13 tests_sjs1_3 tests_2.13 tests_3 example_2.13 example_3 tests_native0.4_2.13 tests_native0.4_3
configs-ignore: test scala-tool scala-doc-tool test-internal

validate-steward:
name: Validate Steward Config
strategy:
matrix:
os: [ubuntu-latest]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (fast)
uses: actions/checkout@v4

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11

- uses: coursier/setup-action@v1
with:
apps: scala-steward

- run: scala-steward validate-repo-config .scala-steward.conf

site:
name: Generate Site
strategy:
Expand Down
3 changes: 0 additions & 3 deletions .scala-steward.conf

This file was deleted.

2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ To run a specific test:
> sbt
> test:testOnly tests.simulation.StartupSimTest
```

To view spans emitted during test execution, open a browser to http://localhost:16686 and search traces by `Service = SkunkTests`. Alterntively, use http://localhost:16686/search?limit=100&lookback=15m&service=SkunkTests.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[![Discord](https://img.shields.io/discord/632277896739946517.svg?label=&logo=discord&logoColor=ffffff&color=404244&labelColor=6A7EC2)](https://discord.gg/CSh8u9yPMe)
[![Join the chat at https://gitter.im/skunk-pg/Lobby](https://badges.gitter.im/skunk-pg/Lobby.svg)](https://gitter.im/skunk-pg/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![codecov](https://codecov.io/gh/tpolecat/skunk/branch/master/graph/badge.svg)](https://codecov.io/gh/tpolecat/skunk)
[![Maven Central](https://img.shields.io/maven-central/v/org.tpolecat/skunk-core_2.12.svg)](https://maven-badges.herokuapp.com/maven-central/org.tpolecat/skunk-core_2.12)
[![Javadocs](https://javadoc.io/badge/org.tpolecat/skunk-core_2.12.svg)](https://javadoc.io/doc/org.tpolecat/skunk-core_2.12)
[![Maven Central](https://img.shields.io/maven-central/v/org.tpolecat/skunk-core_2.13.svg)](https://maven-badges.herokuapp.com/maven-central/org.tpolecat/skunk-core_2.13)
[![Javadocs](https://javadoc.io/badge/org.tpolecat/skunk-core_2.13.svg)](https://javadoc.io/doc/org.tpolecat/skunk-core_2.13)

Skunk is a data access library for Scala + Postgres.

Expand Down
46 changes: 29 additions & 17 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
ThisBuild / tlBaseVersion := "0.6"
ThisBuild / tlBaseVersion := "1.0"

// Our Scala versions.
lazy val `scala-2.12` = "2.12.18"
lazy val `scala-2.13` = "2.13.12"
lazy val `scala-3.0` = "3.3.1"
lazy val `scala-3` = "3.3.1"

ThisBuild / scalaVersion := `scala-2.13`
ThisBuild / crossScalaVersions :=
Seq(`scala-2.12`, `scala-2.13`, `scala-3.0`)
ThisBuild / crossScalaVersions := Seq(`scala-2.13`, `scala-3`)

ThisBuild / organization := "org.tpolecat"
ThisBuild / licenses := Seq(License.MIT)
Expand Down Expand Up @@ -60,7 +58,9 @@ ThisBuild / mimaBinaryIssueFilters ++= List(

// This is used in a couple places
lazy val fs2Version = "3.9.2"
lazy val natchezVersion = "0.3.3"
lazy val openTelemetryVersion = "1.29.0"
lazy val otel4sVersion = "0.3.0-RC2"
lazy val refinedVersion = "0.11.0"

// Global Settings
lazy val commonSettings = Seq(
Expand Down Expand Up @@ -89,7 +89,7 @@ lazy val commonSettings = Seq(
),

// Coverage Exclusions
coverageExcludedPackages := "ffstest.*;tests.*;example.*;natchez.http4s.*",
coverageExcludedPackages := "ffstest.*;tests.*;example.*",

// uncomment in case of emergency
// scalacOptions ++= { if (scalaVersion.value.startsWith("3.")) Seq("-source:3.0-migration") else Nil },
Expand All @@ -116,9 +116,8 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
"org.scodec" %%% "scodec-bits" % "1.1.38",
"org.scodec" %%% "scodec-core" % (if (tlIsScala3.value) "2.2.2" else "1.11.10"),
"org.scodec" %%% "scodec-cats" % "1.2.0",
"org.tpolecat" %%% "natchez-core" % natchezVersion,
"org.typelevel" %%% "otel4s-core-trace" % otel4sVersion,
"org.tpolecat" %%% "sourcepos" % "1.1.0",
"org.scala-lang.modules" %%% "scala-collection-compat" % "2.11.0",
"org.typelevel" %%% "twiddles-core" % "0.7.0",
) ++ Seq(
"com.beachape" %%% "enumeratum" % "1.7.3",
Expand All @@ -142,7 +141,7 @@ lazy val refined = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.settings(
name := "skunk-refined",
libraryDependencies ++= Seq(
"eu.timepit" %%% "refined" % "0.10.3",
"eu.timepit" %%% "refined" % refinedVersion,
)
)

Expand All @@ -163,7 +162,7 @@ lazy val circe = crossProject(JVMPlatform, JSPlatform, NativePlatform)
lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.crossType(CrossType.Full)
.in(file("modules/tests"))
.dependsOn(core, circe)
.dependsOn(core, circe, refined)
.enablePlugins(AutomateHeaderPlugin, NoPublishPlugin)
.settings(commonSettings)
.settings(
Expand All @@ -178,6 +177,7 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
"org.typelevel" %%% "cats-effect-testkit" % "3.5.2",
"org.typelevel" %%% "discipline-munit" % "2.0.0-M3",
"org.typelevel" %%% "cats-time" % "0.5.1",
"eu.timepit" %%% "refined-cats" % refinedVersion,
),
testFrameworks += new TestFramework("munit.Framework"),
testOptions += {
Expand All @@ -186,6 +186,18 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
} else Tests.Argument()
}
)
.jvmSettings(
libraryDependencies ++= Seq(
"org.typelevel" %% "otel4s-java" % otel4sVersion,
"io.opentelemetry" % "opentelemetry-exporter-otlp" % openTelemetryVersion % Runtime,
"io.opentelemetry" % "opentelemetry-sdk-extension-autoconfigure" % openTelemetryVersion % Runtime
),
Test / fork := true,
javaOptions ++= Seq(
"-Dotel.java.global-autoconfigure.enabled=true",
"-Dotel.service.name=SkunkTests",
)
)
.jsSettings(
scalaJSLinkerConfig ~= { _.withESFeatures(_.withESVersion(org.scalajs.linker.interface.ESVersion.ES2018)) },
Test / scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)),
Expand All @@ -204,9 +216,12 @@ lazy val example = project
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(
"org.tpolecat" %%% "natchez-honeycomb" % natchezVersion,
"org.tpolecat" %%% "natchez-jaeger" % natchezVersion,
)
"org.typelevel" %% "otel4s-java" % otel4sVersion,
"io.opentelemetry" % "opentelemetry-exporter-otlp" % openTelemetryVersion % Runtime,
"io.opentelemetry" % "opentelemetry-sdk-extension-autoconfigure" % openTelemetryVersion % Runtime,
),
run / fork := true,
javaOptions += "-Dotel.java.global-autoconfigure.enabled=true"
// ) ++ Seq(
// "org.http4s" %%% "http4s-dsl" % "0.21.22",
// "org.http4s" %%% "http4s-blaze-server" % "0.21.22",
Expand Down Expand Up @@ -239,9 +254,6 @@ lazy val docs = project
},
mdocIn := (Compile / sourceDirectory).value / "laika",
tlSiteIsTypelevelProject := Some(TypelevelProject.Affiliate),
libraryDependencies ++= Seq(
"org.tpolecat" %%% "natchez-jaeger" % natchezVersion,
),
laikaConfig := {
import laika.config._

Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ services:

# Jaeger, for tracing
jaeger:
image: jaegertracing/all-in-one:1.8
image: jaegertracing/all-in-one:1.35
ports:
- 5775:5775/udp
- 6831:6831/udp
- 6832:6832/udp
- 5778:5778
- 16686:16686
- 14268:14268
- 9411:9411
- 4317:4317
- 4318:4318
environment:
COLLECTOR_ZIPKIN_HTTP_PORT: 9411
COLLECTOR_OTLP_ENABLED: "true"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package skunk.net.protocol

import cats.MonadThrow
import cats.syntax.all._
import natchez.Trace
import org.typelevel.otel4s.trace.Tracer
import skunk.net.MessageSocket
import skunk.net.message._
import skunk.exception.{
Expand All @@ -16,12 +16,12 @@ import skunk.exception.{

private[protocol] trait StartupCompanionPlatform { this: Startup.type =>

private[protocol] def authenticationSASL[F[_]: MonadThrow: MessageSocket: Trace](
private[protocol] def authenticationSASL[F[_]: MonadThrow: MessageSocket: Tracer](
sm: StartupMessage,
password: Option[String],
mechanisms: List[String]
): F[Unit] =
Trace[F].span("authenticationSASL") {
Tracer[F].span("authenticationSASL").surround {
if (mechanisms.contains(Scram.SaslMechanism)) {
for {
pw <- requirePassword[F](sm, password)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.ongres.scram.common.stringprep.StringPreparations

import cats.MonadError
import cats.syntax.all._
import natchez.Trace
import org.typelevel.otel4s.trace.Tracer
import scala.util.control.NonFatal
import skunk.net.MessageSocket
import skunk.net.message._
Expand All @@ -20,14 +20,14 @@ import skunk.exception.{

private[protocol] trait StartupCompanionPlatform { this: Startup.type =>

private[protocol] def authenticationSASL[F[_]: MessageSocket: Trace](
private[protocol] def authenticationSASL[F[_]: MessageSocket: Tracer](
sm: StartupMessage,
password: Option[String],
mechanisms: List[String]
)(
implicit ev: MonadError[F, Throwable]
): F[Unit] =
Trace[F].span("authenticationSASL") {
Tracer[F].span("authenticationSASL").surround {
for {
client <- {
try ScramClient.
Expand Down
22 changes: 0 additions & 22 deletions modules/core/shared/src/main/scala-2.12/data/ArrPlatform.scala

This file was deleted.

15 changes: 0 additions & 15 deletions modules/core/shared/src/main/scala-2.12/utll/package.scala

This file was deleted.

22 changes: 0 additions & 22 deletions modules/core/shared/src/main/scala-2.13+/data/ArrPlatform.scala

This file was deleted.

13 changes: 0 additions & 13 deletions modules/core/shared/src/main/scala-2.13/utll/package.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package codec
import enumeratum.{ Enum, EnumEntry }
import skunk.data.Type

trait EnumCodecPlatform {
private[codec] trait EnumCodecCompat {

def `enum`[A <: EnumEntry](`enum`: Enum[A], tpe: Type): Codec[A] =
Codec.simple[A](
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
package skunk
package codec

trait EnumCodecPlatform
private[codec] trait EnumCodecCompat
Loading

0 comments on commit 01eb69b

Please sign in to comment.