Skip to content

Commit 964e308

Browse files
authored
Merge pull request #351 from com-pas/develop
Merge `develop` into `main`
2 parents 4e462f8 + 6cc1f66 commit 964e308

File tree

80 files changed

+397
-301
lines changed

Some content is hidden

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

80 files changed

+397
-301
lines changed

.github/workflows/build-project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- name: Set up Docker Buildx
3939
id: buildx
40-
uses: docker/setup-buildx-action@v2
40+
uses: docker/setup-buildx-action@v3
4141
- name: Set up JDK 17
4242
uses: actions/setup-java@v3
4343
with:

.github/workflows/release-project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
java-version: '17'
4444
- name: Set up Docker Buildx
4545
id: buildx
46-
uses: docker/setup-buildx-action@v2
46+
uses: docker/setup-buildx-action@v3
4747
- name: Login to Docker Hub
4848
uses: docker/login-action@v2
4949
with:

.github/workflows/reuse.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v3
1515
- name: REUSE Compliance Check
16-
uses: fsfe/reuse-action@v1
16+
uses: fsfe/reuse-action@v2

.github/workflows/sonarcloud-analysis.yml

+95-71
Original file line numberDiff line numberDiff line change
@@ -4,82 +4,106 @@
44

55
name: SonarCloud Analysis
66

7-
on:
8-
push:
9-
branches:
10-
- '**'
11-
pull_request:
12-
branches:
13-
- 'main'
14-
- 'develop'
15-
pull_request_target:
16-
branches:
17-
- 'main'
18-
- 'develop'
7+
on:
8+
workflow_run:
9+
workflows: [SonarCloud Build]
10+
types: [completed]
1911

2012
jobs:
2113
sonar-check:
22-
name: Sonar Check
2314
runs-on: ubuntu-latest
15+
if: github.event.workflow_run.conclusion == 'success'
2416
timeout-minutes: 15
25-
26-
if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
2717
steps:
28-
- name: Checkout
29-
uses: actions/checkout@v3
30-
with:
31-
fetch-depth: 0
32-
33-
- name: Cache SonarCloud packages
34-
uses: actions/cache@v3
35-
with:
36-
path: ~/.sonar/cache
37-
key: ${{ runner.os }}-sonar
38-
restore-keys: ${{ runner.os }}-sonar
39-
- name: Cache Maven packages
40-
uses: actions/cache@v3
41-
with:
42-
path: ~/.m2
43-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
44-
restore-keys: ${{ runner.os }}-m2
18+
- name: echo event
19+
run: cat $GITHUB_EVENT_PATH
20+
- name: Download PR number artifact
21+
if: github.event.workflow_run.event == 'pull_request'
22+
uses: dawidd6/action-download-artifact@v2
23+
with:
24+
workflow: SonarCloud Build
25+
run_id: ${{ github.event.workflow_run.id }}
26+
name: PR_NUMBER
27+
- name: Read PR_NUMBER.txt
28+
if: github.event.workflow_run.event == 'pull_request'
29+
id: pr_number
30+
uses: juliangruber/read-file-action@v1
31+
with:
32+
path: ./PR_NUMBER.txt
33+
- name: Request GitHub API for PR data
34+
if: github.event.workflow_run.event == 'pull_request'
35+
uses: octokit/[email protected]
36+
id: get_pr_data
37+
with:
38+
route: GET /repos/{full_name}/pulls/{number}
39+
number: ${{ steps.pr_number.outputs.content }}
40+
full_name: ${{ github.event.repository.full_name }}
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
- uses: actions/checkout@v3
44+
with:
45+
repository: ${{ github.event.workflow_run.head_repository.full_name }}
46+
ref: ${{ github.event.workflow_run.head_branch }}
47+
fetch-depth: 0
48+
- name: Checkout base branch
49+
if: github.event.workflow_run.event == 'pull_request'
50+
run: |
51+
git remote add upstream ${{ github.event.repository.clone_url }}
52+
git fetch upstream
53+
git checkout -B ${{ fromJson(steps.get_pr_data.outputs.data).base.ref }} upstream/${{ fromJson(steps.get_pr_data.outputs.data).base.ref }}
54+
git checkout ${{ github.event.workflow_run.head_branch }}
55+
git clean -ffdx && git reset --hard HEAD
56+
- name: Cache SonarCloud packages
57+
uses: actions/cache@v3
58+
with:
59+
path: ~/.sonar/cache
60+
key: ${{ runner.os }}-sonar
61+
restore-keys: ${{ runner.os }}-sonar
62+
- name: Cache Maven packages
63+
uses: actions/cache@v3
64+
with:
65+
path: ~/.m2
66+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
67+
restore-keys: ${{ runner.os }}-m2
4568

46-
- name: Set up JDK 17
47-
uses: actions/setup-java@v3
48-
with:
49-
distribution: 'zulu'
50-
java-version: '17'
69+
- name: Set up JDK 17
70+
uses: actions/setup-java@v3
71+
with:
72+
distribution: 'zulu'
73+
java-version: '17'
5174

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 )"
58-
- name: Create custom Maven Settings.xml
59-
uses: whelk-io/maven-settings-xml-action@v21
60-
with:
61-
output_file: custom_maven_settings.xml
62-
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
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' }}
78-
env:
79-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
81-
run: |
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
75+
- name: Set Common Sonar Variables
76+
id: sonar_env
77+
run: |
78+
echo "##[set-output name=sonar_opts;]$(echo -Dsonar.host.url=https://sonarcloud.io \
79+
-Dsonar.projectKey=com-pas_compas-scl-data-service \
80+
-Dsonar.organization=com-pas )"
81+
- name: Create custom Maven Settings.xml
82+
uses: whelk-io/maven-settings-xml-action@v21
83+
with:
84+
output_file: custom_maven_settings.xml
85+
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
86+
- name: Build and analyze (Pull Request)
87+
if: ${{ github.event.workflow_run.event == 'pull_request' || (github.event.workflow_run.actor == 'dependabot[bot]' && github.event.workflow_run.event == 'pull_request_target') }}
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
91+
run: |
92+
./mvnw -B -s custom_maven_settings.xml -Psonar \
93+
${{ steps.sonar_env.outputs.sonar_opts }} \
94+
-Dsonar.pullrequest.branch=${{ fromJson(steps.get_pr_data.outputs.data).head.ref }} \
95+
-Dsonar.pullrequest.key=${{ fromJson(steps.get_pr_data.outputs.data).number }} \
96+
-Dsonar.pullrequest.base=${{ fromJson(steps.get_pr_data.outputs.data).base.ref }} \
97+
-Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} \
98+
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
99+
- name: Build and analyze (Push)
100+
if: ${{ github.event.workflow_run.event == 'push' }}
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
104+
run: |
105+
./mvnw -B -s custom_maven_settings.xml -Psonar \
106+
${{ steps.sonar_env.outputs.sonar_opts }} \
107+
-Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} \
108+
-Dsonar.branch.name=${{ github.event.workflow_run.head_branch }} \
109+
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: SonarCloud Build
6+
7+
on:
8+
push:
9+
branches:
10+
- '**'
11+
pull_request:
12+
branches:
13+
- 'main'
14+
- 'develop'
15+
pull_request_target:
16+
branches:
17+
- 'main'
18+
- 'develop'
19+
20+
jobs:
21+
precheck-build:
22+
name: Pre Check Build
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 30
25+
26+
if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Cache SonarCloud packages
34+
uses: actions/cache@v3
35+
with:
36+
path: ~/.sonar/cache
37+
key: ${{ runner.os }}-sonar
38+
restore-keys: ${{ runner.os }}-sonar
39+
- name: Cache Maven packages
40+
uses: actions/cache@v3
41+
with:
42+
path: ~/.m2
43+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
44+
restore-keys: ${{ runner.os }}-m2
45+
46+
- name: Set up JDK 17
47+
uses: actions/setup-java@v3
48+
with:
49+
distribution: 'zulu'
50+
java-version: '17'
51+
52+
- name: Create custom Maven Settings.xml
53+
uses: whelk-io/maven-settings-xml-action@v21
54+
with:
55+
output_file: custom_maven_settings.xml
56+
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
57+
- name: Build and analyze (Pull Request)
58+
if: ${{ github.event_name == 'pull_request' || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
run: |
62+
./mvnw -B -s custom_maven_settings.xml clean verify
63+
- name: Build and analyze (Push)
64+
if: ${{ github.event_name == 'push' }}
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
run: |
68+
./mvnw -B -s custom_maven_settings.xml clean verify
69+
- name: Save PR number to file
70+
if: github.event_name == 'pull_request'
71+
run: echo ${{ github.event.number }} > PR_NUMBER.txt
72+
- name: Archive PR number
73+
if: github.event_name == 'pull_request'
74+
uses: actions/upload-artifact@v3
75+
with:
76+
name: PR_NUMBER
77+
path: PR_NUMBER.txt

app/src/main/docker/Dockerfile-basex.jvm

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/app-jvm
2222
#
2323
###
24-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7-1107
24+
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-860
2525

2626
ARG JAVA_PACKAGE=java-17-openjdk-headless
2727
ARG RUN_JAVA_VERSION=1.3.8

app/src/main/docker/Dockerfile-basex.native

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# docker run -i --rm -p 8080:8080 quarkus/app
1515
#
1616
###
17-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7-1107
17+
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-860
1818
WORKDIR /work/
1919
RUN chown 1001 /work \
2020
&& chmod "g+rwX" /work \

app/src/main/docker/Dockerfile-postgresql.jvm

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/app-jvm
2222
#
2323
###
24-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7-1107
24+
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-860
2525

2626
ARG JAVA_PACKAGE=java-17-openjdk-headless
2727
ARG RUN_JAVA_VERSION=1.3.8

app/src/main/docker/Dockerfile-postgresql.native

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# docker run -i --rm -p 8080:8080 quarkus/app
1515
#
1616
###
17-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7-1107
17+
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-860
1818
WORKDIR /work/
1919
RUN chown 1001 /work \
2020
&& chmod "g+rwX" /work \

app/src/main/java/org/lfenergy/compas/scl/data/rest/CompasSclDataServiceConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import org.lfenergy.compas.core.commons.ElementConverter;
88
import org.lfenergy.compas.scl.data.util.SclDataModelMarshaller;
99

10-
import javax.enterprise.context.ApplicationScoped;
11-
import javax.enterprise.inject.Produces;
10+
import jakarta.enterprise.context.ApplicationScoped;
11+
import jakarta.enterprise.inject.Produces;
1212

1313
/**
1414
* Create Beans from other dependencies that are used in the application.

app/src/main/java/org/lfenergy/compas/scl/data/rest/exception/CompasNoDataFoundExceptionHandler.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import org.lfenergy.compas.core.commons.model.ErrorResponse;
77
import org.lfenergy.compas.scl.data.exception.CompasNoDataFoundException;
88

9-
import javax.ws.rs.core.Response;
10-
import javax.ws.rs.ext.ExceptionMapper;
11-
import javax.ws.rs.ext.Provider;
9+
import jakarta.ws.rs.core.Response;
10+
import jakarta.ws.rs.ext.ExceptionMapper;
11+
import jakarta.ws.rs.ext.Provider;
1212

1313
@Provider
1414
public class CompasNoDataFoundExceptionHandler implements ExceptionMapper<CompasNoDataFoundException> {

app/src/main/java/org/lfenergy/compas/scl/data/rest/monitoring/LivenessHealthCheck.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.eclipse.microprofile.health.HealthCheckResponse;
88
import org.eclipse.microprofile.health.Liveness;
99

10-
import javax.enterprise.context.ApplicationScoped;
10+
import jakarta.enterprise.context.ApplicationScoped;
1111

1212
@Liveness
1313
@ApplicationScoped

app/src/main/java/org/lfenergy/compas/scl/data/rest/monitoring/ReadinessHealthCheck.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.eclipse.microprofile.health.HealthCheckResponse;
88
import org.eclipse.microprofile.health.Readiness;
99

10-
import javax.enterprise.context.ApplicationScoped;
10+
import jakarta.enterprise.context.ApplicationScoped;
1111

1212
@Readiness
1313
@ApplicationScoped

app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasCommonResource.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
import org.lfenergy.compas.scl.data.rest.v1.model.UserInfoResponse;
1515
import org.lfenergy.compas.scl.extensions.model.SclFileType;
1616

17-
import javax.enterprise.context.RequestScoped;
18-
import javax.inject.Inject;
19-
import javax.ws.rs.GET;
20-
import javax.ws.rs.Path;
21-
import javax.ws.rs.Produces;
22-
import javax.ws.rs.core.MediaType;
17+
import jakarta.enterprise.context.RequestScoped;
18+
import jakarta.inject.Inject;
19+
import jakarta.ws.rs.GET;
20+
import jakarta.ws.rs.Path;
21+
import jakarta.ws.rs.Produces;
22+
import jakarta.ws.rs.core.MediaType;
2323
import java.util.Arrays;
2424
import java.util.Comparator;
2525

app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasSclDataResource.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
import org.lfenergy.compas.scl.data.service.CompasSclDataService;
1616
import org.lfenergy.compas.scl.extensions.model.SclFileType;
1717

18-
import javax.enterprise.context.RequestScoped;
19-
import javax.inject.Inject;
20-
import javax.validation.Valid;
21-
import javax.ws.rs.*;
22-
import javax.ws.rs.core.MediaType;
18+
import jakarta.enterprise.context.RequestScoped;
19+
import jakarta.inject.Inject;
20+
import jakarta.validation.Valid;
21+
import jakarta.ws.rs.*;
22+
import jakarta.ws.rs.core.MediaType;
2323
import java.util.UUID;
2424

2525
import static org.lfenergy.compas.scl.data.rest.Constants.*;

0 commit comments

Comments
 (0)