Skip to content

Commit aaaacf2

Browse files
author
Dennis Labordus
authored
Merge pull request #263 from com-pas/develop
New release
2 parents c499986 + e5ba886 commit aaaacf2

File tree

45 files changed

+750
-319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+750
-319
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2021 Alliander N.V.
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

.github/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2021 Alliander N.V.
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2021 Alliander N.V.
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -12,31 +12,17 @@ jobs:
1212

1313
if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
1414
steps:
15-
- name: add-new-issues-to-repository-based-project-column
16-
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
17-
if: github.event_name == 'issues' && github.event.action == 'opened'
18-
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20-
GITHUB_PROJECT_URL: https://github.com/com-pas/compas-scl-data-service/projects/1
21-
GITHUB_PROJECT_COLUMN_NAME: To do
22-
- name: add-new-pull-request-to-repository-based-project-column
23-
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
24-
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened'
25-
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
GITHUB_PROJECT_URL: https://github.com/com-pas/compas-scl-data-service/projects/1
28-
GITHUB_PROJECT_COLUMN_NAME: To do
2915
- name: add-new-issues-to-organization-based-project-column
30-
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
3116
if: github.event_name == 'issues' && github.event.action == 'opened'
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
34-
GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/1
35-
GITHUB_PROJECT_COLUMN_NAME: To do
17+
uses: alex-page/[email protected]
18+
with:
19+
project: CoMPAS Issues Overview Board
20+
column: To do
21+
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
3622
- name: add-new-pull-request-to-organization-based-project-column
37-
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
3823
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened'
39-
env:
40-
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
41-
GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/2
42-
GITHUB_PROJECT_COLUMN_NAME: To do
24+
uses: alex-page/[email protected]
25+
with:
26+
project: CoMPAS Pull Request Overview Board
27+
column: To do
28+
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}

.github/workflows/build-project.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2021 Alliander N.V.
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -22,9 +22,7 @@ jobs:
2222
steps:
2323
- name: Checkout
2424
uses: actions/checkout@v3
25-
- name: Set up Docker Buildx
26-
id: buildx
27-
uses: docker/setup-buildx-action@v2
25+
2826
- name: Cache Docker Register
2927
uses: actions/cache@v3
3028
with:
@@ -37,6 +35,9 @@ jobs:
3735
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
3836
restore-keys: ${{ runner.os }}-m2
3937

38+
- name: Set up Docker Buildx
39+
id: buildx
40+
uses: docker/setup-buildx-action@v2
4041
- name: Set up JDK 17
4142
uses: actions/setup-java@v3
4243
with:

.github/workflows/release-project.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2021 Alliander N.V.
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -17,14 +17,7 @@ jobs:
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v3
20-
- name: Set up Docker Buildx
21-
id: buildx
22-
uses: docker/setup-buildx-action@v2
23-
- name: Login to Docker Hub
24-
uses: docker/login-action@v2
25-
with:
26-
username: ${{ secrets.DOCKER_HUB_USERNAME }}
27-
password: ${{ secrets.DOCKER_HUB_TOKEN }}
20+
2821
- name: Cache Docker Register
2922
uses: actions/cache@v3
3023
with:
@@ -40,21 +33,30 @@ jobs:
4033
- name: Extract tag name
4134
id: extract_tagname
4235
shell: bash
43-
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
36+
# Extract the tag name from the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
4437
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
38+
4539
- name: Set up JDK 17
4640
uses: actions/setup-java@v3
4741
with:
4842
distribution: 'zulu'
4943
java-version: '17'
44+
- name: Set up Docker Buildx
45+
id: buildx
46+
uses: docker/setup-buildx-action@v2
47+
- name: Login to Docker Hub
48+
uses: docker/login-action@v2
49+
with:
50+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
51+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
5052

5153
- name: Create custom Maven Settings.xml
5254
uses: whelk-io/maven-settings-xml-action@v20
5355
with:
5456
output_file: custom_maven_settings.xml
5557
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
5658
- name: Set version with Maven
57-
run: mvn -B versions:set -DprocessAllModules=true -DnewVersion=${{ steps.extract_tagname.outputs.tagname }}
59+
run: ./mvnw -B versions:set -DprocessAllModules=true -DnewVersion=${{ steps.extract_tagname.outputs.tagname }}
5860
env:
5961
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6062
- name: Deploy with Maven to GitHub Packages and Docker Hub

.github/workflows/reuse.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2021 Alliander N.V.
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -10,6 +10,7 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
- name: REUSE Compliance Check
15-
uses: fsfe/reuse-action@v1
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
- name: REUSE Compliance Check
16+
uses: fsfe/reuse-action@v1

.github/workflows/sonarcloud-analysis.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2021 Alliander N.V.
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -30,11 +30,6 @@ jobs:
3030
with:
3131
fetch-depth: 0
3232

33-
- name: Set up JDK 17
34-
uses: actions/setup-java@v3
35-
with:
36-
distribution: 'zulu'
37-
java-version: '17'
3833
- name: Cache SonarCloud packages
3934
uses: actions/cache@v3
4035
with:
@@ -48,20 +43,43 @@ jobs:
4843
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
4944
restore-keys: ${{ runner.os }}-m2
5045

46+
- name: Set up JDK 17
47+
uses: actions/setup-java@v3
48+
with:
49+
distribution: 'zulu'
50+
java-version: '17'
51+
52+
- name: Set Common Sonar Variables
53+
id: sonar_env
54+
run: |
55+
echo "##[set-output name=sonar_opts;]$(echo -Dsonar.host.url=https://sonarcloud.io \
56+
-Dsonar.projectKey=com-pas_compas-scl-data-service \
57+
-Dsonar.organization=com-pas )"
5158
- name: Create custom Maven Settings.xml
5259
uses: whelk-io/maven-settings-xml-action@v20
5360
with:
5461
output_file: custom_maven_settings.xml
5562
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
56-
- name: Build and analyze
63+
- name: Build and analyze (Pull Request)
64+
if: ${{ github.event_name == 'pull_request' || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
68+
run: |
69+
./mvnw -B -s custom_maven_settings.xml -Psonar \
70+
${{ steps.sonar_env.outputs.sonar_opts }} \
71+
-Dsonar.pullrequest.branch=${{ github.ref_name }} \
72+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
73+
-Dsonar.pullrequest.base=${{ github.base_ref }} \
74+
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \
75+
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
76+
- name: Build and analyze (Push)
77+
if: ${{ github.event_name == 'push' }}
5778
env:
58-
GITHUB_USERNAME: "OWNER"
5979
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6080
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6181
run: |
62-
./mvnw -s custom_maven_settings.xml -B -Psonar \
63-
-Dsonar.projectKey=com-pas_compas-scl-data-service \
64-
-Dsonar.organization=com-pas \
65-
-Dsonar.host.url=https://sonarcloud.io \
66-
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
67-
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
82+
./mvnw -B -s custom_maven_settings.xml -Psonar \
83+
${{ steps.sonar_env.outputs.sonar_opts }} \
84+
-Dsonar.branch.name=${{ github.ref_name }} \
85+
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

app/src/test/java/org/lfenergy/compas/scl/data/rest/v1/CompasSclDataResourceAsEditorTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import java.io.IOException;
2424
import java.util.Collections;
25+
import java.util.List;
2526
import java.util.UUID;
2627

2728
import static io.restassured.RestAssured.given;
@@ -50,9 +51,10 @@ void list_WhenCalled_ThenItemResponseRetrieved() {
5051
var uuid = UUID.randomUUID();
5152
var name = "name";
5253
var version = "1.0.0";
54+
var labels = List.of("Label1");
5355

5456
when(compasSclDataService.list(type))
55-
.thenReturn(Collections.singletonList(new Item(uuid.toString(), name, version)));
57+
.thenReturn(Collections.singletonList(new Item(uuid.toString(), name, version, labels)));
5658

5759
var response = given()
5860
.pathParam(TYPE_PATH_PARAM, type)
@@ -66,6 +68,7 @@ void list_WhenCalled_ThenItemResponseRetrieved() {
6668
assertEquals(uuid.toString(), xmlPath.get("ListResponse.Item[0].Id"));
6769
assertEquals(name, xmlPath.get("ListResponse.Item[0].Name"));
6870
assertEquals(version, xmlPath.get("ListResponse.Item[0].Version"));
71+
assertEquals(labels.get(0), xmlPath.get("ListResponse.Item[0].Label"));
6972
verify(compasSclDataService, times(1)).list(type);
7073
}
7174

app/src/test/java/org/lfenergy/compas/scl/data/rest/v1/CompasSclDataResourceAsReaderTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import java.io.IOException;
2222
import java.util.Collections;
23+
import java.util.List;
2324
import java.util.UUID;
2425

2526
import static io.restassured.RestAssured.given;
@@ -42,9 +43,10 @@ void list_WhenCalled_ThenItemResponseRetrieved() {
4243
var uuid = UUID.randomUUID();
4344
var name = "name";
4445
var version = "1.0.0";
46+
var labels = List.of("Label1");
4547

4648
when(compasSclDataService.list(type))
47-
.thenReturn(Collections.singletonList(new Item(uuid.toString(), name, version)));
49+
.thenReturn(Collections.singletonList(new Item(uuid.toString(), name, version, labels)));
4850

4951
var response = given()
5052
.pathParam(TYPE_PATH_PARAM, type)
@@ -58,6 +60,7 @@ void list_WhenCalled_ThenItemResponseRetrieved() {
5860
assertEquals(uuid.toString(), xmlPath.get("ListResponse.Item[0].Id"));
5961
assertEquals(name, xmlPath.get("ListResponse.Item[0].Name"));
6062
assertEquals(version, xmlPath.get("ListResponse.Item[0].Version"));
63+
assertEquals(labels.get(0), xmlPath.get("ListResponse.Item[0].Label"));
6164
verify(compasSclDataService, times(1)).list(type);
6265
}
6366

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ SPDX-License-Identifier: Apache-2.0
2323
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
2424
<sonarqube-plugin.version>3.2.0</sonarqube-plugin.version>
2525

26-
<compas.core.version>0.9.1</compas.core.version>
26+
<compas.core.version>0.9.3</compas.core.version>
2727

28-
<quarkus.platform.version>2.11.2.Final</quarkus.platform.version>
28+
<quarkus.platform.version>2.12.3.Final</quarkus.platform.version>
2929
<jaxb-impl.version>2.3.6</jaxb-impl.version>
3030
<microprofile-openapi-api.version>3.0</microprofile-openapi-api.version>
31-
<slf4j.version>1.7.36</slf4j.version>
31+
<slf4j.version>2.0.2</slf4j.version>
3232
<openpojo.version>0.9.1</openpojo.version>
3333
</properties>
3434

@@ -178,7 +178,7 @@ SPDX-License-Identifier: Apache-2.0
178178
<plugin>
179179
<groupId>org.apache.maven.plugins</groupId>
180180
<artifactId>maven-jar-plugin</artifactId>
181-
<version>3.2.2</version>
181+
<version>3.3.0</version>
182182
<executions>
183183
<execution>
184184
<goals>
@@ -267,7 +267,7 @@ SPDX-License-Identifier: Apache-2.0
267267
<plugin>
268268
<groupId>org.apache.maven.plugins</groupId>
269269
<artifactId>maven-javadoc-plugin</artifactId>
270-
<version>3.4.0</version>
270+
<version>3.4.1</version>
271271
<executions>
272272
<execution>
273273
<id>attach-javadocs</id>

0 commit comments

Comments
 (0)