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

Dep updates #119

Merged
merged 4 commits into from
Feb 19, 2025
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
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Startup MySQL service
run: sudo /etc/init.d/mysql start
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'adopt'
java-version: '21'
distribution: 'corretto'
- uses: sbt/setup-sbt@v1
- name: Set Env
if: ${{ github.repository == 'lucidsoftware/piezo' }}
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import org.quartz.JobDataMap
import play.api.libs.json._
import play.api.data.Form
import play.api.data.Forms._
import play.api.data.Mapping

case class DataMap(key: String, value: String)

object DataMap {
implicit val writes: Writes[DataMap] = Writes { dataMap =>
Json.obj(
"key" -> dataMap.key,
"value" -> dataMap.value
"value" -> dataMap.value,
)
}
}
Expand All @@ -31,9 +32,10 @@ trait JobDataHelper {
})
}

implicit def jobDataMap = {
optional(list(mapping("key" -> text, "value" -> text)(DataMap.apply)(DataMap.unapply))
.transform(mapToJobData, jobDataToMap))
}
implicit def jobDataMap: Mapping[Option[JobDataMap]] =
optional(
list(mapping("key" -> text, "value" -> text)(DataMap.apply)(DataMap.unapply))
.transform(mapToJobData, jobDataToMap),
)

}
15 changes: 9 additions & 6 deletions admin/app/com/lucidchart/piezo/admin/utils/JobDetailHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package com.lucidchart.piezo.admin.utils
import play.api.libs.json._
import org.quartz._
import scala.collection.JavaConverters._
import com.lucidchart.piezo.admin.controllers.{JobFormHelper, JobDataHelper, TriggerHelper}
import com.lucidchart.piezo.admin.controllers.{JobDataHelper, JobFormHelper, TriggerHelper}
import com.lucidchart.piezo.TriggerMonitoringModel

object JobDetailHelper extends JobDataHelper {
lazy val jobFormHelper = new JobFormHelper()

implicit def jobDetailWrites(
triggers: Seq[Trigger],
triggerMonitoringModel: TriggerMonitoringModel
triggerMonitoringModel: TriggerMonitoringModel,
): Writes[JobDetail] = Writes[JobDetail] { jobDetail =>
val jobDataMap = jobDetail.getJobDataMap

Expand All @@ -20,14 +20,17 @@ object JobDetailHelper extends JobDataHelper {
"name" -> jobKey.getName,
"description" -> jobDetail.getDescription,
"class" -> jobDetail.getJobClass.getName,
"concurrent" -> jobDetail.isConcurrentExectionDisallowed,
"concurrent" -> jobDetail.isConcurrentExecutionDisallowed,
"durable" -> jobDetail.isDurable,
"requests-recovery" -> jobDetail.requestsRecovery,
"job-data-map" -> Json.toJson(jobDataToMap(jobDataMap)),
"triggers" -> Json.toJson(triggers)(TriggerHelper.writesTriggerSeq(triggerMonitoringModel))
"triggers" -> Json.toJson(triggers)(TriggerHelper.writesTriggerSeq(triggerMonitoringModel)),
)
}

implicit def jobDetailSeqWrites(triggers: Seq[Trigger], triggerMonitoringModel: TriggerMonitoringModel) = Writes.seq(jobDetailWrites(triggers, triggerMonitoringModel))
implicit def jobDetailSeqWrites(
triggers: Seq[Trigger],
triggerMonitoringModel: TriggerMonitoringModel,
): Writes[Seq[JobDetail]] =
Writes.seq(jobDetailWrites(triggers, triggerMonitoringModel))
}

4 changes: 3 additions & 1 deletion admin/app/com/lucidchart/piezo/admin/views/FormHelpers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ package com.lucidchart.piezo.admin.views
import _root_.views.html.helper.FieldConstructor

object FormHelpers {
implicit val myFields = FieldConstructor(com.lucidchart.piezo.admin.views.html.helpers.fieldConstructor.f)
implicit val myFields: FieldConstructor = FieldConstructor(
com.lucidchart.piezo.admin.views.html.helpers.fieldConstructor.f,
)
}
2 changes: 1 addition & 1 deletion admin/app/com/lucidchart/piezo/admin/views/job.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ <h4>Are you sure you want to pause the job?</h4>
</tr>
<tr>
<td class="text-right small">Concurrent execution disallowed</td>
<td class="small">@currentJob.get.isConcurrentExectionDisallowed()</td>
<td class="small">@currentJob.get.isConcurrentExecutionDisallowed()</td>
</tr>
<tr>
<td class="text-right small">Requests recovery</td>
Expand Down
8 changes: 4 additions & 4 deletions admin/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ javaOptions += s"-Dorg.quartz.properties=${(Compile / resourceDirectory).value /
libraryDependencies ++= Seq(
jdbc,
"org.ow2.asm" % "asm" % "8.0.1",
"ch.qos.logback" % "logback-classic" % "1.2.3",
"org.quartz-scheduler" % "quartz" % "2.3.2",
"org.quartz-scheduler" % "quartz-jobs" % "2.3.2",
"com.softwaremill.macwire" %% "macros" % "2.3.3" % "provided",
"ch.qos.logback" % "logback-classic" % "1.5.16",
"org.quartz-scheduler" % "quartz" % "2.5.0",
"org.quartz-scheduler" % "quartz-jobs" % "2.5.0",
"com.softwaremill.macwire" %% "macros" % "2.6.6" % "provided",
specs2 % Test
)

Expand Down
11 changes: 5 additions & 6 deletions admin/test/IntegrationSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ import play.api.test._
import play.api.test.Helpers._

/**
* add your integration spec here.
* An integration test will fire up a whole play application in a real (or headless) browser
* add your integration spec here. An integration test will fire up a whole play application in a real (or headless)
* browser
*/
class IntegrationSpec extends Specification {

"Application" should {

"work from within a browser" in new WithApplicationLoader(new PiezoAdminApplicationLoader) {
running(TestServer(3333, app), HTMLUNIT) { browser =>

override def running(): Unit = {
// Getting selenium exception
// https://groups.google.com/forum/#!msg/play-framework/ueXtbcG1oIo/Gc9yKQ4gd10J
//browser.goTo("http://localhost:3333/")
//browser.pageSource must contain("was created by")
// browser.goTo("http://localhost:3333/")
// browser.pageSource must contain("was created by")

success
}
Expand Down
43 changes: 25 additions & 18 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
import com.lucidchart.sbtcross.{Axis, CrossableProject, DefaultAxis}
import play.api.libs.json.Json

lazy val admin = project.dependsOn(worker_2_13).settings(scalaVersion := "2.13.5")
scalaVersion := "2.13.16"

lazy val admin = project.dependsOn(worker)

lazy val commonSettings = Seq(publishTo := sonatypePublishToBundle.value)

lazy val worker = project.cross
lazy val worker_2_11 = worker("2.11.12").settings(commonSettings)
lazy val worker_2_12 = worker("2.12.12").settings(commonSettings)
lazy val worker_2_13 = worker("2.13.5").settings(commonSettings)
lazy val worker = project.settings(publishTo := sonatypePublishToBundle.value)

PgpKeys.pgpPassphrase in Global := Some(Array.emptyCharArray)

inThisBuild(Seq(
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", System.getenv("SONATYPE_USERNAME"), System.getenv("SONATYPE_PASSWORD")),
developers ++= List(
Developer("lucidsoftware", "Lucid Software, Inc.", "", url("https://lucid.co/"))
inThisBuild(
Seq(
credentials += Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
System.getenv("SONATYPE_USERNAME"),
System.getenv("SONATYPE_PASSWORD"),
),
developers ++= List(
Developer("lucidsoftware", "Lucid Software, Inc.", "", url("https://lucid.co/")),
),
licenses += "Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"),
homepage := Some(url("https://github.com/lucidsoftware/piezo")),
organization := "com.lucidchart",
scalaVersion := "2.13.16",
scmInfo := Some(
ScmInfo(url("https://github.com/lucidsoftware/piezo"), "scm:git:git@github.com:lucidsoftware/piezo.git"),
),
version := sys.props.getOrElse("build.version", "0-SNAPSHOT"),
versionScheme := Some("early-semver"),
),
licenses += "Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"),
homepage := Some(url("https://github.com/lucidsoftware/piezo")),
organization := "com.lucidchart",
scalaVersion := "2.11.12",
scmInfo := Some(ScmInfo(url("https://github.com/lucidsoftware/piezo"), "scm:git:git@github.com:lucidsoftware/piezo.git")),
version := sys.props.getOrElse("build.version", "0-SNAPSHOT"),
versionScheme := Some("early-semver"),
))
)

publishTo := sonatypePublishToBundle.value
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.0
sbt.version=1.10.7
10 changes: 4 additions & 6 deletions project/build.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")

addSbtPlugin("com.lucidchart" % "sbt-cross" % "4.0")
addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.6")

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7")

libraryDependencies += "com.typesafe.play" %% "play-json" % "2.8.1"
libraryDependencies += "org.playframework" %% "play-json" % "3.0.4"

resolvers += Resolver.typesafeRepo("releases")
26 changes: 13 additions & 13 deletions worker/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ Compile / mainClass := Some("com.lucidchart.piezo.Worker")
run / connectInput := true

libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % "1.0.7" % Provided,
"org.quartz-scheduler" % "quartz" % "2.3.2",
"org.quartz-scheduler" % "quartz-jobs" % "2.3.2",
"org.slf4j" % "slf4j-api" % "1.7.25",
"org.specs2" %% "specs2-core" % "4.5.1" % Test,
"mysql" % "mysql-connector-java" % "8.0.32",
"ch.qos.logback" % "logback-classic" % "1.5.16" % Provided,
"org.quartz-scheduler" % "quartz" % "2.5.0",
"org.quartz-scheduler" % "quartz-jobs" % "2.5.0",
"com.zaxxer" % "HikariCP" % "5.0.1",
"org.slf4j" % "slf4j-api" % "2.0.16",
"org.specs2" %% "specs2-core" % "4.20.9" % Test,
"mysql" % "mysql-connector-java" % "8.0.33",
"javax.transaction" % "jta" % "1.1",
"joda-time" % "joda-time" % "2.8.1",
"org.joda" % "joda-convert" % "1.7",
"com.typesafe" % "config" % "1.0.0",
"com.datadoghq" % "java-dogstatsd-client" % "4.1.0",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.1.6"
"joda-time" % "joda-time" % "2.13.1",
"org.joda" % "joda-convert" % "3.0.1",
"com.typesafe" % "config" % "1.4.3",
"com.datadoghq" % "java-dogstatsd-client" % "4.4.3",
)

fork := true

javaOptions ++= Seq(
s"-Dpidfile.path=${File.createTempFile("piezoWorkerPid", null)}",
s"-Dcom.lucidchart.piezo.heartbeatfile=${File.createTempFile("piezoHeartbeat", null)}",
"-Dorg.quartz.properties=quartz.properties"
"-Dorg.quartz.properties=quartz.properties",
)

scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-Xlint"
"-Xlint",
)

Compile / unmanagedClasspath += sourceDirectory.value / "run" / "resources"
Expand Down
Loading