Skip to content

Commit

Permalink
Merge pull request #292 from com-pas/develop
Browse files Browse the repository at this point in the history
merge develop into main
  • Loading branch information
juancho0202 authored Feb 27, 2024
2 parents 2dda752 + b2cbb49 commit 4faa981
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/automate-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
uses: actions/checkout@v4

- name: Cache Docker Register
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand All @@ -39,13 +39,13 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3
- name: Set up JDK 17
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'

- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v21
uses: whelk-io/maven-settings-xml-action@v22
with:
output_file: custom_maven_settings.xml
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,64 +1,81 @@
# 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

steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: maven
package-name: compas-scl-auto-alignment
- name: Checkout
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v4

- name: Cache Docker Register
uses: actions/cache@v3
if: ${{ steps.release.outputs.release_created }}
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
- name: Cache Maven packages
uses: actions/cache@v3
if: ${{ steps.release.outputs.release_created }}
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
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/<tag_name>.
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"

- name: Set up JDK 17
uses: actions/[email protected]
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
uses: whelk-io/maven-settings-xml-action@v21
if: ${{ steps.release.outputs.release_created }}
uses: whelk-io/maven-settings-xml-action@v22
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 }}
10 changes: 5 additions & 5 deletions .github/workflows/sonarcloud-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -54,20 +54,20 @@ jobs:
git checkout ${{ github.event.workflow_run.head_branch }}
git clean -ffdx && git reset --hard HEAD
- name: Cache SonarCloud packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up JDK 17
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand All @@ -79,7 +79,7 @@ jobs:
-Dsonar.projectKey=com-pas_compas-scl-auto-alignment \
-Dsonar.organization=com-pas )"
- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v21
uses: whelk-io/maven-settings-xml-action@v22
with:
output_file: custom_maven_settings.xml
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/sonarcloud-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ jobs:
fetch-depth: 0

- name: Cache SonarCloud packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
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'

- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v21
uses: whelk-io/maven-settings-xml-action@v22
with:
output_file: custom_maven_settings.xml
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
Expand All @@ -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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!--
SPDX-FileCopyrightText: 2023 Alliander N.V.
SPDX-License-Identifier: Apache-2.0
-->
For older changelogs, please check the release tag on GitHub.
11 changes: 11 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--
SPDX-FileCopyrightText: 2023 Alliander N.V.
SPDX-License-Identifier: Apache-2.0
-->
# Security Policy

## Reporting a Vulnerability

Please go to [Security Advisories](https://github.com/com-pas/compas-scl-auto-alignment/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.
2 changes: 1 addition & 1 deletion app/src/main/docker/Dockerfile.jvm
Original file line number Diff line number Diff line change
Expand Up @@ -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-1137

ARG JAVA_PACKAGE=java-17-openjdk-headless
ARG RUN_JAVA_VERSION=1.3.8
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/docker/Dockerfile.native
Original file line number Diff line number Diff line change
Expand Up @@ -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-1137
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ SPDX-License-Identifier: Apache-2.0
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<compiler-plugin.version>3.11.0</compiler-plugin.version>
<surefire-plugin.version>3.2.2</surefire-plugin.version>
<compiler-plugin.version>3.12.1</compiler-plugin.version>
<surefire-plugin.version>3.2.5</surefire-plugin.version>
<sonarqube-plugin.version>3.2.0</sonarqube-plugin.version>

<compas.core.version>0.16.0</compas.core.version>

<quarkus.platform.version>3.5.1</quarkus.platform.version>
<log4j2.version>2.21.1</log4j2.version>
<powsybl.sld.version>3.3.2</powsybl.sld.version>
<quarkus.platform.version>3.7.1</quarkus.platform.version>
<log4j2.version>2.23.0</log4j2.version>
<powsybl.sld.version>4.0.0</powsybl.sld.version>
<gson.version>2.10.1</gson.version>
<openpojo.version>0.9.1</openpojo.version>
</properties>
Expand Down Expand Up @@ -240,7 +240,7 @@ SPDX-License-Identifier: Apache-2.0
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.2</version>
<version>3.6.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import java.util.*;

public class SclAutoAlignmentDiagramLabelProvider implements DiagramLabelProvider {
public class SclAutoAlignmentDiagramLabelProvider implements LabelProvider {
private final Map<Node, List<NodeLabel>> busLabels = new HashMap<>();

public SclAutoAlignmentDiagramLabelProvider(SubstationGraph graph) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.powsybl.sld.layout.PositionVoltageLevelLayoutFactory;
import com.powsybl.sld.library.ConvergenceComponentLibrary;
import com.powsybl.sld.model.graphs.SubstationGraph;
import com.powsybl.sld.svg.SvgParameters;
import com.powsybl.sld.svg.styles.BasicStyleProvider;
import com.powsybl.sld.svg.DefaultSVGWriter;
import org.lfenergy.compas.core.commons.ElementConverter;
Expand Down Expand Up @@ -102,17 +103,14 @@ String createSVG(SubstationGraphBuilder substationGraphBuilder) {
configureLayout(graph, layoutParameters);

var writer = new StringWriter();
var svgWriter = new DefaultSVGWriter(new ConvergenceComponentLibrary(), layoutParameters);
svgWriter.write("", graph, new SclAutoAlignmentDiagramLabelProvider(graph), new BasicStyleProvider(), writer);
var svgWriter = new DefaultSVGWriter(new ConvergenceComponentLibrary(), layoutParameters, new SvgParameters());
svgWriter.write(graph, new SclAutoAlignmentDiagramLabelProvider(graph), new BasicStyleProvider(), writer);
return writer.toString();
}

private LayoutParameters getLayoutParameters() {
return new LayoutParameters()
.setAdaptCellHeightToContent(true)
.setShowInternalNodes(true)
.setCssLocation(LayoutParameters.CssLocation.INSERTED_IN_SVG)
.setShowInternalNodes(true);
.setAdaptCellHeightToContent(true);
}

private void configureLayout(SubstationGraph graph, LayoutParameters layoutParameters) {
Expand Down

0 comments on commit 4faa981

Please sign in to comment.