Skip to content

Commit

Permalink
Merge pull request #354 from pagopa/develop
Browse files Browse the repository at this point in the history
fix: Promotion to master, fix bug on scheduled runs
  • Loading branch information
and-mora authored Mar 6, 2023
2 parents 4d0c779 + 00d562d commit 84d8459
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 35 deletions.
6 changes: 3 additions & 3 deletions api/batch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<artifactId>rtd-ms-transaction-filter-api</artifactId>
<groupId>it.gov.pagopa.rtd.ms.transaction_filter.api</groupId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>

<artifactId>rtd-ms-transaction-filter-api-batch</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>

<dependencies>
<dependency>
Expand All @@ -21,7 +21,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpg-jdk15on</artifactId>
<artifactId>bcpg-jdk18on</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ public TransactionFlatFileItemReader transactionItemReader(
return flatFileItemReader;
}

@Bean
@StepScope
public ItemReader<AggregationKey> mapItemReader(StoreService storeService) {
return new CustomIteratorItemReader<>(storeService.getAggregateKeySet());
}
Expand Down Expand Up @@ -483,7 +485,8 @@ public Step fileReportRecoveryStep(FileReportRestClient restClient) {
* @return a itemReader
*/
@Bean
public ItemReader<FileMetadata> fileReportReader(FileReportRestClient restClient) {
@StepScope
public FileReportItemReader fileReportReader(FileReportRestClient restClient) {
return new FileReportItemReader(restClient);
}

Expand All @@ -494,7 +497,8 @@ public ItemReader<FileMetadata> fileReportReader(FileReportRestClient restClient
*/
@SneakyThrows
@Bean
public ItemWriter<FileMetadata> fileReportWriter() {
@StepScope
public FlatFileItemWriter<FileMetadata> fileReportWriter() {
DateTimeFormatter fmt = DateTimeFormatter.ofPattern(DATE_FORMAT_FOR_FILENAME);
String currentDate = OffsetDateTime.now().format(fmt);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.util.Iterator;
import lombok.Setter;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.annotation.BeforeStep;
import org.springframework.batch.item.ItemReader;
import org.springframework.lang.Nullable;

Expand All @@ -14,6 +16,11 @@ public CustomIteratorItemReader(Iterable<T> iterable) {
this.iterable = iterable;
}

@BeforeStep
public void initializeState(StepExecution stepExecution) {
this.iterator = null;
}

@Nullable
public synchronized T read() {
if (this.iterator == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,15 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.annotation.BeforeStep;

public class FileReportItemReader extends CustomIteratorItemReader<FileMetadata> {

private final FileReportRestClient restClient;

public FileReportItemReader(FileReportRestClient restClient) {
super(Collections.emptyList());
this.restClient = restClient;
}

@BeforeStep
public void initializeState(StepExecution stepExecution) {
Collection<FileMetadata> files = Objects.requireNonNull(restClient.getFileReport())
.getFilesRecentlyUploaded();

if (files != null) {
super.setIterable(files);
}
Expand Down
4 changes: 2 additions & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<artifactId>rtd-ms-transaction-filter</artifactId>
<groupId>it.gov.pagopa.rtd.ms</groupId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter.api</groupId>
<artifactId>rtd-ms-transaction-filter-api</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>

<packaging>pom</packaging>

Expand Down
4 changes: 2 additions & 2 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<artifactId>rtd-ms-transaction-filter</artifactId>
<groupId>it.gov.pagopa.rtd.ms</groupId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter</groupId>
<artifactId>transaction-filter-app</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>

<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ batchConfiguration:
rest-client:
user-agent:
prefix: BatchService
version: 2.0.1
version: 2.0.2
hpan:
serviceCode: hpan-service
base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}}
Expand Down
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<artifactId>rtd-ms-transaction-filter</artifactId>
<groupId>it.gov.pagopa.rtd.ms</groupId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter</groupId>
<artifactId>rtd-ms-transaction-filter-core</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>

<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions integration/jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<artifactId>rtd-ms-transaction-filter-integration</artifactId>
<groupId>it.gov.pagopa.rtd.ms.transaction_filter</groupId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter.integration</groupId>
<artifactId>rtd-ms-transaction-filter-integration-jpa</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>

<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<artifactId>rtd-ms-transaction-filter</artifactId>
<groupId>it.gov.pagopa.rtd.ms</groupId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter</groupId>
<artifactId>rtd-ms-transaction-filter-integration</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>

<packaging>pom</packaging>

Expand Down
4 changes: 2 additions & 2 deletions integration/rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<groupId>it.gov.pagopa.rtd.ms.transaction_filter</groupId>
<artifactId>rtd-ms-transaction-filter-integration</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter.integration</groupId>
<artifactId>rtd-ms-transaction-filter-integration-rest</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void whenLogContainsSaltThenAnonymizeIt(CapturedOutput output) {
String stringWithSalt =
"[HpanRestConnector#getSalt] ---> GET https://api.dev.cstar.pagopa.it/rtd/payment-instrument-manager/v2/salt HTTP/1.1\n"
+ "[HpanRestConnector#getSalt] Ocp-Apim-Subscription-Key: ciao\n"
+ "[HpanRestConnector#getSalt] User-Agent: BatchService/2.0.1\n"
+ "[HpanRestConnector#getSalt] User-Agent: BatchService/2.0.2\n"
+ "[HpanRestConnector#getSalt] ---> END HTTP (0-byte body)\n"
+ "[HpanRestConnector#getSalt] <--- HTTP/1.1 200 OK (57ms)\n"
+ "[HpanRestConnector#getSalt] connection: keep-alive\n"
Expand Down
2 changes: 1 addition & 1 deletion ops_resources/example_config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ batchConfiguration:
rest-client:
user-agent:
prefix: BatchService
version: 2.0.1
version: 2.0.2
hpan:
serviceCode: hpan-service
base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}}
Expand Down
2 changes: 1 addition & 1 deletion ops_resources/example_config/application_hbsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ batchConfiguration:
rest-client:
user-agent:
prefix: BatchService
version: 2.0.1
version: 2.0.2
hpan:
serviceCode: hpan-service
base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}}
Expand Down
18 changes: 12 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.4</version>
<version>2.7.9</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms</groupId>
<artifactId>rtd-ms-transaction-filter</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>

<packaging>pom</packaging>

<properties>
<java.version>1.8</java.version>
<spring-boot.version>2.7.4</spring-boot.version>
<spring-boot.version>2.7.9</spring-boot.version>
<postgresql.version>42.5.1</postgresql.version>
<springframework-cloud.version>3.1.4</springframework-cloud.version>
<snakeyaml.version>1.33</snakeyaml.version>
<common-io.version>2.11.0</common-io.version>
<bouncycastle.version>1.70</bouncycastle.version>
<bouncycastle.version>1.72.2</bouncycastle.version>
<jackson-core.version>2.14.0</jackson-core.version>
<maven-jar-plugin.version>3.1.2</maven-jar-plugin.version>
<maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
Expand All @@ -33,7 +33,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.exclusions>**/enums/**,**/model/**,**/Constants*.java,**/*Config.java,**/*Application.java
</sonar.exclusions>
<transaction-filter.version>2.0.1</transaction-filter.version>
<transaction-filter.version>2.0.2</transaction-filter.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -67,7 +67,7 @@
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpg-jdk15on</artifactId>
<artifactId>bcpg-jdk18on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
Expand All @@ -77,6 +77,12 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- fix cve related to version 1.4-->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>it.gov.pagopa.rtd.ms.transaction_filter.integration</groupId>
<artifactId>rtd-ms-transaction-filter-integration-jpa</artifactId>
Expand Down

0 comments on commit 84d8459

Please sign in to comment.