Skip to content

Commit ecc7a1d

Browse files
authored
Merge pull request #272 from bbc/gnm-rebase-20251008
Gnm rebase 20251008
2 parents 61c563e + 3736379 commit ecc7a1d

42 files changed

Lines changed: 2240 additions & 676 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
npm install-clean
7373
npm test
7474
npm run build
75-
- uses: guardian/actions-riff-raff@v4.1.7
75+
- uses: guardian/actions-riff-raff@v4.2.3
7676
if: "! github.event.pull_request.head.repo.fork"
7777
with:
7878
githubToken: ${{ secrets.GITHUB_TOKEN }}

build.sbt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ val commonSettings = Seq(
4040
"org.mockito" % "mockito-core" % "2.18.0" % Test,
4141
"org.scalamock" %% "scalamock" % "5.1.0" % Test,
4242
),
43-
dependencyOverrides += "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.17.2",
43+
dependencyOverrides += "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.19.0",
4444

4545
Compile / doc / sources := Seq.empty,
4646
Compile / packageDoc / publishArtifact := false
@@ -64,7 +64,7 @@ Global / concurrentRestrictions := Seq(
6464

6565
val awsSdkVersion = "1.12.470"
6666
val awsSdkV2Version = "2.31.12"
67-
val elastic4sVersion = "8.3.0"
67+
val elastic4sVersion = "8.18.2"
6868
val okHttpVersion = "3.12.1"
6969

7070
val bbcBuildProcess: Boolean = System.getenv().asScala.get("BUILD_ORG").contains("bbc")
@@ -88,9 +88,9 @@ lazy val commonLib = project("common-lib").settings(
8888
"com.amazonaws" % "aws-java-sdk-sts" % awsSdkVersion,
8989
"com.amazonaws" % "aws-java-sdk-dynamodb" % awsSdkVersion,
9090
"com.amazonaws" % "aws-java-sdk-kinesis" % awsSdkVersion,
91-
"com.sksamuel.elastic4s" %% "elastic4s-core" % elastic4sVersion,
92-
"com.sksamuel.elastic4s" %% "elastic4s-client-esjava" % elastic4sVersion,
93-
"com.sksamuel.elastic4s" %% "elastic4s-domain" % elastic4sVersion,
91+
"nl.gn0s1s" %% "elastic4s-core" % elastic4sVersion,
92+
"nl.gn0s1s" %% "elastic4s-client-esjava" % elastic4sVersion,
93+
"nl.gn0s1s" %% "elastic4s-domain" % elastic4sVersion,
9494
"com.gu" %% "thrift-serializer" % "5.0.2",
9595
"org.scalaz" %% "scalaz-core" % "7.3.8",
9696
"org.im4java" % "im4java" % "1.4.0",

common-lib/src/main/resources/application.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ play {
1717
assets.defaultCache="public, max-age=60"
1818
}
1919

20+
pekko.http.server.parsing.error-handler = "com.gu.mediaservice.lib.play.UnknownMethodParsingErrorHandler$"
21+
2022
es {
2123
cluster: media-service
2224
port: 9300

common-lib/src/main/scala/com/gu/mediaservice/lib/elasticsearch/ElasticSearchExecutions.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ trait ElasticSearchExecutions extends GridLogging {
2121

2222
val result = client.execute(request).transform {
2323
case Success(r) =>
24-
r.isSuccess match {
25-
case true => Success(r)
26-
case false => r.status match {
27-
case 404 if notFoundSuccessful => {
28-
logger.warn(s"No image found for $message.")
29-
Success(r)
30-
}
24+
if (r.isSuccess) {
25+
Success(r)
26+
} else {
27+
r.status match {
28+
case 404 if notFoundSuccessful =>
29+
logger.warn(logMarkers, s"No image found for $message.")
30+
Success(r)
3131
case 404 => Failure(ElasticNotFoundException)
3232
case _ => Failure(ElasticSearchException(r.error))
3333
}

image-loader/app/lib/UploadStatusTable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class UploadStatusTable(config: ImageLoaderConfig) {
2626

2727
def updateStatus(imageId: String, updateRequest: UploadStatus) = {
2828
val updateExpression = updateRequest.errorMessage match {
29-
case Some(error) => set("status", updateRequest.status) and set("errorMessages", error)
29+
case Some(error) => set("status", updateRequest.status) and set("errorMessage", error)
3030
case None => set("status", updateRequest.status)
3131
}
3232
val uploadStatusTableWithCondition =

kahuna/app/controllers/KahunaController.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package controllers
33
import com.gu.mediaservice.lib.argo.ArgoHelpers
44
import com.gu.mediaservice.lib.auth.Authentication.Principal
55
import com.gu.mediaservice.lib.auth.{Authentication, Authorisation, BaseControllerWithLoginRedirects}
6-
import lib.{ExampleSwitch, FeatureSwitches, KahunaConfig}
6+
import lib.{ExampleSwitch, UseCqlChips, FeatureSwitches, KahunaConfig}
77
import play.api.mvc.ControllerComponents
88
import play.api.libs.json._
99

@@ -38,7 +38,7 @@ class KahunaController(
3838

3939
val isIFramed = request.headers.get("Sec-Fetch-Dest").contains("iframe")
4040
val featureSwitches = new FeatureSwitches(
41-
List(ExampleSwitch)
41+
List(ExampleSwitch, UseCqlChips)
4242
)
4343
val featureSwitchesWithClientValues = featureSwitches.getClientSwitchValues(featureSwitches.getFeatureSwitchCookies(request.cookies.get))
4444
val featureSwitchesJson = Json.stringify(Json.toJson(featureSwitches.getFeatureSwitchesToStringify(featureSwitchesWithClientValues)))

kahuna/app/lib/FeatureSwitch.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ object ExampleSwitch extends FeatureSwitch(
1010
default = false
1111
)
1212

13+
object UseCqlChips extends FeatureSwitch(
14+
key = "use-cql-chips",
15+
title = "Use CQL for the chips interface",
16+
default = false
17+
)
18+
1319
class FeatureSwitches(featureSwitches: List[FeatureSwitch]){
1420
// Feature switches are defined here, but updated by setting a cookie following the pattern e.g. "feature-switch-my-key"
1521
// for a switch called "my-key".

0 commit comments

Comments
 (0)