From 0f7e1b031d32f4b04597db701fba2709b6228b9f Mon Sep 17 00:00:00 2001 From: albin-kv <152964006+albin-kv@users.noreply.github.com> Date: Tue, 23 Apr 2024 15:58:35 +0530 Subject: [PATCH 1/6] Natchez build (#1) --- .github/workflows/ci.yml | 12 +- .mergify.yml | 152 ---------------- build.sbt | 364 +++------------------------------------ project/plugins.sbt | 2 - 4 files changed, 24 insertions(+), 506 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54630e86..3d04b432 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,11 +80,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/testkit/native/target modules/log/native/target modules/testkit/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 modules/jaeger/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/testkit/jvm/target modules/opentelemetry/target modules/lightstep/target project/target + run: mkdir -p 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/testkit/native/target modules/log/native/target modules/testkit/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 modules/jaeger/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/testkit/jvm/target modules/opentelemetry/target modules/lightstep/target project/target + run: tar cf targets.tar 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') @@ -229,11 +229,7 @@ jobs: (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) - name: Publish - env: - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} - run: sbt tlCiRelease + run: sbt + publish dependency-submission: name: Submit Dependencies @@ -265,7 +261,7 @@ jobs: - name: Submit Dependencies uses: scalacenter/sbt-dependency-submission@v2 with: - modules-ignore: natchez-examples_2.12 natchez-examples_2.13 natchez-examples_3 rootjs_2.12 rootjs_2.13 rootjs_3 coretests_sjs1_2.12 coretests_sjs1_2.13 coretests_sjs1_3 coretests_2.12 coretests_2.13 coretests_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 coretests_native0.4_2.12 coretests_native0.4_2.13 coretests_native0.4_3 + modules-ignore: rootjs_3 natchez-core_native0.4_3 natchez-xray_3 natchez-core_sjs1_3 natchez-core_3 rootjvm_3 rootnative_3 configs-ignore: test scala-tool scala-doc-tool test-internal docs: diff --git a/.mergify.yml b/.mergify.yml index 9101522e..fc8d43bf 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -29,158 +29,6 @@ pull_request_rules: add: - core remove: [] -- name: Label core-tests PRs - conditions: - - files~=^modules/core-tests/ - actions: - label: - add: - - core-tests - remove: [] -- name: Label datadog PRs - conditions: - - files~=^modules/datadog/ - actions: - label: - add: - - datadog - remove: [] -- name: Label docs PRs - conditions: - - files~=^modules/docs/ - actions: - label: - add: - - docs - remove: [] -- name: Label examples PRs - conditions: - - files~=^modules/examples/ - actions: - label: - add: - - examples - remove: [] -- name: Label honeycomb PRs - conditions: - - files~=^modules/honeycomb/ - actions: - label: - add: - - honeycomb - remove: [] -- name: Label jaeger PRs - conditions: - - files~=^modules/jaeger/ - actions: - label: - add: - - jaeger - remove: [] -- name: Label lightstep PRs - conditions: - - files~=^modules/lightstep/ - actions: - label: - add: - - lightstep - remove: [] -- name: Label lightstep-grpc PRs - conditions: - - files~=^modules/lightstep-grpc/ - actions: - label: - add: - - lightstep-grpc - remove: [] -- name: Label lightstep-http PRs - conditions: - - files~=^modules/lightstep-http/ - actions: - label: - add: - - lightstep-http - remove: [] -- name: Label log PRs - conditions: - - files~=^modules/log/ - actions: - label: - add: - - log - remove: [] -- name: Label log-odin PRs - conditions: - - files~=^modules/log-odin/ - actions: - label: - add: - - log-odin - remove: [] -- name: Label mock PRs - conditions: - - files~=^modules/mock/ - actions: - label: - add: - - mock - remove: [] -- name: Label mtl PRs - conditions: - - files~=^modules/mtl/ - actions: - label: - add: - - mtl - remove: [] -- name: Label newrelic PRs - conditions: - - files~=^modules/newrelic/ - actions: - label: - add: - - newrelic - remove: [] -- name: Label noop PRs - conditions: - - files~=^modules/noop/ - actions: - label: - add: - - noop - remove: [] -- name: Label opencensus PRs - conditions: - - files~=^modules/opencensus/ - actions: - label: - add: - - opencensus - remove: [] -- name: Label opentelemetry PRs - conditions: - - files~=^modules/opentelemetry/ - actions: - label: - add: - - opentelemetry - remove: [] -- name: Label opentracing PRs - conditions: - - files~=^modules/opentracing/ - actions: - label: - add: - - opentracing - remove: [] -- name: Label testkit PRs - conditions: - - files~=^modules/testkit/ - actions: - label: - add: - - testkit - remove: [] - name: Label xray PRs conditions: - files~=^modules/xray/ diff --git a/build.sbt b/build.sbt index ac524b96..31f8912c 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,3 @@ -import com.typesafe.tools.mima.core._ ThisBuild / tlBaseVersion := "0.3" @@ -14,7 +13,7 @@ val fs2Version = "3.10.2" // Publishing -ThisBuild / organization := "org.tpolecat" +ThisBuild / organization := "org.ami.b.v" ThisBuild / licenses := Seq(("MIT", url("http://opensource.org/licenses/MIT"))) ThisBuild / developers := List( Developer("tpolecat", "Rob Norris", "rob_norris@mac.com", url("http://www.tpolecat.org")) @@ -48,9 +47,9 @@ lazy val commonSettings = Seq( headerLicense := Some( HeaderLicense.Custom( """|Copyright (c) 2019-2020 by Rob Norris and Contributors - |This software is licensed under the MIT License (MIT). - |For more information see LICENSE or https://opensource.org/licenses/MIT - |""".stripMargin + |This software is licensed under the MIT License (MIT). + |For more information see LICENSE or https://opensource.org/licenses/MIT + |""".stripMargin ) ), // Testing @@ -64,35 +63,18 @@ lazy val commonSettings = Seq( // Compilation ThisBuild / scalaVersion := scala213Version -ThisBuild / crossScalaVersions := Seq(scala212Version, scala213Version, scala30Version) +ThisBuild / crossScalaVersions := Seq(scala30Version) ThisBuild / githubWorkflowScalaVersions := Seq("2.12", "2.13", "3") lazy val root = tlCrossRootProject.aggregate( core, - coreTests, - jaeger, - honeycomb, - opencensus, - opentelemetry, - lightstep, - lightstepGrpc, - lightstepHttp, - opentracing, - datadog, - log, - newrelic, - mock, - mtl, - noop, - xray, - logOdin, - testkit, - examples + xray ) lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("modules/core")) - .enablePlugins(AutomateHeaderPlugin) + .enablePlugins(NoPublishPlugin) + .disablePlugins(TypelevelSonatypePlugin) .settings(commonSettings) .settings( name := "natchez-core", @@ -110,210 +92,11 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.1.7").toMap ) -lazy val coreTests = crossProject(JSPlatform, JVMPlatform, NativePlatform) - .in(file("modules/core-tests")) - .dependsOn(core, mtl, testkit) - .enablePlugins(AutomateHeaderPlugin, NoPublishPlugin) - .settings(commonSettings) - -lazy val jaeger = project - .in(file("modules/jaeger")) - .dependsOn(core.jvm, opentracing) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-jaeger", - description := "Jaeger support for Natchez.", - libraryDependencies ++= Seq( - "org.scala-lang.modules" %% "scala-collection-compat" % collectionCompatVersion, - "io.jaegertracing" % "jaeger-client" % "1.8.1" - ) - ) - -lazy val honeycomb = project - .in(file("modules/honeycomb")) - .dependsOn(core.jvm) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-honeycomb", - description := "Honeycomb support for Natchez.", - libraryDependencies ++= Seq( - "org.scala-lang.modules" %% "scala-collection-compat" % collectionCompatVersion, - "io.honeycomb.libhoney" % "libhoney-java" % "1.6.0" - ) - ) - -lazy val opencensus = project - .in(file("modules/opencensus")) - .dependsOn(core.jvm) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-opencensus", - description := "Opencensus support for Natchez.", - libraryDependencies ++= Seq( - "io.opencensus" % "opencensus-exporter-trace-ocagent" % "0.31.1" - ) - ) - -lazy val lightstep = project - .in(file("modules/lightstep")) - .dependsOn(core.jvm, opentracing) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-lightstep", - description := "Lightstep support for Natchez.", - libraryDependencies ++= Seq( - "com.lightstep.tracer" % "lightstep-tracer-jre" % "0.32.0" - ) - ) - -lazy val lightstepGrpc = project - .in(file("modules/lightstep-grpc")) - .dependsOn(lightstep) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-lightstep-grpc", - description := "Lightstep gRPC bindings for Natchez.", - libraryDependencies ++= Seq( - "com.lightstep.tracer" % "tracer-grpc" % "0.32.0", - "io.grpc" % "grpc-netty" % "1.62.2", - "io.netty" % "netty-tcnative-boringssl-static" % "2.0.65.Final" - ), - mimaPreviousArtifacts := Set() - ) - -lazy val lightstepHttp = project - .in(file("modules/lightstep-http")) - .dependsOn(lightstep) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-lightstep-http", - description := "Lightstep HTTP bindings for Natchez.", - libraryDependencies ++= Seq( - "com.lightstep.tracer" % "tracer-okhttp" % "0.32.0" - ), - mimaPreviousArtifacts := Set() - ) - -lazy val opentracing = project - .in(file("modules/opentracing")) - .dependsOn(core.jvm) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-opentracing", - description := "Base OpenTracing Utilities for Natchez", - libraryDependencies ++= Seq( - "io.opentracing" % "opentracing-api" % "0.33.0" % "provided", - "io.opentracing" % "opentracing-util" % "0.33.0" % "provided" - ) - ) - -lazy val opentelemetry = project - .in(file("modules/opentelemetry")) - .dependsOn(core.jvm) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-opentelemetry", - description := "Base OpenTelemetry Utilities for Natchez", - tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.1.7").toMap, - libraryDependencies ++= Seq( - "io.opentelemetry" % "opentelemetry-sdk" % "1.36.0" - ) - ) - -lazy val datadog = project - .in(file("modules/datadog")) - .dependsOn(core.jvm, opentracing) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-datadog", - description := "Datadog bindings for Natchez.", - libraryDependencies ++= Seq( - "com.datadoghq" % "dd-trace-ot" % "1.31.2", - "com.datadoghq" % "dd-trace-api" % "1.31.2" - ) - ) - -lazy val log = crossProject(JSPlatform, JVMPlatform, NativePlatform) - .in(file("modules/log")) - .dependsOn(core) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-log", - description := "Logging bindings for Natchez, using log4cats.", - libraryDependencies ++= Seq( - "io.circe" %%% "circe-core" % "0.14.6", - "org.typelevel" %%% "log4cats-core" % "2.6.0", - "io.github.cquiroz" %%% "scala-java-time" % "2.5.0" % Test - ) - ) - .nativeSettings( - tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.1.7").toMap - ) - -lazy val newrelic = project - .in(file("modules/newrelic")) - .dependsOn(core.jvm) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "newrelic", - description := "Newrelic bindings for Natchez.", - libraryDependencies ++= Seq( - "io.circe" %% "circe-core" % "0.14.6", - "com.newrelic.telemetry" % "telemetry" % "0.10.0", - "com.newrelic.telemetry" % "telemetry-core" % "0.16.0", - "com.newrelic.telemetry" % "telemetry-http-okhttp" % "0.16.0" - ) - ) - -lazy val mtl = crossProject(JSPlatform, JVMPlatform, NativePlatform) - .in(file("modules/mtl")) - .dependsOn(core) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-mtl", - description := "cats-mtl bindings for Natchez.", - libraryDependencies ++= Seq( - "org.typelevel" %%% "cats-mtl" % "1.4.0", - "org.typelevel" %%% "cats-mtl-laws" % "1.4.0" % Test, - "org.typelevel" %%% "discipline-munit" % "2.0.0-M3" % Test, - "org.typelevel" %%% "cats-effect-testkit" % "3.5.4" % Test - ) - ) - .nativeSettings( - tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.1.7").toMap - ) - -lazy val noop = crossProject(JSPlatform, JVMPlatform, NativePlatform) - .in(file("modules/noop")) - .dependsOn(core) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-noop", - description := "No-Op Open Tracing implementation", - libraryDependencies ++= Seq() - ) - .nativeSettings( - tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.1.7").toMap - ) - -lazy val xray = crossProject(JSPlatform, JVMPlatform) +lazy val xray = crossProject(JVMPlatform) .crossType(CrossType.Pure) .in(file("modules/xray")) - .dependsOn(core) - .enablePlugins(AutomateHeaderPlugin) + .enablePlugins(NoPublishPlugin) + .disablePlugins(TypelevelSonatypePlugin) .settings(commonSettings) .settings( name := "natchez-xray", @@ -322,123 +105,16 @@ lazy val xray = crossProject(JSPlatform, JVMPlatform) "io.circe" %%% "circe-core" % "0.14.6", "co.fs2" %%% "fs2-io" % fs2Version, "com.comcast" %%% "ip4s-core" % "3.5.0", - "org.scodec" %%% "scodec-bits" % "1.1.38" - ) - ) - .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")) - .dependsOn(core.jvm) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-mock", - description := "Mock Open Tracing implementation", - libraryDependencies ++= Seq( - "io.opentracing" % "opentracing-mock" % "0.33.0" - ), - tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.3.1").toMap - ) - -lazy val examples = project - .in(file("modules/examples")) - .dependsOn(core.jvm, jaeger, honeycomb, lightstepHttp, datadog, newrelic, log.jvm, opentelemetry) - .enablePlugins(AutomateHeaderPlugin, NoPublishPlugin) - .settings(commonSettings) - .settings( - name := "natchez-examples", - description := "Example programs for Natchez.", - scalacOptions -= "-Xfatal-warnings", - libraryDependencies ++= Seq( - "org.typelevel" %% "log4cats-slf4j" % "2.6.0", - "org.slf4j" % "slf4j-simple" % "2.0.12", - "eu.timepit" %% "refined" % "0.11.1", - "is.cir" %% "ciris" % "3.5.0", - "io.opentelemetry" % "opentelemetry-exporter-otlp" % "1.36.0", - "io.opentelemetry.semconv" % "opentelemetry-semconv" % "1.22.0-alpha", - "io.grpc" % "grpc-okhttp" % "1.62.2" // required for the OpenTelemetry exporter - ) - ) - -lazy val logOdin = project - .in(file("modules/log-odin")) - .dependsOn(core.jvm) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-log-odin", - description := "Logging bindings for Natchez, using Odin.", - tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.1.7").toMap, - libraryDependencies ++= Seq( - "io.circe" %% "circe-core" % "0.14.1", - "com.github.valskalla" %% "odin-core" % "0.13.0", - "com.github.valskalla" %% "odin-json" % "0.13.0" + "org.scodec" %%% "scodec-bits" % "1.1.38", + "org.tpolecat" %% "natchez-core" % "0.3.5" ) ) -lazy val testkit = crossProject(JSPlatform, JVMPlatform, NativePlatform) - .in(file("modules/testkit")) - .dependsOn(core) - .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings) - .settings( - name := "natchez-testkit", - description := "In-memory Natchez implementation that is useful for testing", - tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.3.1").toMap - ) +ThisBuild / publishTo := Some("GitHub Package Registry" at "https://maven.pkg.github.com/AM-i-B-V/natchez") -lazy val docs = project - .in(file("modules/docs")) - .dependsOn(mtl.jvm, honeycomb, datadog, jaeger, log.jvm, opentelemetry) - .enablePlugins(AutomateHeaderPlugin) - .enablePlugins(ParadoxPlugin) - .enablePlugins(ParadoxSitePlugin) - .enablePlugins(GhpagesPlugin) - .enablePlugins(MdocPlugin) - .settings( - scalacOptions := Nil, - git.remoteRepo := "git@github.com:typelevel/natchez.git", - ghpagesNoJekyll := true, - publish / skip := true, - paradoxTheme := Some(builtinParadoxTheme("generic")), - version := version.value - .takeWhile(_ != '+'), // strip off the +3-f22dca22+20191110-1520-SNAPSHOT business - paradoxProperties ++= Map( - "scala-versions" -> (core.jvm / crossScalaVersions).value - .map(CrossVersion.partialVersion) - .flatten - .distinct - .map { case (a, b) => s"$a.$b" } - .mkString("/"), - "org" -> organization.value, - "scala.binary.version" -> s"2.${CrossVersion.partialVersion(scalaVersion.value).get._2}", - "core-dep" -> s"${(core.jvm / name).value}_2.${CrossVersion.partialVersion(scalaVersion.value).get._2}", - "version" -> version.value, - "scaladoc.natchez.base_url" -> s"https://static.javadoc.io/org.tpolecat/natchez-core_2.13/${version.value}" - ), - mdocIn := (baseDirectory.value) / "src" / "main" / "paradox", - Compile / paradox / sourceDirectory := mdocOut.value, - makeSite := makeSite.dependsOn(mdoc.toTask("")).value, - mdocExtraArguments := Seq("--no-link-hygiene"), // paradox handles this - libraryDependencies ++= Seq( - "org.http4s" %% "http4s-dsl" % "0.23.15", - "org.http4s" %% "http4s-client" % "0.23.15", - "org.typelevel" %% "log4cats-slf4j" % "2.4.0", - "org.slf4j" % "slf4j-simple" % "2.0.12", - "io.opentelemetry" % "opentelemetry-exporter-otlp" % "1.36.0", // for the opentelemetry example - "io.opentelemetry.semconv" % "opentelemetry-semconv" % "1.22.0-alpha" - ), - excludeDependencies += "org.scala-lang.modules" % "scala-collection-compat_3" // pray this does more good than harm - ) +ThisBuild / credentials += Credentials( + "GitHub Package Registry", + "maven.pkg.github.com", + "BOT-AM-i", + System.getenv("GITHUB_TOKEN") +) \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index af9acf9a..af853e02 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -10,7 +10,5 @@ addSbtPlugin("com.github.sbt" % "sbt-site" % "1.6.0") addSbtPlugin("com.github.sbt" % "sbt-site-paradox" % "1.6.0") addSbtPlugin("com.github.sbt" % "sbt-ghpages" % "0.8.0") addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2") From e850851d0ea68614b85d5130376a6187a9f068f1 Mon Sep 17 00:00:00 2001 From: johnspaulka <33827777+johnspaulka@users.noreply.github.com> Date: Wed, 24 Apr 2024 15:10:15 +0530 Subject: [PATCH 2/6] Update XRaySpan.scala to add parent id in XRay trace (#2) --- modules/xray/src/main/scala/natchez/xray/XRaySpan.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/xray/src/main/scala/natchez/xray/XRaySpan.scala b/modules/xray/src/main/scala/natchez/xray/XRaySpan.scala index 20f1e9e8..c7f78cbd 100644 --- a/modules/xray/src/main/scala/natchez/xray/XRaySpan.scala +++ b/modules/xray/src/main/scala/natchez/xray/XRaySpan.scala @@ -124,6 +124,7 @@ private[xray] final case class XRaySpan[F[_]: Concurrent: Clock: Random]( "trace_id" -> xrayTraceId.asJson, "subsegments" -> cs.reverse.map(Json.fromJsonObject).asJson, "annotations" -> allAnnotations.asJson, + "parent_id" -> parent.map(p => p.fold(_.asJson, p => p.segmentId.asJson)).getOrElse(Json.fromJsonObject(JsonObject.empty)), "metadata" -> JsonObject( "links" -> options.links.asJson, "span.kind" -> options.spanKind.asJson From 48ded387e7d90e2ee5498b816be7857af5287244 Mon Sep 17 00:00:00 2001 From: albin-kv <152964006+albin-kv@users.noreply.github.com> Date: Thu, 25 Apr 2024 15:52:37 +0530 Subject: [PATCH 3/6] build fix (#3) --- .github/workflows/ci.yml | 33 ++----------------- build.sbt | 33 +++++++++++-------- .../main/scala/natchez/xray/XRaySpan.scala | 4 ++- project/plugins.sbt | 1 + 4 files changed, 25 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d04b432..62ae78db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -229,7 +229,7 @@ jobs: (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) - name: Publish - run: sbt + publish + run: sbt '+ publish' dependency-submission: name: Submit Dependencies @@ -261,34 +261,5 @@ jobs: - name: Submit Dependencies uses: scalacenter/sbt-dependency-submission@v2 with: - modules-ignore: rootjs_3 natchez-core_native0.4_3 natchez-xray_3 natchez-core_sjs1_3 natchez-core_3 rootjvm_3 rootnative_3 + modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 natchez-core_native0.4_2.12 natchez-core_native0.4_2.13 natchez-core_native0.4_3 natchez-xray_2.12 natchez-xray_2.13 natchez-xray_3 natchez-core_sjs1_2.12 natchez-core_sjs1_2.13 natchez-core_sjs1_3 natchez-core_2.12 natchez-core_2.13 natchez-core_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 configs-ignore: test scala-tool scala-doc-tool test-internal - - docs: - name: Make site - strategy: - matrix: - os: [ubuntu-latest] - scala: [2.13.13] - java: [temurin@11] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout current branch (full) - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Java (temurin@8) - id: setup-java-temurin-8 - if: matrix.java == 'temurin@8' - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 8 - cache: sbt - - - name: sbt update - if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' - run: sbt +update - - - run: sbt '++ ${{ matrix.scala }}' docs/makeSite diff --git a/build.sbt b/build.sbt index 31f8912c..c04d7b03 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,5 @@ - +import org.typelevel.sbt.gha.WorkflowStep +import org.typelevel.sbt.gha.WorkflowStep.Sbt ThisBuild / tlBaseVersion := "0.3" val scala212Version = "2.12.19" @@ -25,16 +26,16 @@ ThisBuild / tlCiReleaseBranches += "series/0.1" // start MiMa from here ThisBuild / tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.1.6").toMap -ThisBuild / githubWorkflowAddedJobs += - WorkflowJob( - id = "docs", - name = s"Make site", - scalas = List(scala213Version), - steps = List(WorkflowStep.CheckoutFull) ++ - WorkflowStep.SetupJava(githubWorkflowJavaVersions.value.toList) ++ - githubWorkflowGeneratedCacheSteps.value ++ - List(WorkflowStep.Sbt(List("docs/makeSite"))) - ) +//ThisBuild / githubWorkflowAddedJobs += +// WorkflowJob( +// id = "docs", +// name = s"Make site", +// scalas = List(scala213Version), +// steps = List(WorkflowStep.CheckoutFull) ++ +// WorkflowStep.SetupJava(githubWorkflowJavaVersions.value.toList) ++ +// githubWorkflowGeneratedCacheSteps.value ++ +// List(WorkflowStep.Sbt(List("docs/makeSite"))) +// ) // https://github.com/sbt/sbt/issues/6997 ThisBuild / libraryDependencySchemes ++= Seq( @@ -63,7 +64,7 @@ lazy val commonSettings = Seq( // Compilation ThisBuild / scalaVersion := scala213Version -ThisBuild / crossScalaVersions := Seq(scala30Version) +ThisBuild / crossScalaVersions := Seq(scala212Version, scala213Version, scala30Version) ThisBuild / githubWorkflowScalaVersions := Seq("2.12", "2.13", "3") lazy val root = tlCrossRootProject.aggregate( @@ -110,11 +111,15 @@ lazy val xray = crossProject(JVMPlatform) ) ) -ThisBuild / publishTo := Some("GitHub Package Registry" at "https://maven.pkg.github.com/AM-i-B-V/natchez") +ThisBuild / publishTo := Some( + "GitHub Package Registry".at("https://maven.pkg.github.com/AM-i-B-V/natchez") +) ThisBuild / credentials += Credentials( "GitHub Package Registry", "maven.pkg.github.com", "BOT-AM-i", System.getenv("GITHUB_TOKEN") -) \ No newline at end of file +) + +ThisBuild / githubWorkflowPublish := Seq(Sbt(name = Some("Publish"), commands = List("+ publish"))) diff --git a/modules/xray/src/main/scala/natchez/xray/XRaySpan.scala b/modules/xray/src/main/scala/natchez/xray/XRaySpan.scala index c7f78cbd..b36bff69 100644 --- a/modules/xray/src/main/scala/natchez/xray/XRaySpan.scala +++ b/modules/xray/src/main/scala/natchez/xray/XRaySpan.scala @@ -124,7 +124,9 @@ private[xray] final case class XRaySpan[F[_]: Concurrent: Clock: Random]( "trace_id" -> xrayTraceId.asJson, "subsegments" -> cs.reverse.map(Json.fromJsonObject).asJson, "annotations" -> allAnnotations.asJson, - "parent_id" -> parent.map(p => p.fold(_.asJson, p => p.segmentId.asJson)).getOrElse(Json.fromJsonObject(JsonObject.empty)), + "parent_id" -> parent + .map(p => p.fold(_.asJson, p => p.segmentId.asJson)) + .getOrElse(Json.fromJsonObject(JsonObject.empty)), "metadata" -> JsonObject( "links" -> options.links.asJson, "span.kind" -> options.spanKind.asJson diff --git a/project/plugins.sbt b/project/plugins.sbt index af853e02..61d4eb72 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -10,5 +10,6 @@ addSbtPlugin("com.github.sbt" % "sbt-site" % "1.6.0") addSbtPlugin("com.github.sbt" % "sbt-site-paradox" % "1.6.0") addSbtPlugin("com.github.sbt" % "sbt-ghpages" % "0.8.0") addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2") From 04fe68c4586535348a727301e23ec812c39ff184 Mon Sep 17 00:00:00 2001 From: albin-kv <152964006+albin-kv@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:32:59 +0530 Subject: [PATCH 4/6] publish fix (#4) --- .github/workflows/ci.yml | 6 +++--- build.sbt | 15 --------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62ae78db..2cb0b00d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,11 +80,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 project/target + run: mkdir -p modules/core/native/target modules/xray/.jvm/target modules/core/js/target modules/core/jvm/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 project/target + run: tar cf targets.tar modules/core/native/target modules/xray/.jvm/target modules/core/js/target modules/core/jvm/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') @@ -261,5 +261,5 @@ jobs: - name: Submit Dependencies uses: scalacenter/sbt-dependency-submission@v2 with: - modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 natchez-core_native0.4_2.12 natchez-core_native0.4_2.13 natchez-core_native0.4_3 natchez-xray_2.12 natchez-xray_2.13 natchez-xray_3 natchez-core_sjs1_2.12 natchez-core_sjs1_2.13 natchez-core_sjs1_3 natchez-core_2.12 natchez-core_2.13 natchez-core_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 + modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 configs-ignore: test scala-tool scala-doc-tool test-internal diff --git a/build.sbt b/build.sbt index c04d7b03..5a1b6224 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,3 @@ -import org.typelevel.sbt.gha.WorkflowStep import org.typelevel.sbt.gha.WorkflowStep.Sbt ThisBuild / tlBaseVersion := "0.3" @@ -13,7 +12,6 @@ val catsEffectVersion = "3.5.4" val fs2Version = "3.10.2" // Publishing - ThisBuild / organization := "org.ami.b.v" ThisBuild / licenses := Seq(("MIT", url("http://opensource.org/licenses/MIT"))) ThisBuild / developers := List( @@ -26,17 +24,6 @@ ThisBuild / tlCiReleaseBranches += "series/0.1" // start MiMa from here ThisBuild / tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.1.6").toMap -//ThisBuild / githubWorkflowAddedJobs += -// WorkflowJob( -// id = "docs", -// name = s"Make site", -// scalas = List(scala213Version), -// steps = List(WorkflowStep.CheckoutFull) ++ -// WorkflowStep.SetupJava(githubWorkflowJavaVersions.value.toList) ++ -// githubWorkflowGeneratedCacheSteps.value ++ -// List(WorkflowStep.Sbt(List("docs/makeSite"))) -// ) - // https://github.com/sbt/sbt/issues/6997 ThisBuild / libraryDependencySchemes ++= Seq( "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always @@ -74,7 +61,6 @@ lazy val root = tlCrossRootProject.aggregate( lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("modules/core")) - .enablePlugins(NoPublishPlugin) .disablePlugins(TypelevelSonatypePlugin) .settings(commonSettings) .settings( @@ -96,7 +82,6 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) lazy val xray = crossProject(JVMPlatform) .crossType(CrossType.Pure) .in(file("modules/xray")) - .enablePlugins(NoPublishPlugin) .disablePlugins(TypelevelSonatypePlugin) .settings(commonSettings) .settings( From 5fbf65101a2d57b9f4ba8a80e5816bdcfd779796 Mon Sep 17 00:00:00 2001 From: Christy Date: Fri, 24 May 2024 16:44:13 +0530 Subject: [PATCH 5/6] conflict resolve --- .github/workflows/ci.yml | 41 +++++++- .mergify.yml | 214 +++++++++++++++++++++++++++++++++------ build.sbt | 84 +++++++++++---- project/plugins.sbt | 3 +- 4 files changed, 286 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cb0b00d..4f36f37c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,11 +80,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/core/native/target modules/xray/.jvm/target modules/core/js/target modules/core/jvm/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/testkit/native/target modules/log/native/target modules/testkit/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 modules/jaeger/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/testkit/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/core/native/target modules/xray/.jvm/target modules/core/js/target modules/core/jvm/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/testkit/native/target modules/log/native/target modules/testkit/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 modules/jaeger/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/testkit/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') @@ -229,7 +229,11 @@ jobs: (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) - name: Publish - run: sbt '+ publish' + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} + run: sbt tlCiRelease dependency-submission: name: Submit Dependencies @@ -261,5 +265,34 @@ jobs: - name: Submit Dependencies uses: scalacenter/sbt-dependency-submission@v2 with: - modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 + modules-ignore: natchez-examples_2.12 natchez-examples_2.13 natchez-examples_3 rootjs_2.12 rootjs_2.13 rootjs_3 coretests_sjs1_2.12 coretests_sjs1_2.13 coretests_sjs1_3 coretests_2.12 coretests_2.13 coretests_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 coretests_native0.4_2.12 coretests_native0.4_2.13 coretests_native0.4_3 configs-ignore: test scala-tool scala-doc-tool test-internal + + docs: + name: Make site + strategy: + matrix: + os: [ubuntu-latest] + scala: [2.13.13] + java: [temurin@11] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Java (temurin@8) + id: setup-java-temurin-8 + if: matrix.java == 'temurin@8' + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 8 + cache: sbt + + - name: sbt update + if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' + run: sbt +update + + - run: sbt '++ ${{ matrix.scala }}' docs/makeSite \ No newline at end of file diff --git a/.mergify.yml b/.mergify.yml index fc8d43bf..33bf7639 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -6,34 +6,186 @@ # to meet your needs, then regenerate this file. pull_request_rules: -- name: merge scala-steward's PRs - conditions: - - author=scala-steward - - body~=labels:.*early-semver-patch - - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootJS) - - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootJVM) - - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootNative) - - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootJS) - - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootJVM) - - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootNative) - - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootJS) - - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootJVM) - - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootNative) - actions: - merge: {} -- name: Label core PRs - conditions: - - files~=^modules/core/ - actions: - label: - add: - - core - remove: [] -- name: Label xray PRs - conditions: - - files~=^modules/xray/ - actions: - label: - add: - - xray - remove: [] + - name: merge scala-steward's PRs + conditions: + - author=scala-steward + - body~=labels:.*early-semver-patch + - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootJS) + - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootJVM) + - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootNative) + - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootJS) + - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootJVM) + - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootNative) + - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootJS) + - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootJVM) + - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootNative) + actions: + merge: {} + - name: Label core PRs + conditions: + - files~=^modules/core/ + actions: + label: + add: + - core + remove: [] + - name: Label core-tests PRs + conditions: + - files~=^modules/core-tests/ + actions: + label: + add: + - core-tests + remove: [] + - name: Label datadog PRs + conditions: + - files~=^modules/datadog/ + actions: + label: + add: + - datadog + remove: [] + - name: Label docs PRs + conditions: + - files~=^modules/docs/ + actions: + label: + add: + - docs + remove: [] + - name: Label examples PRs + conditions: + - files~=^modules/examples/ + actions: + label: + add: + - examples + remove: [] + - name: Label honeycomb PRs + conditions: + - files~=^modules/honeycomb/ + actions: + label: + add: + - honeycomb + remove: [] + - name: Label jaeger PRs + conditions: + - files~=^modules/jaeger/ + actions: + label: + add: + - jaeger + remove: [] + - name: Label lightstep PRs + conditions: + - files~=^modules/lightstep/ + actions: + label: + add: + - lightstep + remove: [] + - name: Label lightstep-grpc PRs + conditions: + - files~=^modules/lightstep-grpc/ + actions: + label: + add: + - lightstep-grpc + remove: [] + - name: Label lightstep-http PRs + conditions: + - files~=^modules/lightstep-http/ + actions: + label: + add: + - lightstep-http + remove: [] + - name: Label log PRs + conditions: + - files~=^modules/log/ + actions: + label: + add: + - log + remove: [] + - name: Label log-odin PRs + conditions: + - files~=^modules/log-odin/ + actions: + label: + add: + - log-odin + remove: [] + - name: Label mock PRs + conditions: + - files~=^modules/mock/ + actions: + label: + add: + - mock + remove: [] + - name: Label mtl PRs + conditions: + - files~=^modules/mtl/ + actions: + label: + add: + - mtl + remove: [] + - name: Label newrelic PRs + conditions: + - files~=^modules/newrelic/ + actions: + label: + add: + - newrelic + remove: [] + - name: Label noop PRs + conditions: + - files~=^modules/noop/ + actions: + label: + add: + - noop + remove: [] + - name: Label opencensus PRs + conditions: + - files~=^modules/opencensus/ + actions: + label: + add: + - opencensus + remove: [] + - name: Label opentelemetry PRs + conditions: + - files~=^modules/opentelemetry/ + actions: + label: + add: + - opentelemetry + remove: [] + - name: Label opentracing PRs + conditions: + - files~=^modules/opentracing/ + actions: + label: + add: + - opentracing + remove: [] + - name: Label testkit PRs + conditions: + - files~=^modules/testkit/ + actions: + label: + add: + - testkit + remove: [] + - name: Label xray PRs + conditions: + - files~=^modules/xray/ + actions: + label: + add: + - xray + remove: [] \ No newline at end of file diff --git a/build.sbt b/build.sbt index 22f2494a..4dd51b89 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,5 @@ -import org.typelevel.sbt.gha.WorkflowStep.Sbt +import com.typesafe.tools.mima.core._ + ThisBuild / tlBaseVersion := "0.3" val scala212Version = "2.12.19" @@ -12,7 +13,8 @@ val catsEffectVersion = "3.5.4" val fs2Version = "3.10.2" // Publishing -ThisBuild / organization := "org.ami.b.v" + +ThisBuild / organization := "org.tpolecat" ThisBuild / licenses := Seq(("MIT", url("http://opensource.org/licenses/MIT"))) ThisBuild / developers := List( Developer("tpolecat", "Rob Norris", "rob_norris@mac.com", url("http://www.tpolecat.org")) @@ -24,6 +26,17 @@ ThisBuild / tlCiReleaseBranches += "series/0.1" // start MiMa from here ThisBuild / tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.1.6").toMap +ThisBuild / githubWorkflowAddedJobs += + WorkflowJob( + id = "docs", + name = s"Make site", + scalas = List(scala213Version), + steps = List(WorkflowStep.CheckoutFull) ++ + WorkflowStep.SetupJava(githubWorkflowJavaVersions.value.toList) ++ + githubWorkflowGeneratedCacheSteps.value ++ + List(WorkflowStep.Sbt(List("docs/makeSite"))) + ) + // https://github.com/sbt/sbt/issues/6997 ThisBuild / libraryDependencySchemes ++= Seq( "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always @@ -56,12 +69,30 @@ ThisBuild / githubWorkflowScalaVersions := Seq("2.12", "2.13", "3") lazy val root = tlCrossRootProject.aggregate( core, - xray + coreTests, + jaeger, + honeycomb, + opencensus, + opentelemetry, + lightstep, + lightstepGrpc, + lightstepHttp, + opentracing, + datadog, + log, + newrelic, + mock, + mtl, + noop, + xray, + logOdin, + testkit, + examples ) lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("modules/core")) - .disablePlugins(TypelevelSonatypePlugin) + .enablePlugins(AutomateHeaderPlugin) .settings(commonSettings) .settings( name := "natchez-core", @@ -79,7 +110,6 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform) tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.1.7").toMap ) - lazy val coreTests = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("modules/core-tests")) .dependsOn(core, mtl, testkit) @@ -282,7 +312,8 @@ lazy val noop = crossProject(JSPlatform, JVMPlatform, NativePlatform) lazy val xray = crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Pure) .in(file("modules/xray")) - .disablePlugins(TypelevelSonatypePlugin) + .dependsOn(core) + .enablePlugins(AutomateHeaderPlugin) .settings(commonSettings) .settings( name := "natchez-xray", @@ -291,23 +322,36 @@ lazy val xray = crossProject(JSPlatform, JVMPlatform) "io.circe" %%% "circe-core" % "0.14.7", "co.fs2" %%% "fs2-io" % fs2Version, "com.comcast" %%% "ip4s-core" % "3.5.0", - "org.scodec" %%% "scodec-bits" % "1.1.38", - "org.tpolecat" %% "natchez-core" % "0.3.5" + "org.scodec" %%% "scodec-bits" % "1.1.38" + ) + ) + .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$") ) ) -ThisBuild / publishTo := Some( - "GitHub Package Registry".at("https://maven.pkg.github.com/AM-i-B-V/natchez") -) - -ThisBuild / credentials += Credentials( - "GitHub Package Registry", - "maven.pkg.github.com", - "BOT-AM-i", - System.getenv("GITHUB_TOKEN") -) +lazy val mock = project + .in(file("modules/mock")) + .dependsOn(core.jvm) + .enablePlugins(AutomateHeaderPlugin) + .settings(commonSettings) + .settings( + name := "natchez-mock", + description := "Mock Open Tracing implementation", + libraryDependencies ++= Seq( + "io.opentracing" % "opentracing-mock" % "0.33.0" + ), + tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.3.1").toMap + ) -ThisBuild / githubWorkflowPublish := Seq(Sbt(name = Some("Publish"), commands = List("+ publish"))) lazy val examples = project .in(file("modules/examples")) .dependsOn(core.jvm, jaeger, honeycomb, lightstepHttp, datadog, newrelic, log.jvm, opentelemetry) @@ -397,4 +441,4 @@ lazy val docs = project "io.opentelemetry.semconv" % "opentelemetry-semconv" % "1.22.0-alpha" ), excludeDependencies += "org.scala-lang.modules" % "scala-collection-compat_3" // pray this does more good than harm - ) + ) \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index df7a7514..20352777 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -10,6 +10,7 @@ addSbtPlugin("com.github.sbt" % "sbt-site" % "1.6.0") addSbtPlugin("com.github.sbt" % "sbt-site-paradox" % "1.6.0") addSbtPlugin("com.github.sbt" % "sbt-ghpages" % "0.8.0") addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") -addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2") +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2") \ No newline at end of file From a616263878891d416c6c27efe79a6dd0aafcafe9 Mon Sep 17 00:00:00 2001 From: Christy Date: Tue, 28 May 2024 18:22:27 +0530 Subject: [PATCH 6/6] remove additional changes --- .github/workflows/ci.yml | 2 +- .mergify.yml | 366 +++++++++++++++++++-------------------- build.sbt | 8 +- project/plugins.sbt | 2 +- 4 files changed, 189 insertions(+), 189 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f36f37c..54630e86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -295,4 +295,4 @@ jobs: if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' run: sbt +update - - run: sbt '++ ${{ matrix.scala }}' docs/makeSite \ No newline at end of file + - run: sbt '++ ${{ matrix.scala }}' docs/makeSite diff --git a/.mergify.yml b/.mergify.yml index 33bf7639..9101522e 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -6,186 +6,186 @@ # to meet your needs, then regenerate this file. pull_request_rules: - - name: merge scala-steward's PRs - conditions: - - author=scala-steward - - body~=labels:.*early-semver-patch - - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootJS) - - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootJVM) - - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootNative) - - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootJS) - - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootJVM) - - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootNative) - - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootJS) - - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootJVM) - - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootNative) - actions: - merge: {} - - name: Label core PRs - conditions: - - files~=^modules/core/ - actions: - label: - add: - - core - remove: [] - - name: Label core-tests PRs - conditions: - - files~=^modules/core-tests/ - actions: - label: - add: - - core-tests - remove: [] - - name: Label datadog PRs - conditions: - - files~=^modules/datadog/ - actions: - label: - add: - - datadog - remove: [] - - name: Label docs PRs - conditions: - - files~=^modules/docs/ - actions: - label: - add: - - docs - remove: [] - - name: Label examples PRs - conditions: - - files~=^modules/examples/ - actions: - label: - add: - - examples - remove: [] - - name: Label honeycomb PRs - conditions: - - files~=^modules/honeycomb/ - actions: - label: - add: - - honeycomb - remove: [] - - name: Label jaeger PRs - conditions: - - files~=^modules/jaeger/ - actions: - label: - add: - - jaeger - remove: [] - - name: Label lightstep PRs - conditions: - - files~=^modules/lightstep/ - actions: - label: - add: - - lightstep - remove: [] - - name: Label lightstep-grpc PRs - conditions: - - files~=^modules/lightstep-grpc/ - actions: - label: - add: - - lightstep-grpc - remove: [] - - name: Label lightstep-http PRs - conditions: - - files~=^modules/lightstep-http/ - actions: - label: - add: - - lightstep-http - remove: [] - - name: Label log PRs - conditions: - - files~=^modules/log/ - actions: - label: - add: - - log - remove: [] - - name: Label log-odin PRs - conditions: - - files~=^modules/log-odin/ - actions: - label: - add: - - log-odin - remove: [] - - name: Label mock PRs - conditions: - - files~=^modules/mock/ - actions: - label: - add: - - mock - remove: [] - - name: Label mtl PRs - conditions: - - files~=^modules/mtl/ - actions: - label: - add: - - mtl - remove: [] - - name: Label newrelic PRs - conditions: - - files~=^modules/newrelic/ - actions: - label: - add: - - newrelic - remove: [] - - name: Label noop PRs - conditions: - - files~=^modules/noop/ - actions: - label: - add: - - noop - remove: [] - - name: Label opencensus PRs - conditions: - - files~=^modules/opencensus/ - actions: - label: - add: - - opencensus - remove: [] - - name: Label opentelemetry PRs - conditions: - - files~=^modules/opentelemetry/ - actions: - label: - add: - - opentelemetry - remove: [] - - name: Label opentracing PRs - conditions: - - files~=^modules/opentracing/ - actions: - label: - add: - - opentracing - remove: [] - - name: Label testkit PRs - conditions: - - files~=^modules/testkit/ - actions: - label: - add: - - testkit - remove: [] - - name: Label xray PRs - conditions: - - files~=^modules/xray/ - actions: - label: - add: - - xray - remove: [] \ No newline at end of file +- name: merge scala-steward's PRs + conditions: + - author=scala-steward + - body~=labels:.*early-semver-patch + - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootJS) + - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootJVM) + - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8, rootNative) + - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootJS) + - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootJVM) + - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8, rootNative) + - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootJS) + - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootJVM) + - status-success=Build and Test (ubuntu-latest, 3, temurin@8, rootNative) + actions: + merge: {} +- name: Label core PRs + conditions: + - files~=^modules/core/ + actions: + label: + add: + - core + remove: [] +- name: Label core-tests PRs + conditions: + - files~=^modules/core-tests/ + actions: + label: + add: + - core-tests + remove: [] +- name: Label datadog PRs + conditions: + - files~=^modules/datadog/ + actions: + label: + add: + - datadog + remove: [] +- name: Label docs PRs + conditions: + - files~=^modules/docs/ + actions: + label: + add: + - docs + remove: [] +- name: Label examples PRs + conditions: + - files~=^modules/examples/ + actions: + label: + add: + - examples + remove: [] +- name: Label honeycomb PRs + conditions: + - files~=^modules/honeycomb/ + actions: + label: + add: + - honeycomb + remove: [] +- name: Label jaeger PRs + conditions: + - files~=^modules/jaeger/ + actions: + label: + add: + - jaeger + remove: [] +- name: Label lightstep PRs + conditions: + - files~=^modules/lightstep/ + actions: + label: + add: + - lightstep + remove: [] +- name: Label lightstep-grpc PRs + conditions: + - files~=^modules/lightstep-grpc/ + actions: + label: + add: + - lightstep-grpc + remove: [] +- name: Label lightstep-http PRs + conditions: + - files~=^modules/lightstep-http/ + actions: + label: + add: + - lightstep-http + remove: [] +- name: Label log PRs + conditions: + - files~=^modules/log/ + actions: + label: + add: + - log + remove: [] +- name: Label log-odin PRs + conditions: + - files~=^modules/log-odin/ + actions: + label: + add: + - log-odin + remove: [] +- name: Label mock PRs + conditions: + - files~=^modules/mock/ + actions: + label: + add: + - mock + remove: [] +- name: Label mtl PRs + conditions: + - files~=^modules/mtl/ + actions: + label: + add: + - mtl + remove: [] +- name: Label newrelic PRs + conditions: + - files~=^modules/newrelic/ + actions: + label: + add: + - newrelic + remove: [] +- name: Label noop PRs + conditions: + - files~=^modules/noop/ + actions: + label: + add: + - noop + remove: [] +- name: Label opencensus PRs + conditions: + - files~=^modules/opencensus/ + actions: + label: + add: + - opencensus + remove: [] +- name: Label opentelemetry PRs + conditions: + - files~=^modules/opentelemetry/ + actions: + label: + add: + - opentelemetry + remove: [] +- name: Label opentracing PRs + conditions: + - files~=^modules/opentracing/ + actions: + label: + add: + - opentracing + remove: [] +- name: Label testkit PRs + conditions: + - files~=^modules/testkit/ + actions: + label: + add: + - testkit + remove: [] +- name: Label xray PRs + conditions: + - files~=^modules/xray/ + actions: + label: + add: + - xray + remove: [] diff --git a/build.sbt b/build.sbt index 4dd51b89..970366a3 100644 --- a/build.sbt +++ b/build.sbt @@ -48,9 +48,9 @@ lazy val commonSettings = Seq( headerLicense := Some( HeaderLicense.Custom( """|Copyright (c) 2019-2020 by Rob Norris and Contributors - |This software is licensed under the MIT License (MIT). - |For more information see LICENSE or https://opensource.org/licenses/MIT - |""".stripMargin + |This software is licensed under the MIT License (MIT). + |For more information see LICENSE or https://opensource.org/licenses/MIT + |""".stripMargin ) ), // Testing @@ -441,4 +441,4 @@ lazy val docs = project "io.opentelemetry.semconv" % "opentelemetry-semconv" % "1.22.0-alpha" ), excludeDependencies += "org.scala-lang.modules" % "scala-collection-compat_3" // pray this does more good than harm - ) \ No newline at end of file + ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 20352777..ab3c1fb5 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -13,4 +13,4 @@ addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") -addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2") \ No newline at end of file +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2")