From dd8002fc862d39804833ef7adbb505082a341c4d Mon Sep 17 00:00:00 2001 From: Timothy Sanders Date: Fri, 20 Dec 2024 18:10:39 -0500 Subject: [PATCH 1/9] Add JaCoCo --- pom.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pom.xml b/pom.xml index 0dc1f1a8..943aaf9c 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,7 @@ 2.17.0 1.18.1 + 0.8.12 @@ -307,6 +308,28 @@ + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + prepare-agent + + prepare-agent + + + + report-aggregate + verify + + report-aggregate + + + + + From c7990f884eeb8a37db38330d285a17443391e4e0 Mon Sep 17 00:00:00 2001 From: Timothy Sanders Date: Fri, 20 Dec 2024 19:19:59 -0500 Subject: [PATCH 2/9] Add JaCoCo to submodule and aggregate report --- pass-core-doi-service/pom.xml | 18 ++++++++++++++++++ pom.xml | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/pass-core-doi-service/pom.xml b/pass-core-doi-service/pom.xml index 7e714836..585dbd48 100644 --- a/pass-core-doi-service/pom.xml +++ b/pass-core-doi-service/pom.xml @@ -42,4 +42,22 @@ test + + + + + org.jacoco + jacoco-maven-plugin + + + prepare-agent + + prepare-agent + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 943aaf9c..3576ec05 100644 --- a/pom.xml +++ b/pom.xml @@ -328,6 +328,11 @@ + + ${project.reporting.outputDirectory}/jacoco-aggregate + ${project.build.directory}/jacoco.exec + true + From 2d3a53b4f65f42541b320ab31bfb59edf4e01abe Mon Sep 17 00:00:00 2001 From: tsande16 Date: Mon, 23 Dec 2024 13:40:18 -0500 Subject: [PATCH 3/9] Add report aggregate submodule --- jacoco-aggregate-report/pom.xml | 50 +++++++++++++++++++++++++++++++++ pass-core-file-service/pom.xml | 18 ++++++++++++ pom.xml | 13 +-------- 3 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 jacoco-aggregate-report/pom.xml diff --git a/jacoco-aggregate-report/pom.xml b/jacoco-aggregate-report/pom.xml new file mode 100644 index 00000000..5908d7ad --- /dev/null +++ b/jacoco-aggregate-report/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + org.eclipse.pass + pass-core + 1.14.0-SNAPSHOT + + + jacoco-aggregate-report + + + 23 + 23 + UTF-8 + + + + + + org.eclipse.pass + pass-core-doi-service + + + org.eclipse.pass + pass-core-file-service + + + + + + + + org.jacoco + jacoco-maven-plugin + + + report-aggregate + verify + + report-aggregate + + + + + + + + + \ No newline at end of file diff --git a/pass-core-file-service/pom.xml b/pass-core-file-service/pom.xml index e664789d..046fd022 100644 --- a/pass-core-file-service/pom.xml +++ b/pass-core-file-service/pom.xml @@ -60,4 +60,22 @@ test + + + + + org.jacoco + jacoco-maven-plugin + + + prepare-agent + + prepare-agent + + + + + + + diff --git a/pom.xml b/pom.xml index 3576ec05..41427f86 100644 --- a/pom.xml +++ b/pom.xml @@ -64,6 +64,7 @@ pass-core-policy-service pass-core-usertoken pass-core-test-config + jacoco-aggregate-report @@ -320,19 +321,7 @@ prepare-agent - - report-aggregate - verify - - report-aggregate - - - - ${project.reporting.outputDirectory}/jacoco-aggregate - ${project.build.directory}/jacoco.exec - true - From dc452fada7b8eb8d3fa6c9892e4643e36452dc99 Mon Sep 17 00:00:00 2001 From: tsande16 Date: Thu, 2 Jan 2025 16:53:45 -0500 Subject: [PATCH 4/9] Fix aggregate report - Aggregate report now gathering from submodules - Add submodules metadataschema and object service --- jacoco-aggregate-report/pom.xml | 39 +++++++++++++++--------- pass-core-doi-service/pom.xml | 1 + pass-core-file-service/pom.xml | 3 +- pass-core-main/pom.xml | 14 +++++++++ pass-core-metadataschema-service/pom.xml | 18 +++++++++++ pass-core-object-service/pom.xml | 19 ++++++++++++ 6 files changed, 79 insertions(+), 15 deletions(-) diff --git a/jacoco-aggregate-report/pom.xml b/jacoco-aggregate-report/pom.xml index 5908d7ad..d271fd61 100644 --- a/jacoco-aggregate-report/pom.xml +++ b/jacoco-aggregate-report/pom.xml @@ -1,6 +1,7 @@ 4.0.0 + org.eclipse.pass pass-core @@ -8,6 +9,7 @@ jacoco-aggregate-report + pom 23 @@ -15,24 +17,35 @@ UTF-8 - - - - org.eclipse.pass - pass-core-doi-service - - - org.eclipse.pass - pass-core-file-service - - - + + + org.eclipse.pass + pass-core-doi-service + ${project.version} + + + org.eclipse.pass + pass-core-file-service + ${project.version} + + + org.eclipse.pass + pass-core-metadataschema-service + ${project.version} + + + org.eclipse.pass + pass-core-object-service + ${project.version} + + org.jacoco jacoco-maven-plugin + ${jacoco-maven-plugin.version} report-aggregate @@ -45,6 +58,4 @@ - - \ No newline at end of file diff --git a/pass-core-doi-service/pom.xml b/pass-core-doi-service/pom.xml index 585dbd48..c60a059a 100644 --- a/pass-core-doi-service/pom.xml +++ b/pass-core-doi-service/pom.xml @@ -48,6 +48,7 @@ org.jacoco jacoco-maven-plugin + ${jacoco-maven-plugin.version} prepare-agent diff --git a/pass-core-file-service/pom.xml b/pass-core-file-service/pom.xml index 046fd022..7504d85b 100644 --- a/pass-core-file-service/pom.xml +++ b/pass-core-file-service/pom.xml @@ -3,8 +3,8 @@ 4.0.0 - pass-core org.eclipse.pass + pass-core 1.14.0-SNAPSHOT @@ -66,6 +66,7 @@ org.jacoco jacoco-maven-plugin + ${jacoco-maven-plugin.version} prepare-agent diff --git a/pass-core-main/pom.xml b/pass-core-main/pom.xml index a46de262..5c6aa24a 100644 --- a/pass-core-main/pom.xml +++ b/pass-core-main/pom.xml @@ -257,6 +257,20 @@ cyclonedx-maven-plugin + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + prepare-agent + + prepare-agent + + + + + diff --git a/pass-core-metadataschema-service/pom.xml b/pass-core-metadataschema-service/pom.xml index 8f2ec2c1..6d87585e 100644 --- a/pass-core-metadataschema-service/pom.xml +++ b/pass-core-metadataschema-service/pom.xml @@ -33,4 +33,22 @@ + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + prepare-agent + + prepare-agent + + + + + + + \ No newline at end of file diff --git a/pass-core-object-service/pom.xml b/pass-core-object-service/pom.xml index a918d1ea..b697ce1a 100644 --- a/pass-core-object-service/pom.xml +++ b/pass-core-object-service/pom.xml @@ -31,4 +31,23 @@ test + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + prepare-agent + + prepare-agent + + + + + + + From 9939e3e1b8df27d7c41a89580ba25882e114dd4e Mon Sep 17 00:00:00 2001 From: tsande16 Date: Thu, 2 Jan 2025 17:16:45 -0500 Subject: [PATCH 5/9] Add submodules to aggregate report --- jacoco-aggregate-report/pom.xml | 15 +++++++++++++++ pass-core-policy-service/pom.xml | 18 ++++++++++++++++++ pass-core-user-service/pom.xml | 19 +++++++++++++++++++ pass-core-usertoken/pom.xml | 19 +++++++++++++++++++ 4 files changed, 71 insertions(+) diff --git a/jacoco-aggregate-report/pom.xml b/jacoco-aggregate-report/pom.xml index d271fd61..819d3b98 100644 --- a/jacoco-aggregate-report/pom.xml +++ b/jacoco-aggregate-report/pom.xml @@ -38,6 +38,21 @@ pass-core-object-service ${project.version} + + org.eclipse.pass + pass-core-policy-service + ${project.version} + + + org.eclipse.pass + pass-core-user-service + ${project.version} + + + org.eclipse.pass + pass-core-usertoken + ${project.version} + diff --git a/pass-core-policy-service/pom.xml b/pass-core-policy-service/pom.xml index 6462384d..c7987127 100644 --- a/pass-core-policy-service/pom.xml +++ b/pass-core-policy-service/pom.xml @@ -36,4 +36,22 @@ + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + prepare-agent + + prepare-agent + + + + + + + \ No newline at end of file diff --git a/pass-core-user-service/pom.xml b/pass-core-user-service/pom.xml index 39426f8d..84f84993 100644 --- a/pass-core-user-service/pom.xml +++ b/pass-core-user-service/pom.xml @@ -40,4 +40,23 @@ ${jakarta.json.version} + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + prepare-agent + + prepare-agent + + + + + + + diff --git a/pass-core-usertoken/pom.xml b/pass-core-usertoken/pom.xml index c1186f1b..33ef47b9 100644 --- a/pass-core-usertoken/pom.xml +++ b/pass-core-usertoken/pom.xml @@ -24,4 +24,23 @@ test + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + prepare-agent + + prepare-agent + + + + + + + From e1fc2d765517cffb65a1b2618a9b4233a7fee2dd Mon Sep 17 00:00:00 2001 From: tsande16 Date: Fri, 3 Jan 2025 10:17:49 -0500 Subject: [PATCH 6/9] Add javadoc to file service --- .../service/storage/FileStorageService.java | 4 ++ .../service/storage/StorageConfiguration.java | 41 +++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/pass-core-file-service/src/main/java/org/eclipse/pass/file/service/storage/FileStorageService.java b/pass-core-file-service/src/main/java/org/eclipse/pass/file/service/storage/FileStorageService.java index de032e89..ffe56a51 100644 --- a/pass-core-file-service/src/main/java/org/eclipse/pass/file/service/storage/FileStorageService.java +++ b/pass-core-file-service/src/main/java/org/eclipse/pass/file/service/storage/FileStorageService.java @@ -82,6 +82,10 @@ public class FileStorageService { /** * FileStorageService Class constructor. + * + * @param ocflRepository ocfl object that is a layer to handle the io of the files + * @param storageProperties properties indicating where and what type of storage is used for persistence. + * @param rootLoc path of the root location used to set up temp working directory for the File Service */ public FileStorageService(OcflRepository ocflRepository, StorageProperties storageProperties, diff --git a/pass-core-file-service/src/main/java/org/eclipse/pass/file/service/storage/StorageConfiguration.java b/pass-core-file-service/src/main/java/org/eclipse/pass/file/service/storage/StorageConfiguration.java index 630be7fc..476ca01e 100644 --- a/pass-core-file-service/src/main/java/org/eclipse/pass/file/service/storage/StorageConfiguration.java +++ b/pass-core-file-service/src/main/java/org/eclipse/pass/file/service/storage/StorageConfiguration.java @@ -59,6 +59,11 @@ public class StorageConfiguration { @Value("${aws.region}") private String awsRegion; + /** + * Creates and configures an S3TransferManager for managing file transfers to Amazon S3. + * + * @return a configured S3TransferManager instance. + */ @Bean @ConditionalOnProperty(name = "pass.file-service.storage-type", havingValue = "S3") public S3TransferManager s3TransferManager() { @@ -72,6 +77,13 @@ public S3TransferManager s3TransferManager() { .build(); } + /** + * Creates and configures an S3AsyncClient for interacting with Amazon S3 or an S3-compatible storage service. + * + * @param storageProperties the StorageProperties containing the configuration. + * @return a configured S3AsyncClient instance. + * @throws IOException if the S3 bucket name is not set in StorageProperties. + */ @Bean @ConditionalOnProperty(name = "pass.file-service.storage-type", havingValue = "S3") public S3AsyncClient s3Client(StorageProperties storageProperties) throws IOException { @@ -93,6 +105,17 @@ public S3AsyncClient s3Client(StorageProperties storageProperties) throws IOExce return s3Client; } + /** + * Creates and configures an OcflRepository instance for use with Amazon S3 as the storage backend. + * + * @param s3Client the S3AsyncClient for interacting with Amazon S3. + * @param s3TransferManager the S3TransferManager to manage file transfers to S3. + * @param storageProperties the StorageProperties containing the configuration. + * @param rootLoc the root Path for the file service. + * @return a OcflRepository instance, using S3 as the storage layer. + * @throws IOException if the S3 bucket name is not set in the StorageProperties, or if there are + * issues creating or accessing the working directory. + */ @Bean @ConditionalOnProperty(name = "pass.file-service.storage-type", havingValue = "S3") public OcflRepository ocflS3Repository(S3AsyncClient s3Client, S3TransferManager s3TransferManager, @@ -121,6 +144,17 @@ public OcflRepository ocflS3Repository(S3AsyncClient s3Client, S3TransferManager return ocflRepository; } + /** + * Creates and configures an {@link OcflRepository} instance when the file service storage type + * is set to "FILE_SYSTEM". This method ensures that the OCFL directory exists, is accessible, + * and is properly set up with the required permissions. + * + * @param storageProperties the StorageProperties object containing storage configurations. + * @param rootLoc the root Path where the OCFL directory will be created or accessed. + * @return a fully configured OcflRepository instance backed by a file system storage type. + * @throws IOException if the OCFL directory cannot be created, or if there are insufficient + * read/write permissions. + */ @Bean @ConditionalOnProperty(name = "pass.file-service.storage-type", havingValue = "FILE_SYSTEM") public OcflRepository ocflFileRepository(StorageProperties storageProperties, @@ -142,6 +176,13 @@ public OcflRepository ocflFileRepository(StorageProperties storageProperties, return ocflRepository; } + /** + * Configures and provides the root Path for the file service storage. + * + * @param storageProperties the StorageProperties object containing storage configuration details. + * @return the root Path for the storage system. + * @throws IOException if an error occurs while creating the temporary directory. + */ @Bean @Qualifier("rootPath") public Path rootPath(StorageProperties storageProperties) throws IOException { From 6a1878744ad7d71a4cab68725d568c4eff978c86 Mon Sep 17 00:00:00 2001 From: tsande16 Date: Fri, 3 Jan 2025 16:13:09 -0500 Subject: [PATCH 7/9] Add exclusion --- jacoco-aggregate-report/pom.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/jacoco-aggregate-report/pom.xml b/jacoco-aggregate-report/pom.xml index 819d3b98..8b47e783 100644 --- a/jacoco-aggregate-report/pom.xml +++ b/jacoco-aggregate-report/pom.xml @@ -33,6 +33,17 @@ pass-core-metadataschema-service ${project.version} + + org.eclipse.pass + pass-core-main + ${project.version} + + + org.ow2.asm + asm-tree + + + org.eclipse.pass pass-core-object-service From aa3cd9ab1ca8221642d910e54785c0db0c5faa1f Mon Sep 17 00:00:00 2001 From: tsande16 Date: Mon, 6 Jan 2025 15:43:34 -0500 Subject: [PATCH 8/9] Fix compile version --- jacoco-aggregate-report/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jacoco-aggregate-report/pom.xml b/jacoco-aggregate-report/pom.xml index 8b47e783..856e60e5 100644 --- a/jacoco-aggregate-report/pom.xml +++ b/jacoco-aggregate-report/pom.xml @@ -12,8 +12,8 @@ pom - 23 - 23 + 17 + 17 UTF-8 From 5b6e40c3626383d0f63d82365b3a220e3b0f02b4 Mon Sep 17 00:00:00 2001 From: tsande16 Date: Tue, 7 Jan 2025 10:22:52 -0500 Subject: [PATCH 9/9] Remove compile version. --- jacoco-aggregate-report/pom.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/jacoco-aggregate-report/pom.xml b/jacoco-aggregate-report/pom.xml index 856e60e5..08ecad19 100644 --- a/jacoco-aggregate-report/pom.xml +++ b/jacoco-aggregate-report/pom.xml @@ -12,9 +12,6 @@ pom - 17 - 17 - UTF-8