diff --git a/.github/workflows/automate-projects.yml b/.github/workflows/automate-projects.yml index c907722c..ec1a05dd 100644 --- a/.github/workflows/automate-projects.yml +++ b/.github/workflows/automate-projects.yml @@ -14,14 +14,14 @@ jobs: steps: - name: add-new-issues-to-organization-based-project-column if: github.event_name == 'issues' && github.event.action == 'opened' - uses: alex-page/github-project-automation-plus@v0.8.3 + uses: alex-page/github-project-automation-plus@v0.9.0 with: project: CoMPAS Issues Overview Board column: To do repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }} - name: add-new-pull-request-to-organization-based-project-column if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened' - uses: alex-page/github-project-automation-plus@v0.8.3 + uses: alex-page/github-project-automation-plus@v0.9.0 with: project: CoMPAS Pull Request Overview Board column: To do diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index beb1ff34..76b2dc87 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -39,7 +39,7 @@ jobs: id: buildx uses: docker/setup-buildx-action@v3 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '17' diff --git a/.github/workflows/release-project.yml b/.github/workflows/release-please.yml similarity index 66% rename from .github/workflows/release-project.yml rename to .github/workflows/release-please.yml index 72998ed9..96ce3819 100644 --- a/.github/workflows/release-project.yml +++ b/.github/workflows/release-please.yml @@ -1,29 +1,38 @@ -# SPDX-FileCopyrightText: 2022 Alliander N.V. +# SPDX-FileCopyrightText: 2023 Alliander N.V. # # SPDX-License-Identifier: Apache-2.0 +on: + push: + branches: + - main -name: Release Project +permissions: + contents: write + pull-requests: write -on: - release: - types: [ released ] +name: release-please jobs: - push_to_registry: - name: Build and publish + release_please: runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - name: Checkout + - uses: google-github-actions/release-please-action@v4 + id: release + with: + release-type: maven + package-name: compas-cim-mapping + - if: ${{ steps.release.outputs.release_created }} + name: Checkout uses: actions/checkout@v4 - name: Cache Docker Register + if: ${{ steps.release.outputs.release_created }} uses: actions/cache@v3 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }} - name: Cache Maven packages + if: ${{ steps.release.outputs.release_created }} uses: actions/cache@v3 with: path: ~/.m2 @@ -31,35 +40,43 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Extract tag name + if: ${{ steps.release.outputs.release_created }} id: extract_tagname shell: bash # Extract the tag name from the git reference, value of GITHUB_REF will be something like refs/tags/. run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})" - name: Set up JDK 17 - uses: actions/setup-java@v3 + if: ${{ steps.release.outputs.release_created }} + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '17' - name: Set up Docker Buildx + if: ${{ steps.release.outputs.release_created }} id: buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub + if: ${{ steps.release.outputs.release_created }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Create custom Maven Settings.xml + if: ${{ steps.release.outputs.release_created }} uses: whelk-io/maven-settings-xml-action@v21 with: output_file: custom_maven_settings.xml servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]' - name: Set version with Maven + if: ${{ steps.release.outputs.release_created }} run: ./mvnw -B versions:set -DprocessAllModules=true -DnewVersion=${{ steps.extract_tagname.outputs.tagname }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Deploy with Maven to GitHub Packages and Docker Hub + if: ${{ steps.release.outputs.release_created }} run: ./mvnw -B -s custom_maven_settings.xml -Pnative-image,release clean deploy env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/sonarcloud-analysis.yml b/.github/workflows/sonarcloud-analysis.yml index 053375f5..31327482 100644 --- a/.github/workflows/sonarcloud-analysis.yml +++ b/.github/workflows/sonarcloud-analysis.yml @@ -19,7 +19,7 @@ jobs: run: cat $GITHUB_EVENT_PATH - name: Download PR number artifact if: github.event.workflow_run.event == 'pull_request' - uses: dawidd6/action-download-artifact@v2 + uses: dawidd6/action-download-artifact@v3 with: workflow: SonarCloud Build run_id: ${{ github.event.workflow_run.id }} @@ -67,7 +67,7 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '17' diff --git a/.github/workflows/sonarcloud-build.yml b/.github/workflows/sonarcloud-build.yml index 7228a740..7728d793 100644 --- a/.github/workflows/sonarcloud-build.yml +++ b/.github/workflows/sonarcloud-build.yml @@ -44,7 +44,7 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: '17' @@ -71,7 +71,7 @@ jobs: run: echo ${{ github.event.number }} > PR_NUMBER.txt - name: Archive PR number if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: PR_NUMBER path: PR_NUMBER.txt diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..8e721b55 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ + +For older changelogs, please check the release tag on GitHub. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..c3fefe39 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,11 @@ + +# Security Policy + +## Reporting a Vulnerability + +Please go to [Security Advisories](https://github.com/com-pas/compas-cim-mapping/security/advisories) to privately report a security vulnerability, +our contributors will try to respond within a week of your report with a rough plan for a fix and new tests. diff --git a/app/src/main/docker/Dockerfile.jvm b/app/src/main/docker/Dockerfile.jvm index 5decd9fc..8410bdf9 100644 --- a/app/src/main/docker/Dockerfile.jvm +++ b/app/src/main/docker/Dockerfile.jvm @@ -21,7 +21,7 @@ # docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/app-jvm # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-1072.1697626218 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9-1108 ARG JAVA_PACKAGE=java-17-openjdk-headless ARG RUN_JAVA_VERSION=1.3.8 diff --git a/app/src/main/docker/Dockerfile.native b/app/src/main/docker/Dockerfile.native index ddd95ff6..8a1278cc 100644 --- a/app/src/main/docker/Dockerfile.native +++ b/app/src/main/docker/Dockerfile.native @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/app # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-1072.1697626218 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9-1108 WORKDIR /work/ RUN chown 1001 /work \ && chmod "g+rwX" /work \ diff --git a/pom.xml b/pom.xml index 87ac6dfb..d79f381f 100644 --- a/pom.xml +++ b/pom.xml @@ -19,16 +19,16 @@ SPDX-License-Identifier: Apache-2.0 UTF-8 UTF-8 - 3.11.0 - 3.2.2 + 3.12.1 + 3.2.5 3.2.0 0.11.0 2.16.6.Final 3.1.1 - 5.1.1 - 2.21.1 + 6.1.1 + 2.22.1 1.5.5.Final 0.9.1 @@ -261,7 +261,7 @@ SPDX-License-Identifier: Apache-2.0 org.apache.maven.plugins maven-javadoc-plugin - 3.6.0 + 3.6.3 attach-javadocs diff --git a/service/src/test/java/org/lfenergy/compas/cim/mapping/mapper/CimToSclMapperContextTest.java b/service/src/test/java/org/lfenergy/compas/cim/mapping/mapper/CimToSclMapperContextTest.java index 2574ebb2..91bf5c25 100644 --- a/service/src/test/java/org/lfenergy/compas/cim/mapping/mapper/CimToSclMapperContextTest.java +++ b/service/src/test/java/org/lfenergy/compas/cim/mapping/mapper/CimToSclMapperContextTest.java @@ -38,7 +38,7 @@ void getSubstations_WhenCalled_ThenPropertyBagsIsConvertedToCgmesSubstation() { var substationName = "Name Substation"; var bags = new PropertyBags(); - var bag = new PropertyBag(List.of(SUBSTATION_PROP, NAME_PROP)); + var bag = new PropertyBag(List.of(SUBSTATION_PROP, NAME_PROP), true); bag.put(SUBSTATION_PROP, substationId); bag.put(NAME_PROP, substationName); bags.add(bag); @@ -60,7 +60,7 @@ void getVoltageLevelsBySubstation_WhenCalledWithKnownId_ThenPropertyBagsIsFilter var substationId = "Known Substation ID"; var bags = new PropertyBags(); - var bag = new PropertyBag(List.of(VOLTAGE_LEVEL_PROP, NAME_PROP, NOMINAL_VOLTAGE_PROP, SUBSTATION_PROP)); + var bag = new PropertyBag(List.of(VOLTAGE_LEVEL_PROP, NAME_PROP, NOMINAL_VOLTAGE_PROP, SUBSTATION_PROP), true); bag.put(VOLTAGE_LEVEL_PROP, voltageLevelId); bag.put(NAME_PROP, voltageLevelName); bag.put(NOMINAL_VOLTAGE_PROP, "1.0"); @@ -84,7 +84,7 @@ void getBusbarSectionsByEquipmentContainer_WhenSparQLReturnsBags_ThenPropertyBag var equipmentContainerId = "ContainerId"; var bags = new PropertyBags(); - var bag = new PropertyBag(List.of(BUSBARSECTION_PROP, NAME_PROP, EQUIPMENT_CONTAINER_PROP)); + var bag = new PropertyBag(List.of(BUSBARSECTION_PROP, NAME_PROP, EQUIPMENT_CONTAINER_PROP), true); bag.put(BUSBARSECTION_PROP, busbarSectionId); bag.put(NAME_PROP, busbarSectionName); bag.put(EQUIPMENT_CONTAINER_PROP, equipmentContainerId); @@ -107,7 +107,7 @@ void getBaysByVoltageLevel_WhenSparQLReturnsBags_ThenPropertyBagIsConvertedToCgm var voltageLevelId = "VoltageLevelId"; var bags = new PropertyBags(); - var bag = new PropertyBag(List.of(BAY_PROP, NAME_PROP, VOLTAGE_LEVEL_PROP)); + var bag = new PropertyBag(List.of(BAY_PROP, NAME_PROP, VOLTAGE_LEVEL_PROP), true); bag.put(BAY_PROP, bayId); bag.put(NAME_PROP, bayName); bag.put(VOLTAGE_LEVEL_PROP, voltageLevelId); @@ -131,7 +131,7 @@ void getTransformers_WhenSparQLReturnsBags_ThenPropertyBagIsConvertedToCgmesTran var pwContainerId = "Known Container ID"; var bags = new PropertyBags(); - var bag = new PropertyBag(List.of(POWER_TRANSFORMER_PROP, NAME_PROP, DESCRIPTION_PROP, EQUIPMENT_CONTAINER_PROP)); + var bag = new PropertyBag(List.of(POWER_TRANSFORMER_PROP, NAME_PROP, DESCRIPTION_PROP, EQUIPMENT_CONTAINER_PROP),true); bag.put(POWER_TRANSFORMER_PROP, pwId); bag.put(NAME_PROP, pwName); bag.put(DESCRIPTION_PROP, pwDesc); @@ -158,7 +158,7 @@ void getTransformerEnds_WhenCalledWithKnownId_ThenPropertyBagsIsFilteredOnIdAndC var endNumber = "1"; var bags = new PropertyBags(); - var bag = new PropertyBag(List.of(TRANSFORMER_END_PROP, NAME_PROP, POWER_TRANSFORMER_PROP, TERMINAL_PROP, END_NUMBER_PROP)); + var bag = new PropertyBag(List.of(TRANSFORMER_END_PROP, NAME_PROP, POWER_TRANSFORMER_PROP, TERMINAL_PROP, END_NUMBER_PROP), true); bag.put(TRANSFORMER_END_PROP, tfeId); bag.put(NAME_PROP, tfeName); bag.put(POWER_TRANSFORMER_PROP, tfId); @@ -200,7 +200,7 @@ void getTapChanger_WhenRatioTapChangersFound_ThenConvertedRatioTapChangerReturne var ratioBags = new PropertyBags(); - var bag = new PropertyBag(List.of(RATIO_TAP_CHANGER_PROP, NAME_PROP, TRANSFORMER_END_PROP)); + var bag = new PropertyBag(List.of(RATIO_TAP_CHANGER_PROP, NAME_PROP, TRANSFORMER_END_PROP), true); bag.put(RATIO_TAP_CHANGER_PROP, tcId); bag.put(NAME_PROP, tcName); bag.put(TRANSFORMER_END_PROP, tfeId); @@ -224,7 +224,7 @@ void getTapChanger_WhenNoRatioTapChangerFoundButPhaseTapChangersFound_ThenConver var ratioBags = new PropertyBags(); var phaseBags = new PropertyBags(); - var bag = new PropertyBag(List.of(PHASE_TAP_CHANGER_PROP, NAME_PROP, TRANSFORMER_END_PROP)); + var bag = new PropertyBag(List.of(PHASE_TAP_CHANGER_PROP, NAME_PROP, TRANSFORMER_END_PROP), true); bag.put(PHASE_TAP_CHANGER_PROP, tcId); bag.put(NAME_PROP, tcName); bag.put(TRANSFORMER_END_PROP, tfeId); @@ -246,7 +246,7 @@ void getConnectivityNodeByBusbarSection_WhenCalledWithKnownId_ThenPropertyBagsIs var busbarSectionId = "BusbarSection ID"; var bags = new PropertyBags(); - var bag = new PropertyBag(List.of(CONNECTIVITY_NODE_PROP, NAME_PROP, CONDUCTING_EQUIPMENT_PROP)); + var bag = new PropertyBag(List.of(CONNECTIVITY_NODE_PROP, NAME_PROP, CONDUCTING_EQUIPMENT_PROP), true); bag.put(CONNECTIVITY_NODE_PROP, ccnId); bag.put(NAME_PROP, ccnName); bag.put(CONDUCTING_EQUIPMENT_PROP, busbarSectionId); @@ -269,7 +269,7 @@ void getConnectivityNodeByBay_WhenCalledWithKnownId_ThenPropertyBagsIsConvertedT var bayID = "Bay ID"; var bags = new PropertyBags(); - var bag = new PropertyBag(List.of(CONNECTIVITY_NODE_PROP, NAME_PROP, EQUIPMENT_CONTAINER_PROP)); + var bag = new PropertyBag(List.of(CONNECTIVITY_NODE_PROP, NAME_PROP, EQUIPMENT_CONTAINER_PROP), true); bag.put(CONNECTIVITY_NODE_PROP, ccnId); bag.put(NAME_PROP, ccnName); bag.put(EQUIPMENT_CONTAINER_PROP, bayID); @@ -292,7 +292,7 @@ void getSwitches_WhenCalledWithKnownId_ThenPropertyBagsIsFilteredOnIdAndConverte var containerId = "Known Container ID"; var bags = new PropertyBags(); - var bag = new PropertyBag(List.of(SWITCH_PROP, NAME_PROP, TYPE_PROP, EQUIPMENT_CONTAINER_PROP)); + var bag = new PropertyBag(List.of(SWITCH_PROP, NAME_PROP, TYPE_PROP, EQUIPMENT_CONTAINER_PROP), true); bag.put(SWITCH_PROP, switchId); bag.put(NAME_PROP, switchName); bag.put(TYPE_PROP, "Breaker"); @@ -317,7 +317,7 @@ void getTerminalsByConductingEquipment_WhenCalledWithKnownId_ThenPropertyBagsIsF var containerId = "Known Container ID"; var bags = new PropertyBags(); - var bag = new PropertyBag(List.of(TERMINAL_PROP, NAME_PROP, CONNECTIVITY_NODE_PROP)); + var bag = new PropertyBag(List.of(TERMINAL_PROP, NAME_PROP, CONNECTIVITY_NODE_PROP), true); bag.put(TERMINAL_PROP, terminalId); bag.put(NAME_PROP, terminalName); bag.put(CONNECTIVITY_NODE_PROP, ccnNode); @@ -343,7 +343,7 @@ void getTerminalById_WhenCalledWithKnownId_ThenPropertyBagsIsFilteredOnIdAndConv var ccnNode = "Connectivity Node ID"; var bags = new PropertyBags(); - var bag = new PropertyBag(List.of(TERMINAL_PROP, NAME_PROP, CONNECTIVITY_NODE_PROP)); + var bag = new PropertyBag(List.of(TERMINAL_PROP, NAME_PROP, CONNECTIVITY_NODE_PROP), true); bag.put(TERMINAL_PROP, terminalId); bag.put(NAME_PROP, terminalName); bag.put(CONNECTIVITY_NODE_PROP, ccnNode);