Skip to content

Commit 2dcab4c

Browse files
authored
fix: promote to Main
fix: promote to Main
2 parents 2d8a7e8 + 91b8d5e commit 2dcab4c

File tree

14 files changed

+203
-82
lines changed

14 files changed

+203
-82
lines changed

.devops/code-review-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ steps:
4545
- task: Maven@3
4646
inputs:
4747
mavenPomFile: 'pom.xml'
48-
goals: 'clean org.jacoco:jacoco-maven-plugin:0.8.8:prepare-agent verify org.jacoco:jacoco-maven-plugin:0.8.8:report org.jacoco:jacoco-maven-plugin:0.8.8:report-aggregate '
48+
goals: 'clean org.jacoco:jacoco-maven-plugin:0.8.12:prepare-agent verify org.jacoco:jacoco-maven-plugin:0.8.12:report org.jacoco:jacoco-maven-plugin:0.8.12:report-aggregate '
4949
options: '-B'
5050
publishJUnitResults: true
5151
testResultsFiles: '**/surefire-reports/TEST-*.xml'
5252
javaHomeOption: 'JDKVersion'
53-
jdkVersionOption: '1.17'
53+
jdkVersionOption: '1.21'
5454
mavenVersionOption: 'Default'
5555
mavenAuthenticateFeed: false
5656
effectivePomSkip: false
@@ -67,7 +67,7 @@ steps:
6767
options: '-B -Dsonar.coverage.jacoco.xmlReportPaths=$(xmlReportPaths)'
6868
publishJUnitResults: false
6969
javaHomeOption: 'JDKVersion'
70-
jdkVersionOption: '1.17'
70+
jdkVersionOption: '1.21'
7171
mavenVersionOption: 'Default'
7272
mavenAuthenticateFeed: false
7373
effectivePomSkip: false

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# see https://help.github.com/en/articles/about-code-owners#example-of-a-codeowners-file
2-
3-
* @pagopa/idpay-app-maintainer-team @stedelia
2+
# Add the repository's code owners here
3+
* @pagopa/idpay-app-maintainer-team @pagopa/idpay-approver-team @dariopelliccioli

.github/workflows/anchore.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
environment: dev
3838
steps:
3939
- name: Checkout the code
40-
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
40+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
4141
- name: Build the Docker image
4242
run: docker build . --file ${{ env.DOCKERFILE }} --tag localbuild/testimage:latest
4343
- name: Run the Anchore Grype scan action
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: 📦 Flow Snapshot Docker
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'main'
7+
paths-ignore:
8+
- 'CODEOWNERS'
9+
- '**.md'
10+
- '.**'
11+
workflow_dispatch:
12+
inputs:
13+
docker_build_enabled:
14+
description: 'Enable Docker build'
15+
required: false
16+
default: 'true'
17+
azdo_trigger_enabled:
18+
description: 'Enable Azure DevOps trigger'
19+
required: false
20+
default: 'true'
21+
argocd_target_branch:
22+
description: 'argocd target branch name'
23+
required: false
24+
default: 'main'
25+
postman_branch:
26+
description: postman branch name'
27+
required: false
28+
default: 'release-dev'
29+
30+
env:
31+
# branch choosed by workflow_dispatch or by push event
32+
CURRENT_BRANCH: ${{ github.event.inputs.branch || github.ref_name }}
33+
34+
jobs:
35+
checkout:
36+
name: 🔖 Checkout Repository
37+
runs-on: ubuntu-22.04
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
41+
with:
42+
ref: ${{ env.CURRENT_BRANCH }}
43+
44+
docker-build:
45+
name: 📦 Docker Build and Push
46+
needs: checkout
47+
runs-on: ubuntu-22.04
48+
if: ${{ github.event_name == 'push' || github.event.inputs.docker_build_enabled == 'true' }}
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
52+
with:
53+
ref: ${{ env.CURRENT_BRANCH }}
54+
55+
- name: Run Snapshot Docker Build/Push
56+
# https://github.com/pagopa/github-actions-template/releases/tag/v2.0.0
57+
uses: pagopa/github-actions-template/payments-flow-docker-snapshot@b825ee193430395706a4a7e580b8435bdded0227
58+
with:
59+
current_branch: ${{ github.ref_name }}
60+
61+
azure-devops-trigger:
62+
name: 🅰️ Azure DevOps Pipeline Trigger
63+
needs: docker-build
64+
runs-on: ubuntu-22.04
65+
if: |
66+
always() &&
67+
needs.docker-build.result != 'failure' &&
68+
github.event.inputs.azdo_trigger_enabled == 'true'
69+
steps:
70+
- name: Trigger Azure DevOps Pipeline
71+
# https://github.com/pagopa/github-actions-template/releases/tag/v2.1.0
72+
uses: pagopa/github-actions-template/azure-devops-trigger-pipeline@cad30356d9046af6e7b0cee43db4cf919cc408f9
73+
with:
74+
enable_azure_devops_step: 'true'
75+
azure_devops_project_url: 'https://dev.azure.com/pagopaspa/idpay-itn-projects'
76+
azure_devops_pipeline_name: 'idpay-deploy-aks.deploy'
77+
azure_devops_pat: ${{ secrets.AZURE_DEVOPS_TOKEN }}
78+
azure_template_parameters: |
79+
{
80+
"APPS_TOP": "[idpay-onboarding-workflow]",
81+
"APPS_MID": "[]",
82+
"APPS_EXT": "[]",
83+
"ARGOCD_TARGET_BRANCH": "${{ github.event.inputs.argocd_target_branch }}",
84+
"POSTMAN_BRANCH": "${{ github.event.inputs.postman_branch }}",
85+
"TRIGGER_MESSAGE": "idpay-onboarding-workflow"
86+
}
87+
88+

.github/workflows/release.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
name: Release
22

33
on:
4-
# Trigger the workflow on push or pull request,
5-
# but only for the main branch
4+
# Trigger the workflow on push on the main branch
65
push:
76
branches:
87
- main
98
paths-ignore:
10-
- "CODEOWNERS"
11-
- "**.md"
12-
- ".**"
9+
- 'CODEOWNERS'
10+
- '**.md'
11+
- '.**'
12+
13+
permissions:
14+
packages: write
15+
contents: write
16+
1317

1418
jobs:
15-
release:
16-
name: Release
17-
runs-on: ubuntu-latest
18-
environment: prod
19+
checkout:
20+
name: 🔖 Checkout Repository
21+
runs-on: ubuntu-22.04
1922
steps:
20-
- name: Checkout
21-
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
22-
with:
23-
persist-credentials: false
24-
fetch-depth: 0
25-
- name: Setup Node.js
26-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d #v3.8.1
23+
- name: Checkout code
24+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
2725
with:
28-
node-version: 20
29-
scope: 'cycjimmy'
30-
- name: Release
31-
uses: cycjimmy/semantic-release-action@61680d0e9b02ff86f5648ade99e01be17f0260a4 #v4.0.0
26+
ref: ${{ github.ref_name }}
27+
28+
flow-release:
29+
name: 🚀 Release
30+
runs-on: ubuntu-22.04
31+
needs: checkout
32+
steps:
33+
- name: 🚀 release + docker
34+
# https://github.com/pagopa/github-actions-template/releases/tag/v2.1.1
35+
uses: pagopa/github-actions-template/payments-flow-release@e67e0ec4bb01d6cb5065e311ba0e1c92c49966a7
3236
with:
33-
extra_plugins: |
34-
semantic-release/release-notes-generator#c466b7165be2a0e5988676174e4bc244c991d669 #v11.0.7
35-
semantic-release/git#3e934d45f97fd07a63617c0fc098c9ed3e67d97a #v10.0.1
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
current_branch: ${{ github.ref_name }}

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
12
#
23
# Build
34
#
4-
FROM maven:3.9.6-amazoncorretto-17-al2023@sha256:459be099faa25a32c06cd45ed1ef2bc9dbbf8a5414da4e72349459a1bb4d6166 AS buildtime
5+
FROM maven:3.9.9-amazoncorretto-21-al2023@sha256:281aeb7254dde09226bde36c2ce236ead71c6451298986a79fa542bc26444225 AS buildtime
56

67
WORKDIR /build
78
COPY . .
@@ -11,7 +12,7 @@ RUN mvn clean package -DskipTests
1112
#
1213
# Docker RUNTIME
1314
#
14-
FROM amazoncorretto:17-alpine3.20@sha256:38b44a49bfd11b925015b281d3d35c845daaeca5f0e3827f8e1df9bedf7b256a AS runtime
15+
FROM amazoncorretto:21-alpine3.20@sha256:ca05e809506b30f75a5b90f766b177e3ae996ac606b63499b4bd75b1b7890451 AS runtime
1516

1617
RUN apk --no-cache add shadow
1718
RUN useradd --uid 10000 runner
@@ -21,7 +22,7 @@ WORKDIR /app
2122

2223
COPY --from=buildtime /build/target/*.jar /app/app.jar
2324
# The agent is enabled at runtime via JAVA_TOOL_OPTIONS.
24-
ADD https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.7.0/applicationinsights-agent-3.7.0.jar /app/applicationinsights-agent.jar
25+
ADD https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.7.1/applicationinsights-agent-3.7.1.jar /app/applicationinsights-agent.jar
2526

2627
RUN chown -R runner:runner /app
2728

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<version>1.4.0</version>
1616

1717
<properties>
18-
<java.version>17</java.version>
18+
<java.version>21</java.version>
1919
</properties>
2020

2121
<dependencies>
@@ -238,9 +238,9 @@
238238
<plugin>
239239
<groupId>org.apache.maven.plugins</groupId>
240240
<artifactId>maven-surefire-plugin</artifactId>
241-
<version>3.2.3</version>
241+
<version>3.5.3</version>
242242
<configuration>
243-
<argLine>@{argLine} -Duser.timezone=Europe/Rome</argLine>
243+
<argLine>-Duser.timezone=Europe/Rome</argLine>
244244
</configuration>
245245
</plugin>
246246
<plugin>

src/main/java/it/gov/pagopa/onboarding/workflow/constants/OnboardingWorkflowConstants.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public class OnboardingWorkflowConstants {
3737
public static final String ERROR_BUDGET_TERMINATED = "BUDGET_TERMINATED";
3838
public static final String ERROR_WHITELIST = "NOT_IN_WHITELIST";
3939
public static final String ERROR_TECHNICAL = "TECHNICAL_ERROR";
40-
4140
public static final class ExceptionMessage {
4241
public static final String ERROR_SUSPENSION_STATUS_MSG = "It is not possible to suspend the user on initiative [%s]";
4342
public static final String ERROR_READMIT_STATUS_MSG = "It is not possible to readmit the user on initiative [%s]";

src/main/java/it/gov/pagopa/onboarding/workflow/controller/OnboardingControllerImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import org.springframework.data.domain.Pageable;
88
import org.springframework.http.HttpStatus;
99
import org.springframework.http.ResponseEntity;
10-
import org.springframework.web.bind.annotation.PathVariable;
1110
import org.springframework.web.bind.annotation.RequestBody;
1211
import org.springframework.web.bind.annotation.RestController;
1312

@@ -22,7 +21,7 @@ public OnboardingControllerImpl(OnboardingService onboardingService) {
2221

2322
public ResponseEntity<RequiredCriteriaDTO> checkPrerequisites(
2423
@Valid @RequestBody CheckPutDTO body,
25-
@PathVariable("userId") String userId) {
24+
String userId) {
2625
RequiredCriteriaDTO dto = onboardingService.checkPrerequisites(body.getInitiativeId(), userId,
2726
body.getChannel());
2827
if (dto == null) {
@@ -33,13 +32,13 @@ public ResponseEntity<RequiredCriteriaDTO> checkPrerequisites(
3332

3433
public ResponseEntity<Void> onboardingCitizen(
3534
@Valid @RequestBody OnboardingPutDTO onBoardingPutDTO,
36-
@PathVariable("userId") String userId) {
35+
String userId) {
3736
onboardingService.putTcConsent(onBoardingPutDTO.getInitiativeId(),userId);
3837
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
3938
}
4039

4140
public ResponseEntity<OnboardingStatusDTO> onboardingStatus(
42-
@PathVariable("initiativeId") String initiativeId, @PathVariable("userId") String userId) {
41+
String initiativeId, String userId) {
4342
OnboardingStatusDTO onBoardingStatusDTO = onboardingService.getOnboardingStatus(initiativeId,
4443
userId);
4544
return new ResponseEntity<>(onBoardingStatusDTO, HttpStatus.OK);
@@ -60,7 +59,7 @@ public ResponseEntity<ResponseInitiativeOnboardingDTO> onboardingStatusList(Stri
6059

6160
@Override
6261
public ResponseEntity<Void> saveConsent(@Valid @RequestBody ConsentPutDTO body,
63-
@PathVariable("userId") String userId) {
62+
String userId) {
6463
onboardingService.saveConsent(body, userId);
6564
return new ResponseEntity<>(HttpStatus.ACCEPTED);
6665
}
@@ -95,4 +94,5 @@ public ResponseEntity<OnboardingFamilyDTO> familyUnitComposition(String initiat
9594
OnboardingFamilyDTO onboardingFamilyDTO = onboardingService.getfamilyUnitComposition(initiativeId, userId);
9695
return new ResponseEntity<>(onboardingFamilyDTO, HttpStatus.OK);
9796
}
97+
9898
}

src/main/java/it/gov/pagopa/onboarding/workflow/model/SelfDeclarationText.java renamed to src/main/java/it/gov/pagopa/onboarding/workflow/model/SelfDeclaration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@Data
1313
@NoArgsConstructor
1414
@SuperBuilder
15-
public class SelfDeclarationText {
15+
public class SelfDeclaration {
1616

1717
public static String buildId(String initiativeId, String userId) {
1818
return "%s_%s".formatted(userId, initiativeId);
@@ -21,5 +21,6 @@ public static String buildId(String initiativeId, String userId) {
2121
@Id private String id;
2222
private String initiativeId;
2323
private String userId;
24+
private List<SelfDeclarationMultiValues> selfDeclarationMultiValues;
2425
private List<SelfDeclarationTextValues> selfDeclarationTextValues;
2526
}

0 commit comments

Comments
 (0)