Skip to content

Commit 867d2cd

Browse files
authored
Merge pull request #403 from kit-data-manager/development
PR for v1.2.6
2 parents 13c61a4 + a1df95a commit 867d2cd

28 files changed

+1320
-74
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v4
41+
uses: actions/checkout@v5
4242

4343
# Initialize minimum JDK version
4444
- name: Setup Java JDK
45-
uses: actions/setup-java@v4.6.0
45+
uses: actions/setup-java@v5.0.0
4646
with:
4747
distribution: zulu
4848
java-version: 17
4949

5050
# Initializes the CodeQL tools for scanning.
5151
- name: Initialize CodeQL
52-
uses: github/codeql-action/init@v3
52+
uses: github/codeql-action/init@v4
5353
with:
5454
languages: ${{ matrix.language }}
5555
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -60,7 +60,7 @@ jobs:
6060
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6161
# If this step fails, then you should remove it and run the build manually (see below)
6262
- name: Autobuild
63-
uses: github/codeql-action/autobuild@v3
63+
uses: github/codeql-action/autobuild@v4
6464

6565
# ℹ️ Command-line programs to run using the OS shell.
6666
# 📚 https://git.io/JvXDl
@@ -74,4 +74,4 @@ jobs:
7474
# make release
7575

7676
- name: Perform CodeQL Analysis
77-
uses: github/codeql-action/analyze@v3
77+
uses: github/codeql-action/analyze@v4

.github/workflows/gradle.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
jdk: [ 17, 19 ]
2323
steps:
2424
- name: Checkout repo
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v5
2626
- name: Set up OpenJDK version ...
27-
uses: actions/setup-java@v4.6.0
27+
uses: actions/setup-java@v5.0.0
2828
with:
2929
distribution: 'zulu'
3030
java-version: ${{ matrix.jdk }}
@@ -48,9 +48,9 @@ jobs:
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Checkout repo
51-
uses: actions/checkout@v4
51+
uses: actions/checkout@v5
5252
- name: Set up OpenJDK version ...
53-
uses: actions/setup-java@v4.6.0
53+
uses: actions/setup-java@v5.0.0
5454
with:
5555
distribution: 'zulu'
5656
java-version: ${{ env.currentBuildVersion }}

.github/workflows/publishRelease.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ jobs:
66
publish:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v4
9+
- uses: actions/checkout@v5
1010
- name: Set up Java
11-
uses: actions/setup-java@v4.6.0
11+
uses: actions/setup-java@v5.0.0
1212
with:
1313
java-version: 17
1414
distribution: zulu

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
##############################################################
21
# Gradle
32
##############################################################
43
# Ignore Gradle project-specific cache directory
@@ -16,6 +15,8 @@ nbproject
1615
.project
1716
.classpath
1817
.vscode
18+
# Ignore IntelliJ IDEA
19+
.idea/
1920

2021
##############################################################
2122
# Backup files

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ Instead of using a local build you may also use the most recent version from the
3939
<dependency>
4040
<groupId>edu.kit.datamanager</groupId>
4141
<artifactId>repo-core</artifactId>
42-
<version>1.2.0</version>
42+
<version>1.2.6</version>
4343
</dependency>
4444
~~~~
4545

4646
### Gradle (short)
4747

4848
~~~~
49-
implementation "edu.kit.datamanager:repo-core:1.2.0"
49+
implementation "edu.kit.datamanager:repo-core:1.2.6"
5050
~~~~
5151

5252
## License

build.gradle

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
* limitations under the License.
1515
*/
1616
plugins {
17-
id "io.freefair.lombok" version "8.12"
18-
id "io.freefair.maven-publish-java" version "8.12"
17+
id "io.freefair.lombok" version "9.0.0"
18+
id "io.freefair.maven-publish-java" version "9.0.0"
1919
id "io.spring.dependency-management" version "1.1.7"
2020
//id "com.github.kt3k.coveralls" version "2.8.1"
21-
id "org.owasp.dependencycheck" version "12.0.1"
22-
id "org.asciidoctor.jvm.convert" version "4.0.4"
21+
id "org.owasp.dependencycheck" version "12.1.8"
22+
id "org.asciidoctor.jvm.convert" version "4.0.5"
2323
//id "org.ajoberstar.grgit" version "2.0.1"
2424
id "java"
2525
id "jacoco"
@@ -32,17 +32,19 @@ plugins {
3232

3333
ext {
3434
// versions of dependencies
35-
springBootVersion = '3.4.2'
36-
springDocVersion = '2.8.3'
37-
javersVersion = '7.7.0'
35+
springBootVersion = '3.5.6'
36+
springDocVersion = '2.8.13'
37+
javersVersion = '7.9.0'
3838
}
3939

4040
description = "Core module for data repositories based on metadata model of datacite."
4141
group = 'edu.kit.datamanager'
4242

43-
sourceCompatibility = JavaVersion.VERSION_17
44-
targetCompatibility = JavaVersion.VERSION_17
45-
43+
java {
44+
sourceCompatibility = JavaVersion.VERSION_17
45+
targetCompatibility = JavaVersion.VERSION_17
46+
}
47+
4648
jar {
4749
archiveBaseName = 'repo-core'
4850
archiveVersion = System.getenv('version')
@@ -69,15 +71,15 @@ if (project.hasProperty('release')) {
6971

7072
dependencies {
7173
// Spring
72-
implementation 'org.springframework:spring-messaging:6.2.2'
74+
implementation 'org.springframework:spring-messaging:6.2.12'
7375
// Spring Boot
7476
implementation "org.springframework.boot:spring-boot-starter-data-rest"
7577
implementation "org.springframework.boot:spring-boot-starter-amqp"
7678
implementation "org.springframework.boot:spring-boot-starter-web"
7779
implementation "org.springframework.boot:spring-boot-starter-security"
7880
implementation "org.springframework.boot:spring-boot-starter-actuator"
7981
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
80-
implementation 'org.springframework.data:spring-data-elasticsearch:5.4.2'
82+
implementation 'org.springframework.data:spring-data-elasticsearch:5.5.5'
8183

8284

8385
// springdoc
@@ -86,44 +88,48 @@ dependencies {
8688
implementation "org.springdoc:springdoc-openapi-starter-webmvc-api:${springDocVersion}"
8789
// apache
8890
implementation "commons-configuration:commons-configuration:1.10"
89-
implementation "commons-io:commons-io:2.18.0"
90-
implementation "org.apache.commons:commons-collections4:4.4"
91+
implementation "commons-io:commons-io:2.20.0"
92+
implementation "org.apache.commons:commons-collections4:4.5.0"
9193
// includes commons-lang3
92-
implementation "org.apache.commons:commons-text:1.13.0"
94+
implementation "org.apache.commons:commons-text:1.14.0"
9395
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
94-
implementation "org.apache.tika:tika-core:3.0.0"
96+
implementation "org.apache.tika:tika-core:3.2.3"
9597
// javers
9698
implementation "org.javers:javers-spring-boot-starter-sql:${javersVersion}"
97-
implementation "com.google.code.gson:gson:2.11.0"
99+
implementation "com.google.code.gson:gson:2.13.2"
98100

99101
// Database
100-
implementation "com.h2database:h2:2.3.232"
101-
implementation "org.postgresql:postgresql:42.7.5"
102+
implementation "com.h2database:h2:2.4.240"
103+
implementation "org.postgresql:postgresql:42.7.8"
102104
// XML
103-
implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.18.2"
104-
implementation "com.fasterxml.jackson.module:jackson-module-afterburner:2.18.2"
105+
implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.20.0"
106+
implementation "com.fasterxml.jackson.module:jackson-module-afterburner:2.20.0"
105107

106-
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2"
107-
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:2.18.2"
108+
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.0"
109+
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:2.20.0"
108110

109111
//implementation "com.monitorjbl:spring-json-view:1.0.1"
110112

111-
implementation "de.codecentric:spring-boot-admin-starter-client:3.4.1"
113+
implementation "de.codecentric:spring-boot-admin-starter-client:3.5.5"
112114
// log4j core
113115
implementation "org.apache.logging.log4j:log4j-core"
114116
implementation "ch.qos.logback:logback-classic"
115117

116-
implementation "edu.kit.datamanager:service-base:1.3.3"
118+
implementation "edu.kit.datamanager:service-base:1.3.6"
117119

118120
implementation "com.github.java-json-tools:json-patch:1.13"
119121
implementation "com.github.dozermapper:dozer-core:7.0.0"
120122

123+
// monitoring
124+
implementation 'io.micronaut.micrometer:micronaut-micrometer-registry-prometheus:5.13.1'
125+
implementation 'org.springframework.boot:spring-boot-starter-actuator:3.5.6'
126+
121127
testImplementation "junit:junit:4.13.2"
122128
testImplementation "org.springframework:spring-test"
123129
// boot starter
124130
testImplementation 'org.springframework.boot:spring-boot-starter-validation'
125131
testImplementation "org.springframework.boot:spring-boot-starter-test"
126-
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:3.0.3'
132+
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:3.0.5'
127133
testImplementation "org.springframework.security:spring-security-test"
128134

129135
//Java 11 Support
@@ -155,7 +161,7 @@ test {
155161
}
156162

157163
jacoco {
158-
toolVersion = "0.8.12"
164+
toolVersion = "0.8.14"
159165
}
160166

161167
tasks.withType(Test) {

docs/documentation.adoc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -476,15 +476,15 @@ in the database.
476476
In contrast to deleting entire resource, deleting single content elements is permanent. If you send a DELETE request to a data URL of a resource, the associated file and all metadata associated with the particular
477477
element are deleted. This operation is not reversible and you should double check before deleting a content element.
478478

479-
= Messaging and Event Message Handling
479+
== Messaging and Event Message Handling
480480

481-
== Introduction
481+
=== Introduction
482482

483483
For a data repository creating a resource and uploading data is only the simplest workflow. In many cases, additional steps have to be performed in order to obtain all required information, to validate an upload or
484484
to monitor what happens. For this purpose, KIT Data Manager offers a feature called 'messaging' emitting small messages after certain operations have succeeded. The following chapters describe how these messages
485485
are look like, when they are emitted and how to deal with them in order to react on certain repository events.
486486

487-
== Message Types and Format
487+
=== Message Types and Format
488488

489489
There are different kinds of messages grouped by category. Depending on its category, a message may contain additional properties or not. The following table shows all currently available message categories and the
490490
condition under which a message with a certain category is sent.
@@ -513,7 +513,7 @@ You will find all default elements mentioned above as well as the 'metadata' ele
513513
the operation they are related to has successfully finished, jut before returning the result to the user. Therefor, a Message Queue service called RabbitMQ is used, which has to be installed in addition to the database
514514
and the repository microservice itself in order to be able to exchange messages.
515515

516-
== Messaging Service Configuration
516+
=== Messaging Service Configuration
517517

518518
In order to make use of the messaging feature, a RabbitMQ instance must be running, preferably locally for security reasons. Please refer to the RabbitMQ web page (https://www.rabbitmq.com/) on how to install and
519519
operate such an instance. From the repository perspective, all relevant settings are part of the default configuration file 'application.properties'. These properties, their function and values/defaults are listed
@@ -532,7 +532,7 @@ in the following table. Typically, no additional repository-specific configurati
532532
|repo.schedule.rate|The schedule rate in milliseconds at which the repository checks for new messages.|A numeric amount of milliseconds [1000]
533533
|============================================================================================================================
534534

535-
== Adding a Message Handler
535+
=== Adding a Message Handler
536536

537537
There are multiple possibilities to consume messages from a server supporting the Advanced Message Queuing Protocol (AMQP) like RabbitMQ. In this documentation, we'll describe how to do this using the built-in messaging support.
538538
Therefore, it's beneficial if you already have some programming experiences, preferably in Java.
@@ -568,22 +568,22 @@ Thus, if we in our sample handler wouldn't return 'REJECTED', our status would i
568568
After implementing a custom message handler you have to build a jar file and place it, together with all required dependencies, in the extensions folder of your KIT DM 2.0 installation. If your handler needs any configuration,
569569
it is recommended to place it in the current working directory at service startup, which is typically the folder where 'base-repo.jar' is located.
570570

571-
= Audit Information and Versioning of Metadata Resources
571+
== Audit Information and Versioning of Metadata Resources
572572

573-
== Introduction
573+
=== Introduction
574574

575575
Not only in living data repositories metadata (and sometimes also data) are subject of change, either by a user or in the course of curation activities. For validation and documentation purposes it can be desirable
576576
to keep track of these changes, either for monitoring or to be able to rollback unwanted changes at a later point in time. Therefor, KIT Data Manager offers support for capturing audit information and versioning of
577577
metadata documents. It uses the JaVers library (https://javers.org/) to collect changes between two versions of one document and stores this information in a relational database. With the collected changes
578578
JaVers is capable of creating so called 'Shadows' of a document, which are representing a version at a specific point in time.
579579

580-
== Audit Information and Versioning Configuration
580+
=== Audit Information and Versioning Configuration
581581

582582
Enabling or disabling the audit and versioning feature can be done easily by setting the value of the property 'repo.audit.enabled' inside 'application.properties' either 'true' or 'false'. All audit information is stored
583583
in the same database configured for the repository, therefore, no additional configuration is needed. If the feature was not enabled, yet, you can enable it at any time to start capturing audit information beginning with
584584
the next restart of the repository service. You may also disable the feature again, e.g. temporarily to avoid capturing information, as the primary version of a resource is stored at the repository.
585585

586-
== Working with Versions and Audit Information
586+
=== Working with Versions and Audit Information
587587

588588
Audit and versioning support are seamlessly integrated into the internal workflows and you can benefit from it easily. If you go back to the example of how to <<ChapterGetResource,get a Data Resource>> you'll find in the response
589589
header the property 'Resource-Version' with a value of 1. If you scroll down to the second GET operation performed after updating the resource, you'll see that 'Resource-Version' has been increased to 2. Additionally, a version number
@@ -621,9 +621,11 @@ include::{snippets}/get-current-resource-version/http-response.adoc[]
621621

622622
As mentioned at the beginning, versioning is supported for metadata resources, e.g. data resources and content information. There is currently no support for versioning of the actual content.
623623

624-
== Remarks on Working with Versions
624+
=== Remarks on Working with Versions
625625

626626
While working with versions you should keep some particularities in mind. Access to version is only possible for single resources. There is e.g. no way to obtain all resources in version 2 from the server.
627627
If a specific version of a resource is returned, the obtained ETag also relates to this specific version. Therefore, you should NOT use this ETag for any update operation as the operation will fail with response
628628
code 412 (PRECONDITION FAILED). Consequently, it is also NOT allowed to modify a format version of a resource. If you want to rollback to a previous version, you should obtain the resource and submit a PUT request
629629
of the entire document which will result in a new version equal to the previous state unless there were changes you are not allowed to apply (anymore), e.g. if permissions have changed.
630+
631+
include::monitoring.adoc[]

0 commit comments

Comments
 (0)