Skip to content

Commit

Permalink
[PAGOPA-2528] break: Entity migration and major project refactoring (#73
Browse files Browse the repository at this point in the history
)

Co-authored-by: pagopa-github-bot <[email protected]>
  • Loading branch information
andrea-deri and pagopa-github-bot authored Jan 27, 2025
1 parent 6ac3902 commit 7aba809
Show file tree
Hide file tree
Showing 211 changed files with 6,450 additions and 6,379 deletions.
19 changes: 0 additions & 19 deletions .identity/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions .identity/00_data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,14 @@ data "azurerm_key_vault" "nodo_key_vault" {
resource_group_name = "pagopa-${var.env_short}-nodo-sec-rg"
}

data "azurerm_resource_group" "apim_resource_group" {
name = "${local.product}-api-rg"
}

data "azurerm_key_vault_secret" "key_vault_sonar" {
name = "sonar-token"
key_vault_id = data.azurerm_key_vault.key_vault.id
}

data "azurerm_key_vault_secret" "key_vault_bot_token" {
name = "bot-token-github"
key_vault_id = data.azurerm_key_vault.key_vault.id
data "azurerm_key_vault_secret" "key_vault_bot_cd_token" {
name = "pagopa-platform-domain-github-bot-cd-pat"
key_vault_id = data.azurerm_key_vault.domain_key_vault.id
}

data "azurerm_key_vault_secret" "key_vault_cucumber_token" {
Expand Down Expand Up @@ -96,7 +92,7 @@ data "azurerm_key_vault_secret" "opex_org_subscription_key" {
key_vault_id = data.azurerm_key_vault.domain_key_vault.id
}

data "azurerm_key_vault_secret" "key_vault_slack_webhook_url" {
data "azurerm_key_vault_secret" "key_vault_integration_test_slack_webhook_url" {
name = "slack-webhook-url"
key_vault_id = data.azurerm_key_vault.domain_key_vault.id
}
Expand All @@ -116,6 +112,6 @@ data "azurerm_user_assigned_identity" "identity_cd" {
}

data "azurerm_user_assigned_identity" "identity_ci" {
name = "${local.product}-${local.domain}-01-github-ci-identity"
name = "${local.product}-${local.domain}-01-github-ci-identity"
resource_group_name = "${local.product}-identity-rg"
}
38 changes: 20 additions & 18 deletions .identity/03_github_environment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ resource "github_repository_environment" "github_repository_environment" {
# filter teams reviewers from github_organization_teams
# if reviewers_teams is null no reviewers will be configured for environment
dynamic "reviewers" {
for_each = (var.github_repository_environment.reviewers_teams == null || var.env_short != "p" ? [] : [1])
for_each = (var.github_repository_environment.reviewers_teams == null || var.env_short != "p" ? [] : [
1
])
content {
teams = matchkeys(
data.github_organization_teams.all.teams.*.id,
Expand All @@ -24,10 +26,10 @@ locals {
"CD_CLIENT_ID" : data.azurerm_user_assigned_identity.identity_cd.client_id,
"CI_CLIENT_ID" : data.azurerm_user_assigned_identity.identity_ci.client_id,
"TENANT_ID" : data.azurerm_client_config.current.tenant_id,
"INTERNAL_SUBSCRIPTION_KEY": var.env_short != "p" ? data.azurerm_key_vault_secret.integration_test_internal_subscription_key[0].value : data.azurerm_key_vault_secret.opex_internal_subscription_key[0].value,
"INTERNAL_SUBSCRIPTION_KEY" : var.env_short != "p" ? data.azurerm_key_vault_secret.integration_test_internal_subscription_key[0].value : data.azurerm_key_vault_secret.opex_internal_subscription_key[0].value,
"SUBSCRIPTION_ID" : data.azurerm_subscription.current.subscription_id,
"PSP_SUBSCRIPTION_KEY": var.env_short != "p" ? data.azurerm_key_vault_secret.integration_test_psp_subscription_key[0].value : ""
"ORG_SUBSCRIPTION_KEY": var.env_short != "p" ? data.azurerm_key_vault_secret.integration_test_org_subscription_key[0].value : ""
"PSP_SUBSCRIPTION_KEY" : var.env_short != "p" ? data.azurerm_key_vault_secret.integration_test_psp_subscription_key[0].value : ""
"ORG_SUBSCRIPTION_KEY" : var.env_short != "p" ? data.azurerm_key_vault_secret.integration_test_org_subscription_key[0].value : ""
}
env_variables = {
"CONTAINER_APP_ENVIRONMENT_NAME" : local.container_app_environment.name,
Expand All @@ -36,8 +38,8 @@ locals {
"CLUSTER_RESOURCE_GROUP" : local.aks_cluster.resource_group_name,
"DOMAIN" : local.domain,
"NAMESPACE" : local.domain,
"INTEGRATION_TEST_STORAGE_ACCOUNT_NAME": local.integration_test.storage_account_name
"INTEGRATION_TEST_REPORTS_FOLDER": local.integration_test.reports_folder
"INTEGRATION_TEST_STORAGE_ACCOUNT_NAME" : local.integration_test.storage_account_name
"INTEGRATION_TEST_REPORTS_FOLDER" : local.integration_test.reports_folder
}
}

Expand Down Expand Up @@ -71,30 +73,30 @@ resource "github_actions_environment_variable" "github_environment_runner_variab

#tfsec:ignore:github-actions-no-plain-text-action-secrets # not real secret
resource "github_actions_secret" "secret_sonar_token" {
repository = local.github.repository
secret_name = "SONAR_TOKEN"
plaintext_value = data.azurerm_key_vault_secret.key_vault_sonar.value
repository = local.github.repository
secret_name = "SONAR_TOKEN"
plaintext_value = data.azurerm_key_vault_secret.key_vault_sonar.value
}

#tfsec:ignore:github-actions-no-plain-text-action-secrets # not real secret
resource "github_actions_secret" "secret_bot_token" {
repository = local.github.repository
secret_name = "BOT_TOKEN_GITHUB"
plaintext_value = data.azurerm_key_vault_secret.key_vault_bot_token.value
repository = local.github.repository
secret_name = "BOT_TOKEN_GITHUB"
plaintext_value = data.azurerm_key_vault_secret.key_vault_bot_cd_token.value
}

#tfsec:ignore:github-actions-no-plain-text-action-secrets # not real secret
resource "github_actions_secret" "secret_slack_webhook" {
repository = local.github.repository
secret_name = "SLACK_WEBHOOK_URL"
plaintext_value = data.azurerm_key_vault_secret.key_vault_slack_webhook_url.value
repository = local.github.repository
secret_name = "SLACK_WEBHOOK_URL"
plaintext_value = data.azurerm_key_vault_secret.key_vault_slack_webhook_url.value
}

#tfsec:ignore:github-actions-no-plain-text-action-secrets # not real secret
resource "github_actions_secret" "secret_integrationtest_slack_webhook" {
repository = local.github.repository
secret_name = "INTEGRATION_TEST_SLACK_WEBHOOK_URL"
plaintext_value = data.azurerm_key_vault_secret.key_vault_integration_test_slack_webhook_url.value
repository = local.github.repository
secret_name = "INTEGRATION_TEST_SLACK_WEBHOOK_URL"
plaintext_value = data.azurerm_key_vault_secret.key_vault_integration_test_slack_webhook_url.value
}

############
Expand Down
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-fdr-chart
description: Flussi di rendicontazioni
type: application
version: "1.46.0"
appVersion: "1.0.24"
version: "1.48.0"
appVersion: "1.0.24-2-project-refactoring"
dependencies:
- name: microservice-chart
version: 3.0.0
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-fdr
tag: 1.0.24
tag: 1.0.24-2-project-refactoring
pullPolicy: Always
readinessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-fdr
tag: 1.0.24
tag: 1.0.24-2-project-refactoring
pullPolicy: Always
readinessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi_internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "FDR - Flussi di rendicontazione (local)",
"description": "Manage FDR ( aka \"Flussi di Rendicontazione\" ) exchanged between PSP and EC",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "1.0.24"
"version": "1.0.24-2-project-refactoring"
},
"servers": [
{
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi_organization.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "FDR - Flussi di rendicontazione (local)",
"description": "Manage FDR ( aka \"Flussi di Rendicontazione\" ) exchanged between PSP and EC",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "1.0.24"
"version": "1.0.24-2-project-refactoring"
},
"servers": [
{
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi_psp.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "FDR - Flussi di rendicontazione (local)",
"description": "Manage FDR ( aka \"Flussi di Rendicontazione\" ) exchanged between PSP and EC",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "1.0.24"
"version": "1.0.24-2-project-refactoring"
},
"servers": [
{
Expand Down
30 changes: 16 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>it.gov.pagopa</groupId>
<artifactId>pagopa-fdr</artifactId>
<version>1.0.24</version>
<version>1.0.24-2-project-refactoring</version>
<properties>
<compiler-plugin.version>3.11.0</compiler-plugin.version>
<lombok.version>1.18.26</lombok.version>
<maven.compiler.release>17</maven.compiler.release>
<org.mapstruct.version>1.5.3.Final</org.mapstruct.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.0.1.Final</quarkus.platform.version>
<quarkus.platform.version>3.17.7</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.0.0</surefire-plugin.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<groupId>io.quarkus.platform</groupId>
<artifactId>quarkus-bom</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
Expand Down Expand Up @@ -68,16 +68,16 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-reactive-jackson</artifactId>
<artifactId>quarkus-rest-client-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-jackson</artifactId>
<artifactId>quarkus-rest-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.openapi.generator</groupId>
<artifactId>quarkus-openapi-generator</artifactId>
<version>2.2.2</version>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down Expand Up @@ -187,7 +187,7 @@
<build>
<plugins>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<groupId>io.quarkus.platform</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
Expand Down Expand Up @@ -253,8 +253,10 @@
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner
</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager
</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
Expand Down
110 changes: 3 additions & 107 deletions src/main/java/it/gov/pagopa/fdr/App.java
Original file line number Diff line number Diff line change
@@ -1,111 +1,7 @@
package it.gov.pagopa.fdr;


import it.gov.pagopa.fdr.rest.exceptionmapper.ErrorResponse;
import jakarta.ws.rs.core.Application;
import jakarta.ws.rs.core.MediaType;
import org.eclipse.microprofile.openapi.annotations.Components;
import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition;
import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn;
import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType;
import org.eclipse.microprofile.openapi.annotations.info.Info;
import org.eclipse.microprofile.openapi.annotations.media.Content;
import org.eclipse.microprofile.openapi.annotations.media.ExampleObject;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement;
import org.eclipse.microprofile.openapi.annotations.security.SecurityScheme;

@SecurityScheme(
type = SecuritySchemeType.APIKEY,
securitySchemeName = "api_key",
apiKeyName="Ocp-Apim-Subscription-Key",
in = SecuritySchemeIn.HEADER)
@OpenAPIDefinition(
security = { @SecurityRequirement(name = "api_key") },
components =
@Components(
responses = {
@APIResponse(
name = "InternalServerError",
responseCode = "500",
description = "Internal Server Error",
content =
@Content(
mediaType = MediaType.APPLICATION_JSON,
schema = @Schema(implementation = ErrorResponse.class),
example =
"""
{
"errorId": "50905466-1881-457b-b42f-fb7b2bfb1610",
"httpStatusCode": 500,
"httpStatusDescription": "Internal Server Error",
"appErrorCode": "FDR-0500",
"errors": [
{
"message": "An unexpected error has occurred. Please contact support."
}
]
}""")),
@APIResponse(
name = "AppException400",
responseCode = "400",
description = "Default app exception for status 400",
content =
@Content(
mediaType = MediaType.APPLICATION_JSON,
schema = @Schema(implementation = ErrorResponse.class),
examples = {
@ExampleObject(
name = "Error",
value =
"""
{
"httpStatusCode": 400,
"httpStatusDescription": "Bad Request",
"appErrorCode": "FDR-0702",
"errors": [
{
"message": "Reporting Fdr [<fdr>] is invalid"
}
]
}"""),
@ExampleObject(
name = "Errors with path",
value =
"""
{
"httpStatusCode": 400,
"httpStatusDescription": "Bad Request",
"appErrorCode": "FDR-0702",
"errors": [
{
"path": "<detail.path.if-exist>",
"message": "<detail.message>"
}
]
}""")
})),
@APIResponse(
name = "AppException404",
responseCode = "404",
description = "Default app exception for status 404",
content =
@Content(
mediaType = MediaType.APPLICATION_JSON,
schema = @Schema(implementation = ErrorResponse.class),
example =
"""
{
"httpStatusCode": 404,
"httpStatusDescription": "Not Found",
"appErrorCode": "FDR-0701",
"errors": [
{
"message": "Reporting Fdr [<fdr>] not found"
}
]
}""")),
}),
info = @Info(title = "FDR - Flussi di Rendicontazione", version = "0.0.0-SNAPSHOT"))
public class App extends Application {}
public class App extends Application {

}
Loading

0 comments on commit 7aba809

Please sign in to comment.