From ceac542a84830ecda0f50f9c49f48348a530f53a Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Sun, 22 Dec 2024 21:53:03 -0500 Subject: [PATCH 1/2] rename frauddetectionservice to fraud-detection --- .env | 2 +- .github/workflows/component-build-images.yml | 4 ++-- .gitignore | 2 +- docker-compose-tests.yml | 2 +- docker-compose.yml | 12 ++++++------ renovate.json5 | 4 ++-- .../.dockerignore | 0 .../Dockerfile | 6 +++--- .../README.md | 2 +- .../build.gradle.kts | 4 ++-- .../gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 0 .../gradlew | 0 .../gradlew.bat | 0 src/fraud-detection/settings.gradle.kts | 3 +++ .../src/main/kotlin/frauddetection}/main.kt | 4 ++-- .../src/main/resources/log4j2.xml | 0 src/frauddetectionservice/settings.gradle.kts | 3 --- 19 files changed, 24 insertions(+), 24 deletions(-) rename src/{frauddetectionservice => fraud-detection}/.dockerignore (100%) rename src/{frauddetectionservice => fraud-detection}/Dockerfile (77%) rename src/{frauddetectionservice => fraud-detection}/README.md (85%) rename src/{frauddetectionservice => fraud-detection}/build.gradle.kts (95%) rename src/{frauddetectionservice => fraud-detection}/gradle.properties (100%) rename src/{frauddetectionservice => fraud-detection}/gradle/wrapper/gradle-wrapper.jar (100%) rename src/{frauddetectionservice => fraud-detection}/gradle/wrapper/gradle-wrapper.properties (100%) rename src/{frauddetectionservice => fraud-detection}/gradlew (100%) rename src/{frauddetectionservice => fraud-detection}/gradlew.bat (100%) create mode 100644 src/fraud-detection/settings.gradle.kts rename src/{frauddetectionservice/src/main/kotlin/frauddetectionservice => fraud-detection/src/main/kotlin/frauddetection}/main.kt (97%) rename src/{frauddetectionservice => fraud-detection}/src/main/resources/log4j2.xml (100%) delete mode 100644 src/frauddetectionservice/settings.gradle.kts diff --git a/.env b/.env index b011c764dc..94f9fd001d 100644 --- a/.env +++ b/.env @@ -74,7 +74,7 @@ EMAIL_SERVICE_ADDR=http://emailservice:${EMAIL_SERVICE_PORT} EMAIL_SERVICE_DOCKERFILE=./src/emailservice/Dockerfile # Fraud Service -FRAUD_SERVICE_DOCKERFILE=./src/frauddetectionservice/Dockerfile +FRAUD_DOCKERFILE=./src/fraud-detection/Dockerfile # Frontend FRONTEND_PORT=8080 diff --git a/.github/workflows/component-build-images.yml b/.github/workflows/component-build-images.yml index 1ebd177346..53a0db2f97 100644 --- a/.github/workflows/component-build-images.yml +++ b/.github/workflows/component-build-images.yml @@ -75,8 +75,8 @@ jobs: tag_suffix: emailservice context: ./ setup-qemu: true - - file: ./src/frauddetectionservice/Dockerfile - tag_suffix: frauddetectionservice + - file: ./src/fraud-detection/Dockerfile + tag_suffix: fraud-detection context: ./ setup-qemu: true - file: ./src/frontend/Dockerfile diff --git a/.gitignore b/.gitignore index 0e791dd5dd..a7c2a831f9 100644 --- a/.gitignore +++ b/.gitignore @@ -49,7 +49,7 @@ test/tracetesting/tracetesting-vars.yaml /src/featureflagservice/src/ffs_demo_pb.erl /src/featureflagservice/src/ffs_service_*.erl /src/featureflagservice/src/oteldemo_*.erl -/src/frauddetectionservice/src/main/proto +/src/fraud-detection/src/main/proto /src/frontend/pb/ /src/frontend/protos/ /src/paymentservice/demo.proto diff --git a/docker-compose-tests.yml b/docker-compose-tests.yml index 31fd9a80ab..5433c4160a 100644 --- a/docker-compose-tests.yml +++ b/docker-compose-tests.yml @@ -69,7 +69,7 @@ services: condition: service_started emailservice: condition: service_started - frauddetectionservice: + fraud-detection: condition: service_started frontend: condition: service_started diff --git a/docker-compose.yml b/docker-compose.yml index 722afe90dc..02aa37bb38 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -220,14 +220,14 @@ services: logging: *logging # Fraud Detection service - frauddetectionservice: - image: ${IMAGE_NAME}:${DEMO_VERSION}-frauddetectionservice - container_name: frauddetection-service + fraud-detection: + image: ${IMAGE_NAME}:${DEMO_VERSION}-fraud-detection + container_name: fraud-detection build: context: ./ - dockerfile: ${FRAUD_SERVICE_DOCKERFILE} + dockerfile: ${FRAUD_DOCKERFILE} cache_from: - - ${IMAGE_NAME}:${IMAGE_VERSION}-frauddetectionservice + - ${IMAGE_NAME}:${IMAGE_VERSION}-fraud-detection args: OTEL_JAVA_AGENT_VERSION: ${OTEL_JAVA_AGENT_VERSION} deploy: @@ -244,7 +244,7 @@ services: - OTEL_INSTRUMENTATION_KAFKA_EXPERIMENTAL_SPAN_ATTRIBUTES=true - OTEL_INSTRUMENTATION_MESSAGING_EXPERIMENTAL_RECEIVE_TELEMETRY_ENABLED=true - OTEL_RESOURCE_ATTRIBUTES - - OTEL_SERVICE_NAME=frauddetectionservice + - OTEL_SERVICE_NAME=fraud-detection depends_on: otel-collector: condition: service_started diff --git a/renovate.json5 b/renovate.json5 index de6ac5c52a..5a0d3bf074 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -43,8 +43,8 @@ "groupName": "featureflagservice", }, { - "matchFileNames": ["src/frauddetectionservice/**"], - "groupName": "frauddetectionservice", + "matchFileNames": ["src/fraud-detection/**"], + "groupName": "fraud-detection", }, { "matchFileNames": ["src/frontend/**"], diff --git a/src/frauddetectionservice/.dockerignore b/src/fraud-detection/.dockerignore similarity index 100% rename from src/frauddetectionservice/.dockerignore rename to src/fraud-detection/.dockerignore diff --git a/src/frauddetectionservice/Dockerfile b/src/fraud-detection/Dockerfile similarity index 77% rename from src/frauddetectionservice/Dockerfile rename to src/fraud-detection/Dockerfile index 1d2a9b58da..abf2029459 100644 --- a/src/frauddetectionservice/Dockerfile +++ b/src/fraud-detection/Dockerfile @@ -6,7 +6,7 @@ FROM --platform=${BUILDPLATFORM} gradle:8-jdk17 AS builder WORKDIR /usr/src/app/ -COPY ./src/frauddetectionservice/ ./ +COPY ./src/fraud-detection/ ./ COPY ./pb/ ./src/main/proto/ RUN gradle shadowJar @@ -17,8 +17,8 @@ FROM gcr.io/distroless/java17-debian11 ARG OTEL_JAVA_AGENT_VERSION WORKDIR /usr/src/app/ -COPY --from=builder /usr/src/app/build/libs/frauddetectionservice-1.0-all.jar ./ +COPY --from=builder /usr/src/app/build/libs/fraud-detection-1.0-all.jar ./ ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_JAVA_AGENT_VERSION/opentelemetry-javaagent.jar /app/opentelemetry-javaagent.jar ENV JAVA_TOOL_OPTIONS=-javaagent:/app/opentelemetry-javaagent.jar -ENTRYPOINT [ "java", "-jar", "frauddetectionservice-1.0-all.jar" ] +ENTRYPOINT [ "java", "-jar", "fraud-detection-1.0-all.jar" ] diff --git a/src/frauddetectionservice/README.md b/src/fraud-detection/README.md similarity index 85% rename from src/frauddetectionservice/README.md rename to src/fraud-detection/README.md index d618203669..c844776c2e 100644 --- a/src/frauddetectionservice/README.md +++ b/src/fraud-detection/README.md @@ -17,5 +17,5 @@ cp -r ../../pb/ src/main/proto/ To build using Docker run from the repo root: ```sh -docker build -f ./src/frauddetectionservice/Dockerfile . +docker build -f ./src/fraud-detection/Dockerfile . ``` diff --git a/src/frauddetectionservice/build.gradle.kts b/src/fraud-detection/build.gradle.kts similarity index 95% rename from src/frauddetectionservice/build.gradle.kts rename to src/fraud-detection/build.gradle.kts index a9495fbd7c..d1dcc07a6b 100644 --- a/src/frauddetectionservice/build.gradle.kts +++ b/src/fraud-detection/build.gradle.kts @@ -90,9 +90,9 @@ protobuf { } application { - mainClass.set("frauddetectionservice.MainKt") + mainClass.set("frauddetection.MainKt") } tasks.jar { - manifest.attributes["Main-Class"] = "frauddetectionservice.MainKt" + manifest.attributes["Main-Class"] = "frauddetection.MainKt" } diff --git a/src/frauddetectionservice/gradle.properties b/src/fraud-detection/gradle.properties similarity index 100% rename from src/frauddetectionservice/gradle.properties rename to src/fraud-detection/gradle.properties diff --git a/src/frauddetectionservice/gradle/wrapper/gradle-wrapper.jar b/src/fraud-detection/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from src/frauddetectionservice/gradle/wrapper/gradle-wrapper.jar rename to src/fraud-detection/gradle/wrapper/gradle-wrapper.jar diff --git a/src/frauddetectionservice/gradle/wrapper/gradle-wrapper.properties b/src/fraud-detection/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from src/frauddetectionservice/gradle/wrapper/gradle-wrapper.properties rename to src/fraud-detection/gradle/wrapper/gradle-wrapper.properties diff --git a/src/frauddetectionservice/gradlew b/src/fraud-detection/gradlew similarity index 100% rename from src/frauddetectionservice/gradlew rename to src/fraud-detection/gradlew diff --git a/src/frauddetectionservice/gradlew.bat b/src/fraud-detection/gradlew.bat similarity index 100% rename from src/frauddetectionservice/gradlew.bat rename to src/fraud-detection/gradlew.bat diff --git a/src/fraud-detection/settings.gradle.kts b/src/fraud-detection/settings.gradle.kts new file mode 100644 index 0000000000..d9c4193dd3 --- /dev/null +++ b/src/fraud-detection/settings.gradle.kts @@ -0,0 +1,3 @@ + +rootProject.name = "fraud-detection" + diff --git a/src/frauddetectionservice/src/main/kotlin/frauddetectionservice/main.kt b/src/fraud-detection/src/main/kotlin/frauddetection/main.kt similarity index 97% rename from src/frauddetectionservice/src/main/kotlin/frauddetectionservice/main.kt rename to src/fraud-detection/src/main/kotlin/frauddetection/main.kt index 8f8223f518..ac36b66d44 100644 --- a/src/frauddetectionservice/src/main/kotlin/frauddetectionservice/main.kt +++ b/src/fraud-detection/src/main/kotlin/frauddetection/main.kt @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package frauddetectionservice +package frauddetection import org.apache.kafka.clients.consumer.ConsumerConfig.* import org.apache.kafka.clients.consumer.KafkaConsumer @@ -24,7 +24,7 @@ import dev.openfeature.sdk.Value import dev.openfeature.sdk.OpenFeatureAPI const val topic = "orders" -const val groupID = "frauddetectionservice" +const val groupID = "fraud-detection" private val logger: Logger = LogManager.getLogger(groupID) diff --git a/src/frauddetectionservice/src/main/resources/log4j2.xml b/src/fraud-detection/src/main/resources/log4j2.xml similarity index 100% rename from src/frauddetectionservice/src/main/resources/log4j2.xml rename to src/fraud-detection/src/main/resources/log4j2.xml diff --git a/src/frauddetectionservice/settings.gradle.kts b/src/frauddetectionservice/settings.gradle.kts deleted file mode 100644 index 1c98d2e2cf..0000000000 --- a/src/frauddetectionservice/settings.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ - -rootProject.name = "frauddetectionservice" - From 9fd9a6e27924cc50e32d86e1e6898b0110d3b5e6 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Sun, 22 Dec 2024 21:54:51 -0500 Subject: [PATCH 2/2] rename frauddetectionservice to fraud-detection --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 886de03eea..28d4178edc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,8 @@ the release. ([#1857](https://github.com/open-telemetry/opentelemetry-demo/pull/1857)) * [currency] rename currencyservice to currency ([#1858](https://github.com/open-telemetry/opentelemetry-demo/pull/1858)) +* [fraud-detection] rename frauddetectionservice to fraud-detection + ([#1862](https://github.com/open-telemetry/opentelemetry-demo/pull/1862)) ## 1.12.0