Skip to content

Commit

Permalink
Merge release-uat (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuraf authored Mar 22, 2024
2 parents 1076108 + 7dcebfe commit ec7e336
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 13 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/create_release_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Create Release branch

on:
workflow_dispatch:
inputs:
version-bump:
required: false
type: choice
options:
- major
- minor
- patch
default: patch
description: 'Major, Minor, or Patch version bump'

jobs:
create_branch:
name: 'Create Release Branch'
runs-on: ubuntu-20.04
permissions:
contents: write
actions: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:

- name: Create Release Branch
id: create_branch
uses: pagopa/selfcare-commons/github-actions-template/create-release@main
with:
version_bump: ${{ inputs.version-bump }}
github_path_token: ${{ secrets.GH_PAT_VARIABLES }}

- name: Trigger release ms UAT Release
run: |
gh workflow run release_ms.yml \
--ref ${{ steps.create_branch.outputs.new_branch_name }}
12 changes: 11 additions & 1 deletion .github/workflows/release_ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,14 @@ jobs:
with:
environment: prod
tf_environment: prod
dir: 'infra/container_apps'
dir: 'infra/container_apps'

promote_release:
name: 'Promote prerelase release'
runs-on: ubuntu-20.04
needs: [release_prod]
steps:
- uses: pagopa/selfcare-commons/github-actions-template/promote-release@main
with:
github_path_token: ${{ secrets.GH_PAT_VARIABLES }}
release_version: ${{ vars.CURRENT_UAT_VERSION }}
7 changes: 4 additions & 3 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
replicaCount: 2
replicaCount: 0

image:
repository: selcdacr.azurecr.io/selfcaremsexternalinterceptor
Expand Down Expand Up @@ -26,8 +26,8 @@ resources:

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
minReplicas: 0
maxReplicas: 0
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

Expand All @@ -40,3 +40,4 @@ configEnvSpecific:
SAP_ALLOWED_INSTITUTION_TYPES: "PA,GSP,SA,AS,SCP"
SAP_ALLOWED_ORIGIN: "IPA,SELC"
PRODUCTS_TO_RESEND: "prod-pn,prod-io-sign,prod-io-premium"
BYPASS_CHECK_ORGANIZATION: "false"
1 change: 1 addition & 0 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ configEnvSpecific:
SAP_ALLOWED_INSTITUTION_TYPES: "PA,GSP,SA,AS,SCP"
SAP_ALLOWED_ORIGIN: "IPA,SELC"
PRODUCTS_TO_RESEND: "prod-pn,prod-io-sign,prod-io-premium"
BYPASS_CHECK_ORGANIZATION: "false"
7 changes: 4 additions & 3 deletions helm/values-uat.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
replicaCount: 2
replicaCount: 0

image:
repository: selcuacr.azurecr.io/selfcaremsexternalinterceptor
Expand Down Expand Up @@ -27,8 +27,8 @@ resources:

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
minReplicas: 0
maxReplicas: 0
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

Expand All @@ -41,3 +41,4 @@ configEnvSpecific:
SAP_ALLOWED_INSTITUTION_TYPES: "PA,GSP,SA,AS,SCP"
SAP_ALLOWED_ORIGIN: "IPA,SELC"
PRODUCTS_TO_RESEND: "prod-pn,prod-io-sign,prod-io-premium"
BYPASS_CHECK_ORGANIZATION: "false"
2 changes: 1 addition & 1 deletion infra/container_apps/env/dev/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ app_settings = [
},
{
name = "SAP_ALLOWED_INSTITUTION_TYPES"
value = "PA,GSP,SA,SA,SCP"
value = "PA,GSP,SA,AS,SCP"
},
{
name = "SAP_ALLOWED_ORIGIN"
Expand Down
2 changes: 1 addition & 1 deletion infra/container_apps/env/prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ app_settings = [
},
{
name = "SAP_ALLOWED_INSTITUTION_TYPES"
value = "PA,GSP,SA,SA,SCP"
value = "PA,GSP,SA,AS,SCP"
},
{
name = "SAP_ALLOWED_ORIGIN"
Expand Down
2 changes: 1 addition & 1 deletion infra/container_apps/env/uat/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ app_settings = [
},
{
name = "SAP_ALLOWED_INSTITUTION_TYPES"
value = "PA,GSP,SA,SA,SCP"
value = "PA,GSP,SA,AS,SCP"
},
{
name = "SAP_ALLOWED_ORIGIN"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import it.pagopa.selfcare.commons.web.config.BaseWebConfig;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;

@Configuration
@Import(BaseWebConfig.class)
@PropertySource("classpath:config/web-config.properties")
class WebConfig{

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.tags.Tags;
import io.swagger.annotations.ApiParam;
import it.pagopa.selfcare.external_interceptor.connector.model.interceptor.AckStatus;
import it.pagopa.selfcare.external_interceptor.core.InterceptorService;
import it.pagopa.selfcare.external_interceptor.web.model.AckPayloadRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand All @@ -23,6 +24,8 @@
public class InterceptorController {

private final InterceptorService interceptorService;
@Value("${prod-fd.bypass-checkOrganization}")
private boolean byPassCheckOrganization;

@Autowired
public InterceptorController(InterceptorService interceptorService) {
Expand Down Expand Up @@ -55,7 +58,7 @@ public ResponseEntity<Void> checkOrganization(@ApiParam("${swagger.external-inte
@ApiParam("${swagger.external-interceptor.institution.model.vatNumber}") @RequestParam("vatNumber") String vatNumber) {
log.trace("checkOrganization start");
log.debug("checkOrganization productId = {}, fiscalCode = {}, vatNumber = {}", productId, fiscalCode, vatNumber);
boolean alreadyRegistered = interceptorService.checkOrganization(fiscalCode, vatNumber);
boolean alreadyRegistered = byPassCheckOrganization?false:interceptorService.checkOrganization(fiscalCode, vatNumber);
log.debug("checkOrganization result = {}", alreadyRegistered);
log.trace("checkOrganization end");
if (alreadyRegistered)
Expand Down
1 change: 1 addition & 0 deletions web/src/main/resources/config/web-config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prod-fd.bypass-checkOrganization=${BYPASS_CHECK_ORGANIZATION:false}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package it.pagopa.selfcare.external_interceptor.web.config;

import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Import;

@TestConfiguration
@Import(WebConfig.class)
public class WebTestConfig {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import it.pagopa.selfcare.external_interceptor.connector.model.interceptor.AckStatus;
import it.pagopa.selfcare.external_interceptor.core.InterceptorService;
import it.pagopa.selfcare.external_interceptor.web.config.WebTestConfig;
import it.pagopa.selfcare.external_interceptor.web.model.AckPayloadRequest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -21,7 +22,7 @@
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@WebMvcTest(value = {InterceptorController.class}, excludeAutoConfiguration = SecurityAutoConfiguration.class)
@ContextConfiguration(classes = {InterceptorController.class})
@ContextConfiguration(classes = {InterceptorController.class, WebTestConfig.class})
class InterceptorControllerTest {
private static final String BASE_URL = "/interceptor";
@Autowired
Expand All @@ -30,6 +31,7 @@ class InterceptorControllerTest {
private InterceptorService interceptorService;



@Autowired
private ObjectMapper objectMapper;
@Test
Expand Down

0 comments on commit ec7e336

Please sign in to comment.