-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: P4ADEV-1545 fdr ingestion actity implementation retrieval via query file validation #22
base: main
Are you sure you want to change the base?
Conversation
...gopa/payhub/activities/activity/paymentsreporting/service/IngestionFileValidatorService.java
Fixed
Show fixed
Hide fixed
src/test/java/it/gov/pagopa/payhub/activities/util/AESUtilsTest.java
Dismissed
Show dismissed
Hide dismissed
src/test/java/it/gov/pagopa/payhub/activities/util/AESUtilsTest.java
Dismissed
Show dismissed
Hide dismissed
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
...pa/payhub/activities/activity/paymentsreporting/service/IngestionFileHandlerServiceTest.java
Fixed
Show fixed
Hide fixed
… into P4ADEV-1545-FdRIngestionActity-implementation-retrieval-via-query-file-validation # Conflicts: # src/test/java/it/gov/pagopa/payhub/activities/activity/debtposition/AuthorizeOperatorOnDebtPositionTypeActivityTest.java
src/main/java/it/gov/pagopa/payhub/activities/service/IngestionFileValidatorService.java
Fixed
Show fixed
Hide fixed
src/test/java/it/gov/pagopa/payhub/activities/service/IngestionFileHandlerServiceTest.java
Fixed
Show fixed
Hide fixed
…y-file-validation - moved package
...ava/it/gov/pagopa/payhub/activities/service/ingestionflow/IngestionFileValidatorService.java
Fixed
Show fixed
Hide fixed
...a/it/gov/pagopa/payhub/activities/service/ingestionflow/IngestionFileHandlerServiceTest.java
Dismissed
Show dismissed
Hide dismissed
…ionActity-implementation-retrieval-via-query-file-validation
Quality Gate passedIssues Measures |
* Interface for the ReportingFlowIngestionActivity. | ||
* Defines methods for processing files based on an IngestionFlow ID. | ||
*/ | ||
public interface ReportingFlowIngestionActivity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public interface ReportingFlowIngestionActivity { | |
public interface PaymentsReportingIngestionFlowActivity { |
|
||
/** | ||
* Interface for the ReportingFlowIngestionActivity. | ||
* Defines methods for processing files based on an IngestionFlow ID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Defines methods for processing files based on an IngestionFlow ID. | |
* Defines methods for processing payments reporting files based on an IngestionFlow ID. |
public interface ReportingFlowIngestionActivity { | ||
|
||
/** | ||
* Processes a file based on the provided IngestionFlow ID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Processes a file based on the provided IngestionFlow ID. | |
* Processes a payments reporting file based on the provided IngestionFlow ID. |
/** | ||
* Implementation of the `ReportingFlowIngestionActivity` interface. | ||
* Manages the ingestion of reporting flow files, including validation and processing. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the javadoc is required just on Activities interface (Class and methods), the implementation will inherit it.
(also the DAO interfaces, just methods, should have javadoc in order to describe what should be implemented)
|
||
@Slf4j | ||
@Component | ||
public class ReportingFlowIngestionActivityImpl implements ReportingFlowIngestionActivity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public class ReportingFlowIngestionActivityImpl implements ReportingFlowIngestionActivity { | |
public class PaymentsReportingIngestionFlowActivityImpl implements PaymentsReportingIngestionFlowActivity { |
* | ||
* @param zipEntry the ZIP entry to validate. | ||
* @param targetDir the target directory for extraction. | ||
* @return a safe, normalized path within the target directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @return a safe, normalized path within the target directory. | |
* @return a safe, normalized path towards zipEntry within the target directory. |
* <li>An I/O error occurs during extraction.</li> | ||
* </ul> | ||
*/ | ||
public static void unzip(Path source, Path target) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method could return the list of unzipped Path
log.debug("Validating ZIP file: {}", temporaryZipFilePath); | ||
FileUtils.isArchive(temporaryZipFilePath); | ||
|
||
String unzippedFilename = filenameNoCipher.replace(".zip", ".xml"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FileUtils.unzip will accept a directory, not the final unzipped filename
thus you have to call the unzip with just the temporaryPath, using its returned value to retrieve the Path to the unzipped file (you have to modify unzip method to return the list of unzip files
we could let this setupProcess to return a List or (letting the invoking method to validate the presence of just 1 file) or set here the check of the unzipped file number
Path encryptedFilePath = relativePathDir.resolve(filename); | ||
FileUtils.validateFile(encryptedFilePath); | ||
|
||
Path temporaryPath = relativePathDir.resolve(TEMPORARY_PATH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if TEMPORARY_PATH will be Paths.of("/tmp")
, this could be
TEMPORARY_PATH.resolve(relativePathDir.subpath(0, relativePathDir.getNameCount()))
* @return the path to the extracted XML file. | ||
* @throws IOException if any file operation fails during the setup process. | ||
*/ | ||
public Path setUpProcess(String relativePath, String filename) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class could be just IngestionFileRetrieverService instead of a generic Handler
public Path setUpProcess(String relativePath, String filename) throws IOException { | |
public Path retrieveFile(String relativePath, String filename) throws IOException { |
Description
Implementation of the following steps:
List of Changes
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist: