From 05b80905a672c3014436a92aee472bfca0ca3288 Mon Sep 17 00:00:00 2001 From: ORybak5 <12736698+ORybak5@users.noreply.github.com> Date: Wed, 20 May 2026 11:25:38 +0100 Subject: [PATCH 1/3] documentation update and small scripts and gradle cleanup --- .github/workflows/build_workflow.yml | 14 ++++++++++++++ README.md | 19 +++++++++++++------ service/build.gradle | 16 ++++++---------- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index 049a74d5..a2e9da58 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -8,6 +8,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: checkstyle: name: Checkstyle @@ -21,6 +25,10 @@ jobs: with: java-version: 21 distribution: 'temurin' + cache: gradle + + - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v4 - name: Checkstyle run: | @@ -56,6 +64,10 @@ jobs: with: java-version: 21 distribution: 'temurin' + cache: gradle + + - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v4 - name: Spotbugs run: | @@ -93,6 +105,7 @@ jobs: with: java-version: 21 distribution: 'temurin' + cache: gradle - name: Execute Unit Tests run: ./gradlew test jacocoTestReport --parallel --build-cache @@ -128,6 +141,7 @@ jobs: with: java-version: 21 distribution: 'temurin' + cache: gradle - name: Start Docker Dependencies env: diff --git a/README.md b/README.md index 003c83e9..12fb15f4 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,13 @@ The adaptor does not perform a PDS lookup/trace. You must perform the PDS lookup * JDK 21 * Docker +## Directory Conventions + +- Run service build/test commands from `service/` +- Run mock service build/test commands from `gpcc-mocks/` +- Run Docker helper scripts from `docker/` +- Use the repo Gradle Wrapper (`./gradlew` or `.\\gradlew.bat`) instead of a locally installed `gradle`. + ## Configuration The adaptor reads its configuration from environment variables. The following sections describe the environment variables @@ -114,22 +121,22 @@ Edit `vars.local.sh` / `vars.public.sh` to add any missing values e.g. Spine cer For local environment to run against mocks: ```bash +cd docker ./start-local-environment-mocks.sh ``` For local environment to run against GP Demonstrator 1.6.0: ```bash +cd docker ./start-local-environment-public.sh ``` -You can also run the docker-compose commands directly. +You can also run the Docker Compose commands directly. ## How to Run Tests -**Warning**: Gradle uses a [Build Cache](https://docs.gradle.org/current/userguide/build_cache.html) to re-use compile and -test outputs for faster builds. To re-run passing tests without making any code changes you must first run -`./gradlew clean` to clear the build cache. Otherwise, gradle uses the cached outputs from a previous test execution to -pass the build. +Gradle can re-use previous task outputs. To force a full re-run of tests without changing source files, use +`--rerun-tasks` (or run `clean` before the test command). You must run all Gradle commands from the `service/` directory. @@ -147,7 +154,7 @@ tests and after making any changes to the mocks project. The JUnit tests use ```shell script cd docker/ -docker-compose build gpcc-mocks +docker compose build gpcc-mocks ``` Then run the integration tests from within the IDE or using Gradle: diff --git a/service/build.gradle b/service/build.gradle index 47e290ab..737c3cf3 100644 --- a/service/build.gradle +++ b/service/build.gradle @@ -40,10 +40,8 @@ dependencies { implementation "com.heroku.sdk:env-keystore:1.1.12" implementation "org.apache.commons:commons-lang3:3.19.0" - implementation 'org.jetbrains:annotations:26.0.2' + implementation "org.jetbrains:annotations:26.0.2-1" testImplementation "io.projectreactor:reactor-test" - implementation ("org.apache.commons:commons-lang3:3.19.0") - implementation 'org.jetbrains:annotations:26.0.2-1' implementation 'com.github.spullara.mustache.java:compiler:0.9.14' spotbugs 'com.github.spotbugs:spotbugs:4.9.8' @@ -98,13 +96,11 @@ configurations { } tasks.register('integrationTest', Test) { - useJUnitPlatform() { - description = "Runs integration tests." - group = "verification" - - testClassesDirs = sourceSets.integrationTest.output.classesDirs - classpath = sourceSets.integrationTest.runtimeClasspath - } + description = "Runs integration tests." + group = "verification" + useJUnitPlatform() + testClassesDirs = sourceSets.integrationTest.output.classesDirs + classpath = sourceSets.integrationTest.runtimeClasspath shouldRunAfter test } From b17f665b7041e2f3a7417586466f4d20435c5a6a Mon Sep 17 00:00:00 2001 From: ORybak5 <12736698+ORybak5@users.noreply.github.com> Date: Wed, 20 May 2026 12:29:09 +0100 Subject: [PATCH 2/3] add gradle wrapper validation in build workflow --- .github/workflows/build_workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index a2e9da58..e74b8c9c 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -106,6 +106,8 @@ jobs: java-version: 21 distribution: 'temurin' cache: gradle + - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v4 - name: Execute Unit Tests run: ./gradlew test jacocoTestReport --parallel --build-cache From 614cda5ad8dfe1a6d46cb443acf09cb9a448eb06 Mon Sep 17 00:00:00 2001 From: ORybak5 <12736698+ORybak5@users.noreply.github.com> Date: Wed, 20 May 2026 12:31:30 +0100 Subject: [PATCH 3/3] removal of gradle validation --- .github/workflows/build_workflow.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index e74b8c9c..37512117 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -27,9 +27,6 @@ jobs: distribution: 'temurin' cache: gradle - - name: Validate Gradle Wrapper - uses: gradle/actions/wrapper-validation@v4 - - name: Checkstyle run: | ./gradlew checkStyleMain checkstyleTest checkstyleIntegrationTest --parallel @@ -66,9 +63,6 @@ jobs: distribution: 'temurin' cache: gradle - - name: Validate Gradle Wrapper - uses: gradle/actions/wrapper-validation@v4 - - name: Spotbugs run: | ./gradlew spotbugsMain spotbugsTest spotbugsIntegrationTest --parallel @@ -106,8 +100,6 @@ jobs: java-version: 21 distribution: 'temurin' cache: gradle - - name: Validate Gradle Wrapper - uses: gradle/actions/wrapper-validation@v4 - name: Execute Unit Tests run: ./gradlew test jacocoTestReport --parallel --build-cache