Skip to content

Commit

Permalink
Merge remote-tracking branch 'kitodo/5.x' into 4.x-ocr-devel
Browse files Browse the repository at this point in the history
Signed-off-by: Christos Sidiropoulos <[email protected]>
  • Loading branch information
csidirop committed Aug 27, 2024
2 parents 78fa16c + cccf1bd commit 2d10f58
Show file tree
Hide file tree
Showing 94 changed files with 4,123 additions and 11,570 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/task-for-the-development-fund.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Task for the development fund
about: A working package which may be sponsored by the Kitodo e.V. development fund.
title: "[FUND] "
labels: ⭐ development fund 2024
labels: ⭐ development fund 2025
assignees: ''

---
Expand Down
26 changes: 13 additions & 13 deletions .github/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: "CodeQL Configuration"
name: CodeQL Configuration

queries:
- uses: security-and-quality
queries:
- uses: security-and-quality

query-filters:
- exclude:
problem.severity:
- note
query-filters:
- exclude:
problem.severity:
- note

paths-ignore:
- Resources/Public/JavaScript/jPlayer
- Resources/Public/JavaScript/jQuery
- Resources/Public/JavaScript/jQueryUI
- Resources/Public/JavaScript/OpenLayers
- Resources/Public/JavaScript/Toastify
paths-ignore:
- Resources/Public/JavaScript/jPlayer
- Resources/Public/JavaScript/jQuery
- Resources/Public/JavaScript/jQueryUI
- Resources/Public/JavaScript/OpenLayers
- Resources/Public/JavaScript/Toastify
61 changes: 30 additions & 31 deletions .github/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
parameters:
ignoreErrors:
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::countByPid\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findByIsListed\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findByIsSortable\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByFeUserId\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByIndexName\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByLocation\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByPid\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByRecordId\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByRoot\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneBySessionId\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByType\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByUid\(\)\.#'
- '#Call to an undefined method Psr\\Http\\Message\\RequestFactoryInterface::request\(\)\.#'
- '#Call to an undefined method Solarium\\Core\\Query\\DocumentInterface::setField\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\IiifResourceInterface::getHeight\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\IiifResourceInterface::getWidth\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\IiifResourceInterface::getPossibleTextAnnotationContainers\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\IiifResourceInterface::getTextAnnotations\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\ManifestInterface::getOriginalJsonArray\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\RangeInterface::getMemberRangesAndRanges\(\)\.#'
- '#Constant LOG_SEVERITY_ERROR not found\.#'
- '#Constant LOG_SEVERITY_NOTICE not found\.#'
- '#Constant LOG_SEVERITY_WARNING not found\.#'
- '#Constant TYPO3_MODE not found\.#'
level: 5
paths:
- ../Classes/
excludePaths:
- ../Classes/Controller/OaiPmhController.php
treatPhpDocTypesAsCertain: false
ignoreErrors:
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::countByPid\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findByIsListed\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findByIsSortable\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByFeUserId\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByIndexName\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByLocation\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByPid\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByRecordId\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneBySessionId\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByType\(\)\.#'
- '#Call to an undefined method Kitodo\\Dlf\\Domain\\Repository\\[a-zA-Z]+Repository::findOneByUid\(\)\.#'
- '#Call to an undefined method Psr\\Http\\Message\\RequestFactoryInterface::request\(\)\.#'
- '#Call to an undefined method Solarium\\Core\\Query\\DocumentInterface::setField\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\IiifResourceInterface::getHeight\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\IiifResourceInterface::getWidth\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\IiifResourceInterface::getPossibleTextAnnotationContainers\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\IiifResourceInterface::getTextAnnotations\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\ManifestInterface::getOriginalJsonArray\(\)\.#'
- '#Call to an undefined method Ubl\\Iiif\\Presentation\\Common\\Model\\Resources\\RangeInterface::getMemberRangesAndRanges\(\)\.#'
- '#Constant LOG_SEVERITY_ERROR not found\.#'
- '#Constant LOG_SEVERITY_NOTICE not found\.#'
- '#Constant LOG_SEVERITY_WARNING not found\.#'
- '#Constant TYPO3_MODE not found\.#'
level: 5
paths:
- ../Classes/
excludePaths:
- ../Classes/Controller/OaiPmhController.php
treatPhpDocTypesAsCertain: false
3 changes: 3 additions & 0 deletions .github/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ rules:
- base: 4.x
upstream: kitodo:4.x
mergeMethod: hardreset
- base: 5.x
upstream: kitodo:5.x
mergeMethod: hardreset
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: "CodeQL"
name: CodeQL

on:
push:
branches: [ "master", "1.x", "2.x", "3.2.x", "3.3.x", "4.x" ]
branches: [ "5.x" ]
pull_request:
branches: [ "master" ]
branches: [ "5.x" ]

jobs:
analyze:
name: Analyze
name: Static Code Analysis
runs-on: ubuntu-latest
permissions:
actions: read
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Documentation

on: [ push, pull_request ]

jobs:
tests:
name: Build Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Test if the documentation will render without warning
run: |
mkdir -p Documentation-GENERATED-temp \
&& docker run --rm --pull always -v $(pwd):/project \
ghcr.io/typo3-documentation/render-guides:latest --config=Documentation --no-progress --fail-on-log
5 changes: 3 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ name: PHPStan

on:
push:
branches: [ "master" ]
branches: [ "5.x" ]
pull_request:
branches: [ "master" ]
branches: [ "5.x" ]

jobs:
phpstan:
name: Static Code Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ name: Unit and Functional Testing

on:
push:
branches: [ "master", "4.x-ocr" ]
branches: [ "5.x-ocr" ]
pull_request:
branches: [ "master", "4.x-ocr" ]
branches: [ "5.x-ocr" ]

jobs:
test:
name: TYPO3
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
11 changes: 6 additions & 5 deletions Build/Test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ services:
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "8000:8000"
- "${SERVER_PORT}:${SERVER_PORT}"
# NOTE: For testing PageViewProxy, we need another web server web:8001 that
# can be requested from TYPO3 running on web:8000.
# can be requested from TYPO3 running on web:${SERVER_PORT}.
# Setting PHP_CLI_SERVER_WORKERS wouldn't seem to work consistently.
command: >
/bin/sh -c "
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
php -S web:8000 -t ${DLF_ROOT} ${DLF_ROOT}/Tests/routeFunctionalInstance.php &
php -S web:${SERVER_PORT} -t ${DLF_ROOT} ${DLF_ROOT}/Tests/routeFunctionalInstance.php &
php -S web:8001 -t ${DLF_ROOT}
else
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal\" \
php -S web:8000 -t ${DLF_ROOT} ${DLF_ROOT}/Tests/routeFunctionalInstance.php &
php -S web:${SERVER_PORT} -t ${DLF_ROOT} ${DLF_ROOT}/Tests/routeFunctionalInstance.php &
php -S web:8001 -t ${DLF_ROOT}
fi
"
Expand Down Expand Up @@ -85,7 +85,8 @@ services:
typo3DatabaseUsername: root
typo3DatabasePassword: funcp
typo3DatabaseHost: ${DBMS}
dlfTestingSolrHost: solr
env_file:
- ./test.env
working_dir: ${DLF_ROOT}
extra_hosts:
- "host.docker.internal:host-gateway"
Expand Down
34 changes: 15 additions & 19 deletions Build/Test/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
# Adopted/reduced from https:/TYPO3/typo3/blob/f6d73fea5a8f3a5cd8537e29308f18bec65a0c92/Build/Scripts/runTests.sh

# Function to write a .env file in Build/Test
# This is read by docker-compose and vars defined here are
# This is read by docker compose and vars defined here are
# used in Build/Test/docker-compose.yml
setUpDockerComposeDotEnv() {
# Delete possibly existing local .env file if exists
[ -e .env ] && rm .env
# Set up a new .env file for docker-compose
# Set up a new .env file for docker compose
{
echo "COMPOSE_PROJECT_NAME=dlf_testing"
# To prevent access rights of files created by the testing, the docker image later
# runs with the same user that is currently executing the script. docker-compose can't
# runs with the same user that is currently executing the script. docker compose can't
# use $UID directly itself since it is a shell variable and not an env variable, so
# we have to set it explicitly here.
echo "HOST_UID=$(id -u)"
Expand All @@ -24,6 +24,7 @@ setUpDockerComposeDotEnv() {
echo "TEST_FILE=${TEST_FILE}"
echo "PHP_XDEBUG_ON=${PHP_XDEBUG_ON}"
echo "PHP_XDEBUG_PORT=${PHP_XDEBUG_PORT}"
echo "SERVER_PORT=${SERVER_PORT}"
echo "DOCKER_PHP_IMAGE=${DOCKER_PHP_IMAGE}"
echo "EXTRA_TEST_OPTIONS=${EXTRA_TEST_OPTIONS}"
echo "SCRIPT_VERBOSE=${SCRIPT_VERBOSE}"
Expand Down Expand Up @@ -60,7 +61,7 @@ Execute unit, functional and other test suites in a docker based test environmen
execution of single test files, sending xdebug information to a local IDE and more.
Recommended docker version is >=20.10 for xdebug break pointing to work reliably, and
a recent docker-compose (tested >=1.21.2) is needed.
a recent docker compose (tested >=2.27.1) is needed.
Usage: $0 [options] [file]
Expand Down Expand Up @@ -159,12 +160,6 @@ Options:
Show this help.
EOF

# Test if docker-compose exists, else exit out with error
if ! type "docker-compose" > /dev/null; then
echo "This script relies on docker and docker-compose. Please install" >&2
exit 1
fi

# Go to the directory this script is located, so everything else is relative
# to this dir, no matter from where this script is called.
THIS_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
Expand All @@ -188,6 +183,7 @@ DBMS="mariadb"
PHP_VERSION="7.4"
PHP_XDEBUG_ON=0
PHP_XDEBUG_PORT=9003
SERVER_PORT=8000
EXTRA_TEST_OPTIONS=""
SCRIPT_VERBOSE=0
PHPUNIT_WATCH=0
Expand Down Expand Up @@ -217,19 +213,19 @@ while getopts ":a:s:t:d:i:j:p:e:xy:whuv" OPT; do
;;
i)
MARIADB_VERSION=${OPTARG}
if ! [[ ${MARIADB_VERSION} =~ ^(10.1|10.2|10.3|10.4|10.5)$ ]]; then
if ! [[ ${MARIADB_VERSION} =~ ^(10.2|10.3|10.4|10.5|10.6|10.11)$ ]]; then
INVALID_OPTIONS+=("${OPTARG}")
fi
;;
j)
MYSQL_VERSION=${OPTARG}
if ! [[ ${MYSQL_VERSION} =~ ^(5.5|5.6|5.7|8.0)$ ]]; then
if ! [[ ${MYSQL_VERSION} =~ ^(5.7|8.0)$ ]]; then
INVALID_OPTIONS+=("${OPTARG}")
fi
;;
p)
PHP_VERSION=${OPTARG}
if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1)$ ]]; then
if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1|8.2|8.3)$ ]]; then
INVALID_OPTIONS+=("${OPTARG}")
fi
;;
Expand Down Expand Up @@ -290,17 +286,17 @@ fi
case ${TEST_SUITE} in
composerInstall)
setUpDockerComposeDotEnv
docker-compose run composer_install
docker compose run composer_install
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
functional)
handleDbmsAndDriverOptions
setUpDockerComposeDotEnv
case ${DBMS} in
mariadb|mysql)
echo "Using driver: ${DATABASE_DRIVER}"
docker-compose run functional
docker compose run functional
SUITE_EXIT_CODE=$?
;;
*)
Expand All @@ -309,13 +305,13 @@ case ${TEST_SUITE} in
echo "call \".Build/Test/runTests.sh -h\" to display help and valid options" >&2
exit 1
esac
docker-compose down
docker compose down
;;
unit)
setUpDockerComposeDotEnv
docker-compose run unit
docker compose run unit
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
update)
# pull typo3/core-testing-*:latest versions of those ones that exist locally
Expand Down
1 change: 1 addition & 0 deletions Build/Test/test.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dlfTestingSolrHost=solr
Loading

0 comments on commit 2d10f58

Please sign in to comment.