Skip to content

Commit

Permalink
Merge pull request #138 from com-pas/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
Dennis Labordus authored Nov 10, 2021
2 parents 7b81bf8 + 650a437 commit 8e5a484
Show file tree
Hide file tree
Showing 22 changed files with 173 additions and 39 deletions.
58 changes: 44 additions & 14 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@

name: Build Project

on: push
on:
push:
branches:
- '**'
- '!main'
- '!develop'
pull_request:
branches:
- 'main'
- 'develop'

jobs:
build:
Expand All @@ -13,16 +22,37 @@ jobs:
timeout-minutes: 15

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.11
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: '11'
- 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 with Maven
run: ./mvnw -s custom_maven_settings.xml -B clean verify -Pnative
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker Register
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
- name: Cache Maven packages
uses: actions/[email protected]
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up JDK 1.11
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: '11'

- 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 Native with Maven
if: ${{ github.event_name == 'pull_request' }}
run: ./mvnw -s custom_maven_settings.xml -B clean verify -Pnative
- name: Build with Maven
if: ${{ github.event_name == 'push' }}
run: ./mvnw -s custom_maven_settings.xml -B clean verify
19 changes: 18 additions & 1 deletion .github/workflows/release-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,28 @@ jobs:
name: Build and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Cache Docker Register
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
- name: Cache Maven packages
uses: actions/[email protected]
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Extract tag name
id: extract_tagname
shell: bash
Expand All @@ -29,6 +45,7 @@ jobs:
with:
distribution: 'zulu'
java-version: '11'

- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v20
with:
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/sonarcloud-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@

name: SonarCloud Analysis

on: push
on:
push:
branches:
- '**'
- '!main'
- '!develop'
pull_request:
branches:
- 'main'
- 'develop'

jobs:
build:
Expand All @@ -13,9 +22,11 @@ jobs:
timeout-minutes: 15

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up JDK 11
uses: actions/[email protected]
with:
Expand All @@ -33,6 +44,7 @@ jobs:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v20
with:
Expand Down
2 changes: 1 addition & 1 deletion app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SPDX-License-Identifier: Apache-2.0
<packaging>jar</packaging>

<properties>
<quarkus.platform.version>2.3.0.Final</quarkus.platform.version>
<quarkus.platform.version>2.4.1.Final</quarkus.platform.version>

<quarkus.container-image.group>lfenergy</quarkus.container-image.group>
<quarkus.container-image.name>compas-scl-data-service</quarkus.container-image.name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI;

@Schema(description = "A request to create a new entry in the database containing the SCL Element content.")
@Schema(description = "Request to create a new entry in the database containing the SCL Element content.")
@XmlRootElement(name = "CreateRequest", namespace = SCL_DATA_SERVICE_V1_NS_URI)
@XmlAccessorType(XmlAccessType.FIELD)
public class CreateRequest {
Expand All @@ -24,10 +24,12 @@ public class CreateRequest {
@XmlElement(name = "Name", namespace = SCL_DATA_SERVICE_V1_NS_URI, required = true)
private String name;

@Schema(description = "Comment that will be added to the new history record.")
@Schema(description = "Comment that will be added to the new history record.", example = "New substation configuration for X")
@XmlElement(name = "Comment", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private String comment;

@Schema(description = "The XML Content of the SCL added as CDATA. The content should contain a XML according to the IEC 61850 standard.",
example = "<![CDATA[<SCL xmlns=\"http://www.iec.ch/61850/2003/SCL\">....</SCL>]]")
@XmlElement(name = "SclData", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private String sclData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
// SPDX-License-Identifier: Apache-2.0
package org.lfenergy.compas.scl.data.rest.v1.model;

import org.eclipse.microprofile.openapi.annotations.media.Schema;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI;

@Schema(description = "Response from creating a new entry in the database containing the SCL Element content.")
@XmlRootElement(name = "CreateResponse", namespace = SCL_DATA_SERVICE_V1_NS_URI)
@XmlAccessorType(XmlAccessType.FIELD)
public class CreateResponse {
@Schema(description = "The XML Content of the updated SCL added to the database. The content contains a XML according to the IEC 61850 standard.",
example = "<![CDATA[<SCL xmlns=\"http://www.iec.ch/61850/2003/SCL\">....</SCL>]]")
@XmlElement(name = "SclData", namespace = SCL_DATA_SERVICE_V1_NS_URI, required = true)
private String sclData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@

package org.lfenergy.compas.scl.data.rest.v1.model;

import org.eclipse.microprofile.openapi.annotations.media.Schema;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI;

@Schema(description = "Response from retrieving a SCL from the database containing the SCL Content.")
@XmlRootElement(name = "GetResponse", namespace = SCL_DATA_SERVICE_V1_NS_URI)
@XmlAccessorType(XmlAccessType.FIELD)
public class GetResponse {
@Schema(description = "The XML Content of the retrieved SCL from the database. The content contains a XML according to the IEC 61850 standard.",
example = "<![CDATA[<SCL xmlns=\"http://www.iec.ch/61850/2003/SCL\">....</SCL>]]")
@XmlElement(name = "SclData", namespace = SCL_DATA_SERVICE_V1_NS_URI, required = true)
private String sclData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SPDX-License-Identifier: Apache-2.0
package org.lfenergy.compas.scl.data.rest.v1.model;

import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.lfenergy.compas.scl.data.model.Item;

import javax.xml.bind.annotation.XmlAccessType;
Expand All @@ -13,9 +14,11 @@

import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI;

@Schema(description = "Response from retrieving a all SCL Meta Information for a SCL Type or all versions of a SCL.")
@XmlRootElement(name = "ListResponse", namespace = SCL_DATA_SERVICE_V1_NS_URI)
@XmlAccessorType(XmlAccessType.FIELD)
public class ListResponse {
@Schema(description = "List of found SCL Entries in the database.")
@XmlElement(name = "Item", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private List<Item> items;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@
// SPDX-License-Identifier: Apache-2.0
package org.lfenergy.compas.scl.data.rest.v1.model;

import org.eclipse.microprofile.openapi.annotations.media.Schema;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;

import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI;

@Schema(description = "Describing a type of SCL.")
@XmlAccessorType(XmlAccessType.FIELD)
public class Type {
@Schema(description = "The code of the SCL Type.", example = "SCD")
@XmlElement(name = "Code", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private String code;

@Schema(description = "The description of the SCL Type.", example = "Substation Configuration Description")
@XmlElement(name = "Description", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private String description;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// SPDX-License-Identifier: Apache-2.0
package org.lfenergy.compas.scl.data.rest.v1.model;

import org.eclipse.microprofile.openapi.annotations.media.Schema;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
Expand All @@ -12,9 +14,11 @@

import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI;

@Schema(description = "Response with the List of SCL Types.")
@XmlRootElement(name = "TypeListResponse", namespace = SCL_DATA_SERVICE_V1_NS_URI)
@XmlAccessorType(XmlAccessType.FIELD)
public class TypeListResponse {
@Schema(description = "List of SCL Types.")
@XmlElement(name = "Type", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private List<Type> types = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@

import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI;

@Schema(description = "A request to update an existing entry in the database containing the SCL Element content. " +
@Schema(description = "Request to update an existing entry in the database containing the SCL Element content. " +
"A new version is created and the old version is also kept.")
@XmlRootElement(name = "UpdateRequest", namespace = SCL_DATA_SERVICE_V1_NS_URI)
@XmlAccessorType(XmlAccessType.FIELD)
public class UpdateRequest {
@NotNull(message = "{org.lfenergy.compas.changeset.notnull.message}")
@Schema(description = "Indicates what kind of change is to determine the new version.",
@Schema(description = "Indicates what kind of change to determine the new version.",
example = "MAJOR")
@XmlElement(name = "ChangeSet", namespace = SCL_DATA_SERVICE_V1_NS_URI, required = true)
private ChangeSetType changeSetType;

@Schema(description = "Comment that will be added to the new history record.")
@Schema(description = "Comment that will be added to the new history record.", example = "Renamed substation names")
@XmlElement(name = "Comment", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private String comment;

@Schema(description = "The XML Content of the SCL added as CDATA. The content should contain a XML according to the IEC 61850 standard.",
example = "<![CDATA[<SCL xmlns=\"http://www.iec.ch/61850/2003/SCL\">....</SCL>]]")
@XmlElement(name = "SclData", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private String sclData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@

package org.lfenergy.compas.scl.data.rest.v1.model;

import org.eclipse.microprofile.openapi.annotations.media.Schema;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI;

@Schema(description = "Response from updating a new entry in the database containing the SCL Element content.")
@XmlRootElement(name = "UpdateResponse", namespace = SCL_DATA_SERVICE_V1_NS_URI)
@XmlAccessorType(XmlAccessType.FIELD)
public class UpdateResponse {
@Schema(description = "The XML Content of the updated SCL added to the database. The content contains a XML according to the IEC 61850 standard.",
example = "<![CDATA[<SCL xmlns=\"http://www.iec.ch/61850/2003/SCL\">....</SCL>]]")
@XmlElement(name = "SclData", namespace = SCL_DATA_SERVICE_V1_NS_URI, required = true)
private String sclData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@

import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI;

@Schema(description = "Response with User information, like name and session timeouts.")
@XmlRootElement(name = "UserInfoResponse", namespace = SCL_DATA_SERVICE_V1_NS_URI)
@XmlAccessorType(XmlAccessType.FIELD)
public class UserInfoResponse {
@Schema(description = "The name of the user retrieved from the JWT Claim.")
@Schema(description = "The name of the user retrieved from the JWT Claim.",
example = "John Johnson")
@XmlElement(name = "Name", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private String name;

@Schema(description = "The number of minutes when the frontend isn't used and a warning message will be shown.")
@Schema(description = "The number of minutes when the frontend isn't used and a warning message will be shown.",
example = "20")
@XmlElement(name = "SessionWarning", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private int sessionWarning;

@Schema(description = "The number of minutes when the session will expire and a expired message will be shown if the frontend isn't used.")
@Schema(description = "The number of minutes when the session will expire and a expired message will be shown if the frontend isn't used.",
example = "30")
@XmlElement(name = "SessionExpires", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private int sessionExpires;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SPDX-License-Identifier: Apache-2.0
package org.lfenergy.compas.scl.data.rest.v1.model;

import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.lfenergy.compas.scl.data.model.Item;

import javax.xml.bind.annotation.XmlAccessType;
Expand All @@ -13,9 +14,11 @@

import static org.lfenergy.compas.scl.data.SclDataServiceConstants.SCL_DATA_SERVICE_V1_NS_URI;

@Schema(description = "Response with a list of versions stored for a specific SCL.")
@XmlRootElement(name = "VersionsResponse", namespace = SCL_DATA_SERVICE_V1_NS_URI)
@XmlAccessorType(XmlAccessType.FIELD)
public class VersionsResponse {
@Schema(description = "List of found Versions of a specific SCL in the database.")
@XmlElement(name = "Item", namespace = SCL_DATA_SERVICE_V1_NS_URI)
private List<Item> items;

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ quarkus.http.auth.permission.deny-default.policy=deny
quarkus.http.auth.permission.allow-quarkus-services.paths=/compas-scl-data-service/q/health/live,/compas-scl-data-service/q/health/ready,/compas-scl-data-service/q/openapi
quarkus.http.auth.permission.allow-quarkus-services.policy=permit

%dev.quarkus.http.auth.permission.develop-quarkus-services.paths=/compas-scl-data-service/q/swagger-ui/*,/compas-scl-data-service/index.html
%dev.quarkus.http.auth.permission.develop-quarkus-services.policy=permit

quarkus.http.auth.permission.common.paths=/compas-scl-data-service/common/v1/*
quarkus.http.auth.permission.common.policy=authenticated

Expand Down
Loading

0 comments on commit 8e5a484

Please sign in to comment.