Skip to content
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

Development branch for v2.0.0 #174

Merged
merged 86 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
93e0602
TypeRegistry: Make caching self-contained.
Pfeil Mar 23, 2023
0df50be
Rename typeCache to typeLoader.
Pfeil Mar 23, 2023
ecef206
Draft of validation strategy pattern.
Pfeil Mar 28, 2023
73772df
Use noop validation strategy instead of Optional.
Pfeil Mar 28, 2023
17db03d
Introduce new validation structure to API.
Pfeil Mar 28, 2023
0e9f494
Fix symbol not found.
Pfeil Mar 28, 2023
b4a9da9
Avoid possible NPE in validation helper.
Pfeil Mar 28, 2023
ddaf7c3
Add missing documentation.
Pfeil Mar 28, 2023
1d2b7f7
Fix assertion order.
Pfeil Mar 28, 2023
882c0a7
Cleanup
Pfeil Mar 30, 2023
148e389
Give test containers some more time.
Pfeil Mar 30, 2023
e26a8f3
Avoid possible NPE.
Pfeil Mar 30, 2023
4f575b7
Remove Lombok from PidRecord.
Pfeil Mar 30, 2023
118e1f6
Fix possible NPE.
Pfeil Mar 30, 2023
da77d35
Add documentation to validation strategy.
Pfeil Apr 26, 2023
4a03dea
Add tests for unsupported content types.
Pfeil Apr 26, 2023
906cac2
HTTP 409 if PID already exists
Pfeil Apr 27, 2023
789720a
Add etag method for PIDRecord.
Pfeil Apr 27, 2023
aaf6747
Add etag support
Pfeil Apr 28, 2023
de5d394
Fix record serialization
Pfeil Apr 28, 2023
435807f
Add etag tests
Pfeil Apr 28, 2023
1c058cc
Adjust other tests
Pfeil Apr 28, 2023
14fcecf
Cleanup obsolete exceptions.
Pfeil Apr 28, 2023
36ede20
fix(validation): avoid invalid comparison of PIDs
Pfeil May 2, 2023
049c5ae
Merge branch 'master' into 114-unclearnon-standard-response-for-post-…
Pfeil Jun 29, 2023
078701a
test(docker): Remove docker test for update
Pfeil Jun 29, 2023
5b1ff6a
cleanup: remove unused imports
Pfeil Jun 29, 2023
611d511
cleanup: apply some sonarlint suggestions
Pfeil Jun 29, 2023
8cbe7c0
docs(api): adjust error cases to current implementation
Pfeil Jun 29, 2023
527710a
feat: send error messages in HTTP reponse headers.
Pfeil Jul 28, 2023
130af2d
Merge remote-tracking branch 'origin/master' into 114-unclearnon-stan…
Pfeil Jul 28, 2023
5b361f0
fix(docs): add missing exception description
Pfeil Jul 28, 2023
a66c81f
cleanup!: remove Handle REST impl. for now.
Pfeil Jul 28, 2023
53a65f4
ci: set java 17 as minimum
Pfeil Jul 28, 2023
56bfab0
fix: database errors map to wrong error codes
Pfeil Jul 31, 2023
0bbf95a
ci: enable ci for development branches
Pfeil Jul 31, 2023
b7f8413
cleanup: fix sonarlint remarks in createPID
Pfeil Sep 4, 2023
002cb3a
feat: add dryrun option for createPID
Pfeil Sep 4, 2023
6b590c4
cleanup: in-memory REST test class
Pfeil Sep 4, 2023
b60635b
Merge branch 'dev-v2' into 114-unclearnon-standard-response-for-post-…
Pfeil Sep 4, 2023
8269287
cleanup: fix sonarlint hints
Pfeil Sep 4, 2023
dc9d2db
feat: validation option for resolvePID
Pfeil Sep 4, 2023
c559825
fix: include pid-record in validation error responses
Pfeil Sep 8, 2023
8323d07
docs: improve specification of body content type on error.
Pfeil Sep 8, 2023
77ee312
cleanup: remove replaced APIs
Pfeil Sep 8, 2023
d0139f6
test: remove docker tests of removed APIs
Pfeil Sep 9, 2023
b72db98
cleanup: imports and style
Pfeil Sep 9, 2023
8959766
test: exclude untestable code (configs, bean definitions)
Pfeil Sep 9, 2023
abbbadb
cleanup: remove old validation code.
Pfeil Sep 9, 2023
11b5f29
Merge branch 'dev-v2' into 114-unclearnon-standard-response-for-post-…
Pfeil Sep 9, 2023
07fa434
docs: update openAPI base information
Pfeil Sep 9, 2023
76c8ea4
test: presence of error messages
Pfeil Sep 13, 2023
d0cc10e
Merge pull request #125 from kit-data-manager/114-unclearnon-standard…
Pfeil Sep 14, 2023
8c26732
chore: temp. force-raise spring security version
Pfeil Sep 14, 2023
bc724c3
chore: remove deprecations in web security config
Pfeil Sep 14, 2023
0e2b308
chore: update spring boot, service-base and repo-core
Pfeil Sep 15, 2023
7721742
chore: rename javax to jakarta
Pfeil Sep 15, 2023
08bb892
chore: set duplication strategy for gradle tasks
Pfeil Sep 15, 2023
7d88678
cleanup: remove unused code from gradle file
Pfeil Sep 15, 2023
9592407
cleanup: remove unused rest template code
Pfeil Sep 15, 2023
79651fa
fix: jakarta imports in tests
Pfeil Sep 15, 2023
b62c1bf
fix: rest endpoints should not start with slashes in spring boot 3
Pfeil Sep 15, 2023
bd845f7
fix: Elasticsearch setup
Pfeil Sep 15, 2023
39c4557
docs: show actuator endpoint in swagger
Pfeil Sep 19, 2023
f97f951
deps: upgrade lombok and jacoco
Pfeil Sep 19, 2023
d923a0d
deps: upgrade springdoc
Pfeil Sep 19, 2023
ff23219
fix(test): test body in mockmvc properly.
Pfeil Sep 19, 2023
9d9e999
fix: request /known-pids without slash at end
Pfeil Sep 23, 2023
9cc5d56
style: avoid empty lines in function parameter
Pfeil Sep 23, 2023
d84d0b1
fix(test): enable swagger access without authentication
Pfeil Sep 23, 2023
7d77269
docs: improve docs on diff implementation details
Pfeil Sep 23, 2023
92f566b
test: handle diff implementation details
Pfeil Sep 23, 2023
5f64149
build(deps): bump org.springframework.boot to version 3.1.5
Pfeil Nov 10, 2023
ce31193
build(deps): bump io.freefair.lombok to 8.4 / 1.18.30
Pfeil Nov 10, 2023
e13cd4a
build(deps): bump jacoco tool version to 0.8.11
Pfeil Nov 10, 2023
428c97b
build(deps): bump com.google.guava to 32.1.3-jre
Pfeil Nov 10, 2023
678da97
fix: elasticsearch repository setup
Pfeil Nov 10, 2023
86b39ba
build(deps): update gradle wrapper to version 8.4
Pfeil Nov 10, 2023
ca5aae6
sonarlint: avoid field injection in elastic configuration
Pfeil Nov 10, 2023
8759250
sonarlint: avoid field injection in web security config
Pfeil Nov 10, 2023
06be3dd
chore: remove deprecated functions from web config
Pfeil Nov 10, 2023
7c6b317
sonarlint: avoid public in tests, if possible.
Pfeil Nov 10, 2023
1e403b6
Merge pull request #168 from kit-data-manager/115-upgrade-spring-boot
Pfeil Nov 10, 2023
0743e95
Revert "build(deps): update gradle wrapper to version 8.4"
Pfeil Nov 10, 2023
eed92c5
code-analysis: do not use autobuild
Pfeil Nov 10, 2023
2c33261
ci: remove explicit push trigger on dev branches
Pfeil Nov 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 18 additions & 25 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
# CodeQL code analysis
name: "CodeQL"

on:
Expand Down Expand Up @@ -40,8 +30,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- name: Initialize CodeQL tools for scanning
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
Expand All @@ -52,19 +41,23 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
#- name: Autobuild
# uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
- name: Set up openJDK version
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu' # =openJDK
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build (no tests)
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
arguments: clean build -x test

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
11 changes: 8 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ name: Build and Test

on:
push:
branches: [ master, main ]
branches:
- master
- main
pull_request:
branches: [ master, main ]
branches:
- master
- main
- 'dev**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand All @@ -21,7 +26,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest, macOS-latest, windows-latest]
jdk: [ 11, 17 ] # (open)JDK releases
jdk: [ 17 ] # (open)JDK releases

steps:
- uses: actions/checkout@v4
Expand Down
45 changes: 23 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
// Spring boot & dependency management:
// https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/
id 'org.springframework.boot' version '2.7.15'
id 'org.springframework.boot' version '3.1.5'
// https://docs.spring.io/dependency-management-plugin/docs/current-SNAPSHOT/reference/html/
id "io.spring.dependency-management" version "1.1.3"
// Lombok generates getter and setter and more. https://projectlombok.org/
// check for new versions here: https://plugins.gradle.org/plugin/io.freefair.lombok
id "io.freefair.lombok" version "8.3"
id "io.freefair.lombok" version "8.4"
// Release tagging with `./gradlew release`
// Check for new versions here: https://plugins.gradle.org/plugin/net.researchgate.release
// Usage: https://github.com/researchgate/gradle-release
Expand All @@ -19,21 +19,19 @@ plugins {
id 'jacoco'
// Adds coveralls task for CI to send results to the coveralls service.
id "com.github.kt3k.coveralls" version "2.12.2"
//id "com.github.kt3k.coveralls" version "2.12.0"
id "org.owasp.dependencycheck" version "8.4.0"
id 'org.asciidoctor.jvm.convert' version '3.3.2'
// include build and git information via Spring Actuator
id "com.gorylenko.gradle-git-properties" version "2.4.1"
}

lombok {
// check here for new versions: https://projectlombok.org/download
version = '1.18.22'
version = '1.18.30'
}

jacoco {
// check here for new versions: https://www.jacoco.org/jacoco/
toolVersion = "0.8.7"
toolVersion = "0.8.11"
}

archivesBaseName = 'TypedPIDMaker'
Expand All @@ -51,16 +49,16 @@ repositories {
}

ext {
springDocVersion = '1.7.0'
springDocVersion = '2.2.0'
}

dependencies {
// Due to the spring boot gradle plugin, we can omit versions in org.springframework.*
// dependencies. It will automatically choose the fitting ones.
implementation("edu.kit.datamanager:service-base:1.1.1")
implementation("edu.kit.datamanager:repo-core:1.1.2")
implementation("edu.kit.datamanager:service-base:1.2.0")
implementation("edu.kit.datamanager:repo-core:1.2.1")
// com.google.common, LoadingCache
implementation("com.google.guava:guava:32.1.2-jre")
implementation("com.google.guava:guava:32.1.3-jre")
// Required by Spring/Javers at runtime
implementation 'com.google.code.gson:gson:2.10.1'

Expand All @@ -79,9 +77,8 @@ dependencies {
// @EnableJPARepositories
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
// springdoc / openapi / swagger
implementation "org.springdoc:springdoc-openapi-ui:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-data-rest:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-webmvc-core:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-starter-webmvc-api:${springDocVersion}"
// spring + elasticsearch communication
implementation "org.springframework.data:spring-data-elasticsearch"

Expand All @@ -102,6 +99,8 @@ dependencies {
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")
testImplementation("org.springframework.security:spring-security-test")

testImplementation("com.jayway.jsonpath:json-path:2.8.0")
}

application {
Expand All @@ -121,12 +120,6 @@ bootJar {
attributes 'Main-Class': 'org.springframework.boot.loader.PropertiesLauncher'
}

// Include documentation to be available on runtime.
dependsOn asciidoctor
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}

// Make the Typed PID Maker executable without `java -jar`
// by adding a launch script into the jar file.
// Works only on unix platforms.
Expand Down Expand Up @@ -190,9 +183,12 @@ jacocoTestReport {
//exclude some classes/package from code coverage report
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [\
'edu/kit/datamanager/collection/configuration/**', \
'edu/kit/datamanager/collection/filters/**', \
'edu/kit/datamanager/collection/Application*'
'edu/kit/datamanager/pit/configuration/**', \
'edu/kit/datamanager/pit/web/converter/**', \
'edu/kit/datamanager/pit/web/ExtendedErrorAttributes**', \
'edu/kit/datamanager/pit/web/UncontrolledExceptionHandler**', \
'edu/kit/datamanager/pit/common/**', \
'edu/kit/datamanager/pit/Application*'
])
}))
}
Expand All @@ -209,3 +205,8 @@ release {
requireBranch.set("master")
}
}

tasks.withType(Jar).all { duplicatesStrategy(DuplicatesStrategy.EXCLUDE) }
tasks.withType(Tar).all { duplicatesStrategy(DuplicatesStrategy.EXCLUDE) }
tasks.withType(Copy).all { duplicatesStrategy(DuplicatesStrategy.EXCLUDE) }
tasks.withType(Zip).all { duplicatesStrategy(DuplicatesStrategy.EXCLUDE) }
21 changes: 14 additions & 7 deletions config/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
### General Spring Boot Settings (do not change!) ###
### General Spring Boot Settings ###
# When to include "message" attribute in HTTP responses on uncatched exceptions.
server.error.include-message: always
springdoc.show-actuator=true
# Do __not__ change these settings below:
spring.main.allow-bean-definition-overriding=true
spring.data.rest.detection-strategy:annotated
#####################################################
Expand Down Expand Up @@ -89,9 +93,16 @@ spring.autoconfigure.exclude=org.keycloak.adapters.springboot.KeycloakAutoConfig

# enables search endpoint at /api/v1/search
repo.search.enabled: false
repo.search.index: *
management.health.elasticsearch.enabled: false

# TO BE REMOVED!
repo.search.url: http://localhost:9200
repo.search.index: *
# Soon will be:
#spring.elasticsearch.uris=http://localhost:9200
#spring.elasticsearch.username=user
#spring.elasticsearch.password=secret
#spring.elasticsearch.socket-timeout=10s

#################
### Messaging ###
Expand Down Expand Up @@ -126,17 +137,13 @@ pit.pidsystem.handle.baseURI = http://hdl.handle.net/
# - IN_MEMORY (default, sandboxed, non-permanent PIDs, for short testing / demonstration only),
# - LOCAL (sandboxed, uses local database, no public PIDs!, for long term testing or special use-cases),
# - HANDLE_PROTOCOL (recommended, for real FAIR Digital Objects),
# - HANDLE_REST (deprecated, for legacy prefixes)
pit.pidsystem.implementation = LOCAL
# If you chose IN_MEMORY, no further configuration is required.
# If you chose LOCAL, no further configuration is required.
# If you chose HANDLE_PROTOCOL, you need to set up your prefix and its key/certificate:
#pit.pidsystem.handle-protocol.credentials.handleIdentifierPrefix = 21.T11981 # prefix string
#pit.pidsystem.handle-protocol.credentials.userHandle = 21.T11981/USER01 # user PID
#pit.pidsystem.handle-protocol.credentials.privateKeyPath = test_prefix_data/21.T11981_USER01_300_privkey.bin # private key/certificate file
# If you chose HANDLE_REST, you need to add credentials and the prefix:
#pit.pidsystem.handle.userName = 21.T11981/USER01
#pit.pidsystem.handle.userPassword = ...
#pit.pidsystem.handle.generatorPrefix = 21.T11981

### Base URL for the DTR used. ###
# Currently, we support the DTRs of GWDG/ePIC. Currently known instances:
Expand Down
22 changes: 0 additions & 22 deletions docker/tests/getting_profile_is_working.sh

This file was deleted.

Loading