Skip to content

Commit

Permalink
Merge pull request #136 from com-pas/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
Dennis Labordus authored Sep 20, 2022
2 parents 7949e21 + 36c7995 commit 5dc30eb
Show file tree
Hide file tree
Showing 23 changed files with 197 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand Down
36 changes: 11 additions & 25 deletions .github/workflows/automate-projects.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -12,31 +12,17 @@ jobs:

if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
steps:
- name: add-new-issues-to-repository-based-project-column
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
if: github.event_name == 'issues' && github.event.action == 'opened'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PROJECT_URL: https://github.com/com-pas/compas-scl-auto-alignment/projects/1
GITHUB_PROJECT_COLUMN_NAME: To do
- name: add-new-pull-request-to-repository-based-project-column
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PROJECT_URL: https://github.com/com-pas/compas-scl-auto-alignment/projects/1
GITHUB_PROJECT_COLUMN_NAME: To do
- name: add-new-issues-to-organization-based-project-column
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
if: github.event_name == 'issues' && github.event.action == 'opened'
env:
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/1
GITHUB_PROJECT_COLUMN_NAME: To do
uses: alex-page/github-project-automation-plus@v0.8.1
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
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened'
env:
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/2
GITHUB_PROJECT_COLUMN_NAME: To do
uses: alex-page/github-project-automation-plus@v0.8.1
with:
project: CoMPAS Pull Request Overview Board
column: To do
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
11 changes: 6 additions & 5 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -22,9 +22,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker Register
uses: actions/cache@v3
with:
Expand All @@ -37,8 +35,11 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Set up JDK 17
uses: actions/setup-java@v3.4.1
uses: actions/setup-java@v3.5.0
with:
distribution: 'zulu'
java-version: '17'
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/release-project.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -16,14 +16,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Cache Docker Register
uses: actions/cache@v3
with:
Expand All @@ -39,13 +32,22 @@ jobs:
- name: Extract tag name
id: extract_tagname
shell: bash
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
# 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/setup-java@v3.4.1
uses: actions/setup-java@v3.5.0
with:
distribution: 'zulu'
java-version: '17'
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v20
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand Down
46 changes: 32 additions & 14 deletions .github/workflows/sonarcloud-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -30,11 +30,6 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v3.4.1
with:
distribution: 'zulu'
java-version: '17'
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
Expand All @@ -48,20 +43,43 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up JDK 17
uses: actions/setup-java@v3.5.0
with:
distribution: 'zulu'
java-version: '17'

- name: Set Common Sonar Variables
id: sonar_env
run: |
echo "##[set-output name=sonar_opts;]$(echo -Dsonar.host.url=https://sonarcloud.io \
-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@v20
with:
output_file: custom_maven_settings.xml
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
- name: Build and analyze
- name: Build and analyze (Pull Request)
if: ${{ github.event_name == 'pull_request' || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
./mvnw -B -s custom_maven_settings.xml -Psonar \
${{ steps.sonar_env.outputs.sonar_opts }} \
-Dsonar.pullrequest.branch=${{ github.ref_name }} \
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
-Dsonar.pullrequest.base=${{ github.base_ref }} \
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
- name: Build and analyze (Push)
if: ${{ github.event_name == 'push' }}
env:
GITHUB_USERNAME: "OWNER"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
./mvnw -s custom_maven_settings.xml -B -Psonar \
-Dsonar.projectKey=com-pas_compas-scl-auto-alignment \
-Dsonar.organization=com-pas \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
./mvnw -B -s custom_maven_settings.xml -Psonar \
${{ steps.sonar_env.outputs.sonar_opts }} \
-Dsonar.branch.name=${{ github.ref_name }} \
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ SPDX-License-Identifier: Apache-2.0
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
<sonarqube-plugin.version>3.2.0</sonarqube-plugin.version>

<compas.core.version>0.9.1</compas.core.version>
<compas.core.version>0.9.3</compas.core.version>

<quarkus.platform.version>2.11.2.Final</quarkus.platform.version>
<slf4j.version>1.7.36</slf4j.version>
<powsybl.sld.version>2.12.0</powsybl.sld.version>
<quarkus.platform.version>2.12.2.Final</quarkus.platform.version>
<slf4j.version>2.0.1</slf4j.version>
<powsybl.sld.version>2.13.0</powsybl.sld.version>
<gson.version>2.9.1</gson.version>
<openpojo.version>0.9.1</openpojo.version>
</properties>
Expand Down Expand Up @@ -147,7 +147,7 @@ SPDX-License-Identifier: Apache-2.0
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<version>3.3.0</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down Expand Up @@ -229,7 +229,7 @@ SPDX-License-Identifier: Apache-2.0
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

import com.powsybl.sld.model.graphs.NodeFactory;
import com.powsybl.sld.model.graphs.SubstationGraph;
import com.powsybl.sld.model.nodes.Feeder2WTLegNode;
import com.powsybl.sld.model.nodes.Feeder3WTLegNode;
import com.powsybl.sld.model.nodes.FeederNode;
import com.powsybl.sld.model.nodes.Node;
import org.lfenergy.compas.scl.auto.alignment.exception.SclAutoAlignmentException;
import org.lfenergy.compas.scl.auto.alignment.model.*;
Expand Down Expand Up @@ -70,8 +69,8 @@ private void createPowerTransformer(GenericPowerTransformer powerTransformer) {
NodeFactory.createMiddle2WTNode(getGraph(),
powerTransformer.getFullName(),
powerTransformer.getFullName(),
getFeeder2WTLegNode(tws.get(0)),
getFeeder2WTLegNode(tws.get(1)),
getFeederNode(tws.get(0)),
getFeederNode(tws.get(1)),
getVoltageLevelBuilder(tws.get(0)).getGraph().getVoltageLevelInfos(),
getVoltageLevelBuilder(tws.get(1)).getGraph().getVoltageLevelInfos(),
false));
Expand All @@ -81,19 +80,14 @@ private void createPowerTransformer(GenericPowerTransformer powerTransformer) {
NodeFactory.createMiddle3WTNode(getGraph(),
powerTransformer.getFullName(),
powerTransformer.getFullName(),
getFeeder3WTLegNode(tws.get(0)),
getFeeder3WTLegNode(tws.get(1)),
getFeeder3WTLegNode(tws.get(2))));
getFeederNode(tws.get(0)),
getFeederNode(tws.get(1)),
getFeederNode(tws.get(2))));
}
}

private Feeder2WTLegNode getFeeder2WTLegNode(GenericTransformerWinding transformerWinding) {
private FeederNode getFeederNode(GenericTransformerWinding transformerWinding) {
var connectivityNode = transformerWinding.getTerminals().get(0).getConnectivityNode();
return (Feeder2WTLegNode) getNodeByPath(connectivityNode);
}

private Feeder3WTLegNode getFeeder3WTLegNode(GenericTransformerWinding transformerWinding) {
var connectivityNode = transformerWinding.getTerminals().get(0).getConnectivityNode();
return (Feeder3WTLegNode) getNodeByPath(connectivityNode);
return (FeederNode) getNodeByPath(connectivityNode);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0
package org.lfenergy.compas.scl.auto.alignment.builder;

import com.powsybl.sld.library.ComponentTypeName;
import com.powsybl.sld.model.coordinate.Direction;
import com.powsybl.sld.model.graphs.BaseGraph;
import com.powsybl.sld.model.graphs.NodeFactory;
Expand Down Expand Up @@ -85,7 +84,7 @@ private void createConnectivityNode(GenericConnectivityNode connectivityNode) {
}
}, () ->
addNode(connectivityNode.getPathName(),
createFictitiousNode(connectivityNode.getPathName()))
createConnectivityNode(connectivityNode.getPathName()))
);
}

Expand Down Expand Up @@ -135,8 +134,8 @@ private void connectNode(Node node1, Node node2) {
getGraph().addEdge(node1, node2);
}

private FictitiousNode createFictitiousNode(String id) {
return NodeFactory.createFictitiousNode(getGraph(), id, id, id, ComponentTypeName.LINE);
private ConnectivityNode createConnectivityNode(String id) {
return NodeFactory.createConnectivityNode(getGraph(), id);
}

private FeederNode createLoad(String id, int order) {
Expand All @@ -145,16 +144,16 @@ private FeederNode createLoad(String id, int order) {
return fn;
}

public Feeder2WTLegNode createFeeder2WTLegNode(String id, FeederWithSideNode.Side side, int order,
Direction direction) {
Feeder2WTLegNode f2WTe = NodeFactory.createFeeder2WTLegNode(getGraph(), id + "_" + side, id, id, side);
public FeederNode createFeeder2WTLegNode(String id, NodeSide side, int order,
Direction direction) {
var f2WTe = NodeFactory.createFeeder2WTLegNode(getGraph(), id + "_" + side, id, id, side);
commonFeederSetting(f2WTe, id, order, direction);
return f2WTe;
}

public Feeder3WTLegNode createFeeder3WTLegNode(String id, FeederWithSideNode.Side side, int order,
Direction direction) {
Feeder3WTLegNode f3WTe = NodeFactory.createFeeder3WTLegNodeForSubstationDiagram(getGraph(), id + "_" + side, id, id, side);
public FeederNode createFeeder3WTLegNode(String id, NodeSide side, int order,
Direction direction) {
var f3WTe = NodeFactory.createFeeder3WTLegNodeForSubstationDiagram(getGraph(), id + "_" + side, id, id, side);
commonFeederSetting(f3WTe, id + side.getIntValue(), order, direction);
return f3WTe;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.w3c.dom.Attr;
import org.w3c.dom.Element;

import java.util.stream.Collectors;
import java.util.stream.IntStream;

import static org.lfenergy.compas.scl.auto.alignment.SclAutoAlignmentConstants.SCLXY_NS_URI;
Expand Down Expand Up @@ -34,7 +33,7 @@ public static void cleanSXYDeclarationAndAttributes(Element element) {
.filter(Attr.class::isInstance)
.map(Attr.class::cast)
.filter(attr -> SCLXY_NS_URI.equals(attr.getNamespaceURI()))
.collect(Collectors.toList());
.toList();
// Remove the attribute from the element.
attributesToRemove.forEach(element::removeAttributeNode);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.w3c.dom.Element;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class GenericBay extends AbstractGenericNameEntity<GenericVoltageLevel> {
Expand All @@ -33,7 +32,7 @@ public List<GenericConnectivityNode> getConnectivityNodes() {
if (connectivityNodes == null) {
connectivityNodes = getElementsStream("ConnectivityNode")
.map(element -> new GenericConnectivityNode(this, element))
.collect(Collectors.toList());
.toList();
}
return connectivityNodes;
}
Expand All @@ -42,7 +41,7 @@ public List<GenericConductingEquipment> getConductingEquipments() {
if (conductingEquipments == null) {
conductingEquipments = getElementsStream("ConductingEquipment")
.map(element -> new GenericConductingEquipment(this, element))
.collect(Collectors.toList());
.toList();
}
return conductingEquipments;
}
Expand Down
Loading

0 comments on commit 5dc30eb

Please sign in to comment.