- 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
Feature/fdp 3417 message transformer #1
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
          
     Draft
      
      
            smvdheijden
  wants to merge
  10
  commits into
  main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
feature/FDP-3417-message-transformer
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Draft
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            10 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      7ea1cb6
              
                Adds initial spring boot project
              
              
                smvdheijden 9ae5e23
              
                FDP-3417 ~ Adds initial implementation
              
              
                smvdheijden 932d2e9
              
                FDP-3417 ~ Adds github actions
              
              
                smvdheijden 86cf7cc
              
                FDP-3417 ~ Adds jms pool dependency to integration tests
              
              
                smvdheijden 975874c
              
                FDP-3417 ~ Updates configuration
              
              
                smvdheijden 480a500
              
                FDP-3417 ~ Updates application.yaml
              
              
                smvdheijden 2363a1d
              
                FDP-3417 ~ Updates configuration
              
              
                smvdheijden 39f99d7
              
                FDP-3417 ~ Fixes sonar security hotspot warning
              
              
                smvdheijden 50da4c6
              
                FDP-3417 ~ Updates gradle action
              
              
                smvdheijden faa30b0
              
                FDP-3417 ~ Updates application.yaml
              
              
                smvdheijden File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| /gradlew text eol=lf | ||
| *.bat text eol=crlf | ||
| *.jar binary | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "gradle" | ||
| directory: "/" | ||
| open-pull-requests-limit: 10 | ||
| schedule: | ||
| interval: "daily" | ||
| groups: | ||
| all: | ||
| patterns: | ||
| - "*" | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| groups: | ||
| all: | ||
| patterns: | ||
| - "*" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Build Pipeline | ||
|  | ||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| tags: [ "v**" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|  | ||
| permissions: write-all | ||
|  | ||
| jobs: | ||
| build: | ||
| timeout-minutes: 30 | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up JDK 21 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| cache: 'gradle' | ||
| java-version: '21' | ||
| distribution: 'temurin' | ||
| - name: Setup Gradle to generate and submit dependency graphs | ||
| uses: gradle/actions/setup-gradle@v5 | ||
| with: | ||
| dependency-graph: generate-and-submit | ||
| - name: Build with Gradle | ||
| run: ./gradlew build aggregateTestCodeCoverageReport sonar | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| - name: Set Docker tag | ||
| id: tag | ||
| run: | | ||
| REF_NAME="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}" | ||
| TAG=$(echo "$REF_NAME" | tr '/' '-' | tr '[:upper:]' '[:lower:]') | ||
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | ||
| - name: Build Docker image | ||
| run: docker build -t ghcr.io/osgp/gxf-publiclighting-message-transformer:${{ steps.tag.outputs.tag }} . | ||
| - name: Log in to GitHub Container Registry | ||
| if: github.ref == 'refs/heads/main' || github.ref_type == 'tag' | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: echo "$GITHUB_TOKEN" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
| - name: Push Docker image | ||
| if: github.ref == 'refs/heads/main' || github.ref_type == 'tag' | ||
| run: docker push ghcr.io/osgp/gxf-publiclighting-message-transformer:${{ steps.tag.outputs.tag }} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: Automatic Gradle Wrapper Upgrade | ||
|  | ||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: '0 0 * * 0' | ||
|  | ||
| permissions: write-all | ||
|  | ||
| jobs: | ||
| upgradeGradleWrapper: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Git credentials | ||
| env: | ||
| TOKEN: ${{ secrets.GRADLE_WRAPPER_UPDATE_TOKEN}} | ||
| run: | | ||
| git config --global user.email "IoTFDP@alliander.com" | ||
| git config --global user.name "IOTFDP" | ||
| git config --global url."https://unused-username:${TOKEN}@github.com/".insteadOf "https://github.com/" | ||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v5 | ||
| - name: Upgrade Gradle Wrapper | ||
| run: ./gradlew upgradeGradleWrapperAll --info --stacktrace | ||
| env: | ||
| WRAPPER_UPGRADE_GIT_TOKEN: ${{ secrets.GRADLE_WRAPPER_UPDATE_TOKEN }} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| HELP.md | ||
| .gradle | ||
| build/ | ||
| !gradle/wrapper/gradle-wrapper.jar | ||
| !**/src/main/**/build/ | ||
| !**/src/test/**/build/ | ||
|  | ||
| ### STS ### | ||
| .apt_generated | ||
| .classpath | ||
| .factorypath | ||
| .project | ||
| .settings | ||
| .springBeans | ||
| .sts4-cache | ||
| bin/ | ||
| !**/src/main/**/bin/ | ||
| !**/src/test/**/bin/ | ||
|  | ||
| ### IntelliJ IDEA ### | ||
| .idea | ||
| *.iws | ||
| *.iml | ||
| *.ipr | ||
| out/ | ||
| !**/src/main/**/out/ | ||
| !**/src/test/**/out/ | ||
|  | ||
| ### NetBeans ### | ||
| /nbproject/private/ | ||
| /nbbuild/ | ||
| /dist/ | ||
| /nbdist/ | ||
| /.nb-gradle/ | ||
|  | ||
| ### VS Code ### | ||
| .vscode/ | ||
|  | ||
| ### Kotlin ### | ||
| .kotlin | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| FROM alpine/java:21-jre | ||
|  | ||
| WORKDIR /app | ||
|  | ||
| COPY build/libs/gxf-publiclighting-message-transformer.jar app.jar | ||
|  | ||
| ENTRYPOINT ["java", "-jar", "/app/app.jar"] | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,159 @@ | ||
| import com.diffplug.gradle.spotless.SpotlessExtension | ||
|  | ||
| plugins { | ||
| alias(libs.plugins.dependencyManagement) | ||
| alias(libs.plugins.gradleWrapperUpgrade) | ||
| alias(libs.plugins.jacoco) | ||
| alias(libs.plugins.jacocoReportAggregation) | ||
| alias(libs.plugins.kotlinSpring) | ||
| alias(libs.plugins.kotlinJvm) | ||
| alias(libs.plugins.sonarqube) | ||
| alias(libs.plugins.spotless) | ||
| alias(libs.plugins.springBoot) | ||
| alias(libs.plugins.javaTestFixtures) | ||
| `jvm-test-suite` | ||
| } | ||
|  | ||
| group = "org.lfenergy.gxf" | ||
| description = "GXF public lighting transformer between protobuf and object messages" | ||
|  | ||
| version = System.getenv("GITHUB_REF_NAME")?.replace("/", "-")?.lowercase() ?: "develop" | ||
|  | ||
| java { toolchain { languageVersion = JavaLanguageVersion.of(21) } } | ||
|  | ||
| sonar { | ||
| properties { | ||
| property("sonar.host.url", "https://sonarcloud.io") | ||
| property("sonar.projectKey", "OSGP_gxf-publiclighting-message-transformer") | ||
| property("sonar.organization", "gxf") | ||
| } | ||
| } | ||
|  | ||
| wrapperUpgrade { | ||
| gradle { | ||
| register("gxf-publiclighting-message-transformer") { | ||
| repo.set("OSGP/gxf-publiclighting-message-transformer") | ||
| baseBranch.set("main") | ||
| } | ||
| } | ||
| } | ||
|  | ||
| repositories { | ||
| mavenCentral() | ||
| maven { | ||
| name = "GXFGithubPackages" | ||
| url = uri("https://maven.pkg.github.com/osgp/*") | ||
| credentials { | ||
| username = project.findProperty("github.username") as String? ?: System.getenv("GITHUB_ACTOR") | ||
| password = project.findProperty("github.token") as String? ?: System.getenv("GITHUB_TOKEN") | ||
| } | ||
| } | ||
| } | ||
|  | ||
| dependencies { | ||
| developmentOnly(libs.springBootCompose) | ||
| developmentOnly(libs.springBootDevtools) | ||
|  | ||
| implementation("org.lfenergy.gxf:gxf-publiclighting-contracts-internal") | ||
|  | ||
| implementation(libs.kotlinLoggingJvm) | ||
| implementation(libs.kotlinReflect) | ||
| implementation(libs.pooledJms) | ||
| implementation(libs.protobufKotlin) | ||
| implementation(libs.springBootStarterActuator) | ||
| implementation(libs.springBootStarterArtemis) | ||
| implementation(libs.springModulithStarterCore) | ||
|  | ||
| runtimeOnly(libs.springModulithActuator) | ||
| runtimeOnly(libs.springModulithObservability) | ||
|  | ||
| annotationProcessor(libs.springBootConfigurationProcessor) | ||
|  | ||
| testFixturesImplementation(libs.protobufKotlin) | ||
| testFixturesImplementation("org.lfenergy.gxf:gxf-publiclighting-contracts-internal") | ||
|  | ||
| testImplementation(testFixtures(project)) | ||
|  | ||
| testImplementation(libs.assertJ) | ||
| testImplementation(libs.kotlinJunit) | ||
| testImplementation(libs.mockkJvm) | ||
| testImplementation(libs.mockkSpring) | ||
| testImplementation(libs.springBootStarterTest) | ||
| testImplementation(libs.springModulithStarterTest) | ||
|  | ||
| testRuntimeOnly(libs.junitLauncher) | ||
| } | ||
|  | ||
| dependencyManagement { | ||
| imports { | ||
| mavenBom("org.springframework.modulith:spring-modulith-bom:${libs.versions.springModulith.get()}") | ||
| } | ||
| } | ||
|  | ||
| kotlin { compilerOptions { freeCompilerArgs.addAll("-Xjsr305=strict") } } | ||
|  | ||
| extensions.configure<SpotlessExtension> { | ||
| kotlin { | ||
| target("src/**/*.kt") | ||
| ktlint("1.6.0") | ||
|  | ||
| licenseHeaderFile(file("./spotless/license-header-template.kt")) | ||
| } | ||
| } | ||
|  | ||
| tasks.withType<Test> { useJUnitPlatform() } | ||
|  | ||
| tasks.named<Jar>("bootJar") { archiveFileName.set("gxf-publiclighting-message-transformer.jar") } | ||
|  | ||
| testing { | ||
| suites { | ||
| val integrationTest by registering(JvmTestSuite::class) { | ||
| useJUnitJupiter() | ||
| dependencies { | ||
| implementation(project()) | ||
| implementation(testFixtures(project())) | ||
|  | ||
| implementation("org.lfenergy.gxf:gxf-publiclighting-contracts-internal") | ||
|  | ||
| implementation(libs.assertJ) | ||
| implementation(libs.awaitility) | ||
| implementation(libs.pooledJms) | ||
| implementation(libs.protobufKotlin) | ||
| implementation(libs.springBootStarterArtemis) | ||
| implementation(libs.springBootStarterTest) | ||
| implementation(libs.springBootTestcontainers) | ||
| implementation(libs.testContainers) | ||
| implementation(libs.testContainersJUnit) | ||
| implementation(libs.testContainersArtemis) | ||
| } | ||
| targets { all { testTask.configure { shouldRunAfter("test") } } } | ||
| } | ||
| } | ||
|  | ||
| // Make `check` run integration tests | ||
| tasks.named("check") { dependsOn("integrationTest") } | ||
|  | ||
| // Jacoco code coverage report of unit and integration tests | ||
| tasks.register<JacocoReport>("aggregateTestCodeCoverageReport") { | ||
| description = "Generates code coverage report for all tests." | ||
| group = "Verification" | ||
| dependsOn("test", "integrationTest") | ||
|  | ||
| executionData( | ||
| fileTree(layout.buildDirectory.dir("jacoco")) { | ||
| include("test.exec", "test/*.exec", "*.exec") | ||
| }, | ||
| ) | ||
| sourceSets(sourceSets["main"]) | ||
| reports { | ||
| xml.required.set(true) | ||
| html.required.set(true) | ||
| } | ||
| // filter out generated classes if needed: | ||
| classDirectories.setFrom( | ||
| classDirectories.files.map { | ||
| fileTree(it) { exclude("**/generated/**") } | ||
| }, | ||
| ) | ||
| } | ||
| } | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| services: | ||
| artemis: | ||
| image: 'apache/activemq-artemis:latest' | ||
| container_name: artemis-container.gxf-publiclighting-message-transformer | ||
| environment: | ||
| - ARTEMIS_USERNAME=artemis | ||
| - ARTEMIS_PASSWORD=artemis | ||
| - ARTEMIS_MIN_MEMORY=512M | ||
| - ARTEMIS_MAX_MEMORY=512M | ||
| ports: | ||
| - '61616:61616' | ||
| - '58161:8161' | 
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not sure about the amount of additional setup the external
integrationTestfolder causes. More gradle config,testFixtures, additional dependencies etc. with no real gain.