Skip to content

Commit

Permalink
Add Prout to guardian/story-packages
Browse files Browse the repository at this point in the history
This is prompted by the outage caused by #184,
where new PROD instances of https://packages.gutools.co.uk/ couldn't
start up. Although more specific testing would catch this issue before
it went live, as a last resort, it's good to know that a pull request
has _not_ gone live after merging, and that's one of the things
Prout can help with - posting a 'OVERDUE' message against the PR.

See also:

* https://github.com/guardian/prout
* https://www.theguardian.com/info/developer-blog/2015/feb/03/prout-is-your-pull-request-out
* Other examples of configuring Prout:
  * guardian/mobile-apps-api#2507
  * guardian/apple-news#232
  • Loading branch information
rtyley committed Sep 15, 2023
1 parent 8411583 commit ac328c3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .prout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"checkpoints": {
"PROD": { "url": "https://packages.gutools.co.uk/_healthcheck", "overdue": "20M" }
}
}
3 changes: 2 additions & 1 deletion app/controllers/StatusController.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package controllers

import app.BuildInfo
import conf.ApplicationConfiguration
import play.api.libs.ws.WSClient
import play.api.mvc.ControllerComponents

class StatusController(config: ApplicationConfiguration, components: ControllerComponents, wsClient: WSClient) extends StoryPackagesBaseController(config, components, wsClient) {
def healthStatus = Action { request =>
Ok("Ok.")
Ok(s"Ok.\ngitCommitId:${BuildInfo.gitCommitId}")
}
}
8 changes: 7 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import scala.sys.env

name := "story-packages"

version := "1.0.0"
Expand Down Expand Up @@ -53,6 +55,10 @@ resolvers ++= Seq(
Resolver.file("Local", file(Path.userHome.absolutePath + "/.ivy2/local"))(Resolver.ivyStylePatterns)
)

buildInfoPackage := "app"
buildInfoOptions += BuildInfoOption.BuildTime
buildInfoKeys += "gitCommitId" -> env.getOrElse("GITHUB_SHA", "Unknown")

lazy val jacksonVersion = "2.13.4"
lazy val jacksonDatabindVersion = "2.13.4.2"

Expand Down Expand Up @@ -93,4 +99,4 @@ libraryDependencies ++= jacksonOverrides ++ Seq(
"org.scalatest" %% "scalatest" % "3.2.15" % "test"
)

lazy val root = (project in file(".")).enablePlugins(PlayScala, RiffRaffArtifact, JDebPackaging, SystemdPlugin)
lazy val root = (project in file(".")).enablePlugins(PlayScala, RiffRaffArtifact, JDebPackaging, SystemdPlugin, BuildInfoPlugin)
5 changes: 3 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ logLevel := Level.Warn

resolvers ++= Seq(
Classpaths.typesafeReleases,
Resolver.sonatypeRepo("releases"),
Resolver.typesafeRepo("releases")
)
) ++ Resolver.sonatypeOssRepos("releases")

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.19")

addSbtPlugin("com.gu" % "sbt-riffraff-artifact" % "1.1.12")

addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")

libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts (Artifact("jdeb", "jar", "jar"))

0 comments on commit ac328c3

Please sign in to comment.