From 45f42a1119b05f11e501a84a8cda989bd82d676c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20L=C3=BChrs?= Date: Tue, 7 Nov 2023 11:45:25 -0300 Subject: [PATCH] Updated sbt-lucuma-app to 0.11.9 --- .github/workflows/ci.yml | 47 ++++++++----------- .mergify.yml | 4 +- .scalafmt-common.conf | 5 +- .../model/boopickle/ModelBooPicklers.scala | 1 - .../gemini/schema/util/SchemaStitcher.scala | 7 +-- .../gemini/schema/util/SourceResolver.scala | 1 - .../scala/navigate/server/acm/package.scala | 1 - .../server/tcs/RotatorTrackConfig.scala | 1 - .../scala/navigate/server/tcs/Target.scala | 1 - .../scala/navigate/stateengine/Handler.scala | 1 - .../stateengine/StateEngineSpec.scala | 2 - .../web/server/http4s/GrackleParsers.scala | 6 --- .../web/server/http4s/GraphQlRoutes.scala | 5 -- .../web/server/http4s/NavigateMappings.scala | 19 -------- .../server/http4s/NavigateUIApiRoutes.scala | 3 -- .../web/server/http4s/OperationOutcome.scala | 1 - .../web/server/http4s/WebServerLauncher.scala | 2 - .../server/http4s/NavigateMappingsTest.scala | 4 -- project/plugins.sbt | 2 +- 19 files changed, 27 insertions(+), 86 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97813eaf..65a06286 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,49 +16,40 @@ on: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +concurrency: + group: ${{ github.workflow }} @ ${{ github.ref }} + cancel-in-progress: true + jobs: build: name: Build and Test strategy: matrix: os: [ubuntu-latest] - scala: [3.3.1] + scala: [3] java: [temurin@17] project: [rootJS, rootJVM] runs-on: ${{ matrix.os }} + timeout-minutes: 60 steps: - name: Checkout current branch (full) - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Download Java (temurin@17) - id: download-java-temurin-17 - if: matrix.java == 'temurin@17' - uses: typelevel/download-java@v2 - with: - distribution: temurin - java-version: 17 - - name: Setup Java (temurin@17) + id: setup-java-temurin-17 if: matrix.java == 'temurin@17' uses: actions/setup-java@v3 with: - distribution: jdkfile + distribution: temurin java-version: 17 - jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} + cache: sbt - - name: Cache sbt - uses: actions/cache@v3 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + - name: sbt update + if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' + run: sbt +update - name: Check that workflows are up to date run: sbt githubWorkflowCheck @@ -67,6 +58,10 @@ jobs: if: matrix.java == 'temurin@17' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck lucumaScalafmtCheck lucumaScalafixCheck + - name: Check scalafix lints + if: matrix.java == 'temurin@17' && matrix.os == 'ubuntu-latest' + run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' 'scalafixAll --check' + - name: scalaJSLink if: matrix.project == 'rootJS' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult @@ -74,12 +69,8 @@ jobs: - name: Test run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test - - name: Check scalafix lints - if: matrix.java == 'temurin@17' && matrix.os == 'ubuntu-latest' - run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' 'scalafixAll --check' - - name: Aggregate coverage reports run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' coverageReport coverageAggregate - name: Upload code coverage data - run: 'bash <(curl -s https://codecov.io/bash)' + uses: codecov/codecov-action@v3 diff --git a/.mergify.yml b/.mergify.yml index c3b4b3f3..2827e4b0 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -13,8 +13,8 @@ pull_request_rules: - body~=labels:.*early-semver-patch - body~=labels:.*early-semver-minor - 'title=flake.lock: Update' - - status-success=Build and Test (ubuntu-latest, 3.3.1, temurin@17, rootJS) - - status-success=Build and Test (ubuntu-latest, 3.3.1, temurin@17, rootJVM) + - status-success=Build and Test (ubuntu-latest, 3, temurin@17, rootJS) + - status-success=Build and Test (ubuntu-latest, 3, temurin@17, rootJVM) actions: merge: {} - name: Label epics PRs diff --git a/.scalafmt-common.conf b/.scalafmt-common.conf index 0218680c..3cb97af1 100644 --- a/.scalafmt-common.conf +++ b/.scalafmt-common.conf @@ -4,10 +4,11 @@ # this file by hand! Instead, if you wish to make changes, you should # make a PR to sbt-lucuma. -version = "3.7.2" +version = "3.7.14" style = default -runner.dialect = scala213source3 +runner.dialect = scala3 +runner.optimizer.maxVisitsPerToken = 20000 # Avoids SearchStateExploded exceptions maxColumn = 100 project.git = true diff --git a/modules/model/shared/src/main/scala/navigate/model/boopickle/ModelBooPicklers.scala b/modules/model/shared/src/main/scala/navigate/model/boopickle/ModelBooPicklers.scala index da3711f2..cc27bbe6 100644 --- a/modules/model/shared/src/main/scala/navigate/model/boopickle/ModelBooPicklers.scala +++ b/modules/model/shared/src/main/scala/navigate/model/boopickle/ModelBooPicklers.scala @@ -23,7 +23,6 @@ import navigate.model.NavigateEvent._ import navigate.model._ import navigate.model.enums.ServerLogLevel import navigate.model.security.UserDetails -import navigate.model.security.UserLoginRequest import squants.time.Time import squants.time.TimeConversions._ diff --git a/modules/schema-util/src/main/scala/edu/gemini/schema/util/SchemaStitcher.scala b/modules/schema-util/src/main/scala/edu/gemini/schema/util/SchemaStitcher.scala index f2457bdc..7150e8e6 100644 --- a/modules/schema-util/src/main/scala/edu/gemini/schema/util/SchemaStitcher.scala +++ b/modules/schema-util/src/main/scala/edu/gemini/schema/util/SchemaStitcher.scala @@ -3,19 +3,16 @@ package edu.gemini.schema.util -import cats.data.{Ior, NonEmptySet} +import cats.data.NonEmptySet import cats.effect.Sync -import cats.kernel.Order import cats.parse.Parser.* import cats.parse.Rfc5234.{alpha, digit, wsp} -import cats.parse.{Parser, Parser0} +import cats.parse.Parser import cats.syntax.all.* -import cats.{Applicative, Eq, Monad} import grackle.* import eu.timepit.refined.types.string.NonEmptyString import eu.timepit.refined.cats.given -import scala.io.Source import java.nio.file.Path // SchemaStitcher can build a grackle Schema from schema files that contains import statements of the form: diff --git a/modules/schema-util/src/main/scala/edu/gemini/schema/util/SourceResolver.scala b/modules/schema-util/src/main/scala/edu/gemini/schema/util/SourceResolver.scala index 2b5d7dde..c75a2379 100644 --- a/modules/schema-util/src/main/scala/edu/gemini/schema/util/SourceResolver.scala +++ b/modules/schema-util/src/main/scala/edu/gemini/schema/util/SourceResolver.scala @@ -7,7 +7,6 @@ import scala.io.Source import java.nio.file.Path import cats.effect.Resource import cats.effect.Sync -import cats.effect.syntax.all.* import cats.syntax.all.* import cats.ApplicativeThrow diff --git a/modules/server/src/main/scala/navigate/server/acm/package.scala b/modules/server/src/main/scala/navigate/server/acm/package.scala index de5c6aa5..7038ac5c 100644 --- a/modules/server/src/main/scala/navigate/server/acm/package.scala +++ b/modules/server/src/main/scala/navigate/server/acm/package.scala @@ -8,7 +8,6 @@ import cats.syntax.all.* import navigate.epics.Channel import navigate.epics.EpicsSystem.TelltaleChannel import navigate.epics.VerifiedEpics.{VerifiedEpics, writeChannel} -import navigate.server.acm.Encoder.* package object acm { diff --git a/modules/server/src/main/scala/navigate/server/tcs/RotatorTrackConfig.scala b/modules/server/src/main/scala/navigate/server/tcs/RotatorTrackConfig.scala index 63beb378..7498bd89 100644 --- a/modules/server/src/main/scala/navigate/server/tcs/RotatorTrackConfig.scala +++ b/modules/server/src/main/scala/navigate/server/tcs/RotatorTrackConfig.scala @@ -3,7 +3,6 @@ package navigate.server.tcs -import cats.Eq import lucuma.core.math.Angle case class RotatorTrackConfig ( diff --git a/modules/server/src/main/scala/navigate/server/tcs/Target.scala b/modules/server/src/main/scala/navigate/server/tcs/Target.scala index 52fd56bc..586dab31 100644 --- a/modules/server/src/main/scala/navigate/server/tcs/Target.scala +++ b/modules/server/src/main/scala/navigate/server/tcs/Target.scala @@ -12,7 +12,6 @@ import lucuma.core.math.{ RadialVelocity, Wavelength } -import lucuma.core.model.Target.Sidereal sealed trait Target extends Product with Serializable { val objectName: String diff --git a/modules/stateengine/src/main/scala/navigate/stateengine/Handler.scala b/modules/stateengine/src/main/scala/navigate/stateengine/Handler.scala index f1b024ed..7afa0da9 100644 --- a/modules/stateengine/src/main/scala/navigate/stateengine/Handler.scala +++ b/modules/stateengine/src/main/scala/navigate/stateengine/Handler.scala @@ -6,7 +6,6 @@ package navigate.stateengine import cats.Applicative import cats.Monad import cats.data.State -import cats.data.StateT import cats.syntax.all.* import fs2.Stream import navigate.stateengine.Handler.RetVal diff --git a/modules/stateengine/src/test/scala/navigate/stateengine/StateEngineSpec.scala b/modules/stateengine/src/test/scala/navigate/stateengine/StateEngineSpec.scala index 1e289d14..c8b61763 100644 --- a/modules/stateengine/src/test/scala/navigate/stateengine/StateEngineSpec.scala +++ b/modules/stateengine/src/test/scala/navigate/stateengine/StateEngineSpec.scala @@ -11,8 +11,6 @@ import munit.CatsEffectSuite import java.util.concurrent.TimeUnit import scala.concurrent.duration.FiniteDuration -import Handler._ - class StateEngineSpec extends CatsEffectSuite { test("StateEngine should process commands") { diff --git a/modules/web/server/src/main/scala/navigate/web/server/http4s/GrackleParsers.scala b/modules/web/server/src/main/scala/navigate/web/server/http4s/GrackleParsers.scala index e2a0b4cc..e322087e 100644 --- a/modules/web/server/src/main/scala/navigate/web/server/http4s/GrackleParsers.scala +++ b/modules/web/server/src/main/scala/navigate/web/server/http4s/GrackleParsers.scala @@ -5,11 +5,9 @@ package navigate.web.server.http4s import cats.syntax.all.* import coulomb.* -import coulomb.ops.algebra.spire.all.given import coulomb.policy.spire.standard.given import coulomb.syntax.* import coulomb.units.si.* -import coulomb.units.si.given import coulomb.units.si.prefixes.* import grackle.Value import grackle.Value.FloatValue @@ -25,15 +23,11 @@ import lucuma.core.math.ProperMotion import lucuma.core.math.RadialVelocity import lucuma.core.math.RightAscension import lucuma.core.math.Wavelength -import lucuma.core.math.skycalc.solver.HourAngleSolver import lucuma.core.math.units.CentimetersPerSecond import lucuma.core.math.units.MetersPerSecond -import lucuma.core.model.NonNegDuration import lucuma.core.util.Enumerated import navigate.model.Distance -import java.time.Duration - trait GrackleParsers { def bigDecimalValue(v: Value): Option[BigDecimal] = diff --git a/modules/web/server/src/main/scala/navigate/web/server/http4s/GraphQlRoutes.scala b/modules/web/server/src/main/scala/navigate/web/server/http4s/GraphQlRoutes.scala index 2fac6d8b..0fa1128f 100644 --- a/modules/web/server/src/main/scala/navigate/web/server/http4s/GraphQlRoutes.scala +++ b/modules/web/server/src/main/scala/navigate/web/server/http4s/GraphQlRoutes.scala @@ -11,12 +11,7 @@ import fs2.concurrent.Topic import lucuma.graphql.routes.GraphQLService import lucuma.graphql.routes.Routes import natchez.Trace -import navigate.model.security.UserDetails import navigate.server.NavigateEngine -import navigate.web.server.security.AuthenticationService -import navigate.web.server.security.Http4sAuthentication -import navigate.web.server.security.TokenRefresher -import org.http4s.AuthedRoutes import org.http4s.HttpRoutes import org.http4s.dsl.Http4sDsl import org.http4s.server.middleware.GZip diff --git a/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateMappings.scala b/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateMappings.scala index 32dfa088..12f5431a 100644 --- a/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateMappings.scala +++ b/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateMappings.scala @@ -3,27 +3,16 @@ package navigate.web.server.http4s -import cats.Applicative -import cats.data.Ior -import cats.data.NonEmptyChain import cats.effect.Sync -import cats.effect.syntax.all.* import cats.syntax.all.* import ch.qos.logback.classic.spi.ILoggingEvent import edu.gemini.schema.util.SchemaStitcher import edu.gemini.schema.util.SourceResolver import fs2.concurrent.Topic -import grackle.Cursor import grackle.Env -import grackle.Mapping import grackle.Path -import grackle.Predicate.Eql -import grackle.Problem import grackle.Query import grackle.Query.Binding -import grackle.Query.Environment -import grackle.Query.Select -import grackle.Query.Unique import grackle.QueryCompiler.Elab import grackle.QueryCompiler.SelectElaborator import grackle.Result @@ -32,15 +21,10 @@ import grackle.TypeRef import grackle.Value import grackle.Value.BooleanValue import grackle.Value.EnumValue -import grackle.Value.FloatValue -import grackle.Value.IntValue import grackle.Value.ObjectValue import grackle.Value.StringValue import grackle.circe.CirceMapping import grackle.syntax.given -import io.circe.Decoder -import io.circe.Encoder -import io.circe.Json import io.circe.syntax.* import lucuma.core.math.Coordinates import lucuma.core.math.Declination @@ -50,7 +34,6 @@ import lucuma.core.math.ProperMotion import lucuma.core.math.RadialVelocity import lucuma.core.math.RightAscension import lucuma.core.math.Wavelength -import lucuma.core.util.Enumerated import navigate.model.Distance import navigate.server.NavigateEngine import navigate.server.tcs.AutoparkAowfs @@ -80,8 +63,6 @@ import navigate.server.tcs.ZeroMountDiffTrack import navigate.server.tcs.ZeroMountOffset import navigate.server.tcs.ZeroSourceDiffTrack import navigate.server.tcs.ZeroSourceOffset -import org.typelevel.log4cats.Logger -import spire.math.Algebraic.Expr.Sub import java.nio.file.Path as JPath import scala.reflect.classTag diff --git a/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateUIApiRoutes.scala b/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateUIApiRoutes.scala index 7b2fc23f..5d36069c 100644 --- a/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateUIApiRoutes.scala +++ b/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateUIApiRoutes.scala @@ -18,14 +18,12 @@ import navigate.model.NavigateEvent import navigate.model.NavigateEvent.ConnectionOpenEvent import navigate.model.NavigateEvent.ForClient import navigate.model.NavigateEvent.NullEvent -import navigate.model.NavigateEvent.given import navigate.model.boopickle.* import navigate.model.config.* import navigate.model.given import navigate.model.security.UserLoginRequest import navigate.server.NavigateEngine import navigate.web.server.OcsBuildInfo -import navigate.web.server.http4s.encoder.* import navigate.web.server.security.AuthenticationService import navigate.web.server.security.AuthenticationService.AuthResult import navigate.web.server.security.Http4sAuthentication @@ -34,7 +32,6 @@ import org.http4s.* import org.http4s.circe.CirceEntityDecoder.* import org.http4s.circe.CirceEntityEncoder.* import org.http4s.dsl.* -import org.http4s.headers.Origin import org.http4s.headers.`User-Agent` import org.http4s.headers.`WWW-Authenticate` import org.http4s.server.middleware.CORS diff --git a/modules/web/server/src/main/scala/navigate/web/server/http4s/OperationOutcome.scala b/modules/web/server/src/main/scala/navigate/web/server/http4s/OperationOutcome.scala index d8c45744..0ed24ced 100644 --- a/modules/web/server/src/main/scala/navigate/web/server/http4s/OperationOutcome.scala +++ b/modules/web/server/src/main/scala/navigate/web/server/http4s/OperationOutcome.scala @@ -4,7 +4,6 @@ package navigate.web.server.http4s import cats.Eq -import cats.syntax.eq.* import cats.syntax.option.* import io.circe.Encoder diff --git a/modules/web/server/src/main/scala/navigate/web/server/http4s/WebServerLauncher.scala b/modules/web/server/src/main/scala/navigate/web/server/http4s/WebServerLauncher.scala index 5ac157f9..b77a3d5b 100644 --- a/modules/web/server/src/main/scala/navigate/web/server/http4s/WebServerLauncher.scala +++ b/modules/web/server/src/main/scala/navigate/web/server/http4s/WebServerLauncher.scala @@ -26,7 +26,6 @@ import navigate.web.server.common.RedirectToHttpsRoutes import navigate.web.server.common.StaticRoutes import navigate.web.server.config.* import navigate.web.server.logging.SubscriptionAppender -import navigate.web.server.logging.given import navigate.web.server.security.AuthenticationService import org.http4s.HttpRoutes import org.http4s.blaze.server.BlazeServerBuilder @@ -47,7 +46,6 @@ import java.nio.file.Path as FilePath import java.security.KeyStore import java.security.Security import java.util.Locale -import java.util.spi.LocaleServiceProvider import javax.net.ssl.KeyManagerFactory import javax.net.ssl.SSLContext import javax.net.ssl.TrustManagerFactory diff --git a/modules/web/server/src/test/scala/navigate/web/server/http4s/NavigateMappingsTest.scala b/modules/web/server/src/test/scala/navigate/web/server/http4s/NavigateMappingsTest.scala index 9283eac0..aa2ff0fb 100644 --- a/modules/web/server/src/test/scala/navigate/web/server/http4s/NavigateMappingsTest.scala +++ b/modules/web/server/src/test/scala/navigate/web/server/http4s/NavigateMappingsTest.scala @@ -11,7 +11,6 @@ import ch.qos.logback.classic.Level import ch.qos.logback.classic.spi.ILoggingEvent import ch.qos.logback.classic.spi.IThrowableProxy import ch.qos.logback.classic.spi.LoggerContextVO -import ch.qos.logback.classic.spi.StackTraceElementProxy import fs2.Stream import fs2.concurrent.Topic import io.circe.Decoder @@ -35,8 +34,6 @@ import navigate.server.tcs.TcsSouthControllerSim import navigate.server.tcs.TrackingConfig import org.slf4j.Marker import org.slf4j.event.KeyValuePair -import org.typelevel.log4cats.Logger -import org.typelevel.log4cats.slf4j.Slf4jLogger import java.util import scala.concurrent.duration.Duration @@ -338,7 +335,6 @@ class NavigateMappingsTest extends CatsEffectSuite { } test("Provide logs subscription") { - val logger: Logger[IO] = Slf4jLogger.getLoggerFromName[IO]("navigate") val debugMsg: String = "debug message" val infoMsg: String = "info message" val warningMsg: String = "warning message" diff --git a/project/plugins.sbt b/project/plugins.sbt index f5fe0f3c..ad061e31 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,7 +1,7 @@ resolvers ++= Resolver.sonatypeOssRepos("public") addDependencyTreePlugin -addSbtPlugin("edu.gemini" % "sbt-lucuma-app" % "0.10.13") +addSbtPlugin("edu.gemini" % "sbt-lucuma-app" % "0.11.9") // sbt revolver lets launching applications from the sbt console addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0") addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")