Skip to content

Commit 86c2ff2

Browse files
authored
Merge pull request #39 from dlubitz/task/upmerge-ci-config
Upmerge 5.0 and adapt CI configuration
2 parents 3a8a00f + 2fca1ac commit 86c2ff2

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

.github/workflows/tests.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,40 @@ on:
44
push:
55
branches: [ main ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ main, '[0-9]+.[0-9]' ]
88

99
jobs:
1010
build:
1111
env:
12-
FLOW_TARGET_VERSION: "7.0"
12+
FLOW_TARGET_VERSION: "9.0"
1313
FLOW_CONTEXT: Testing
1414
FLOW_FOLDER: ../flow-base-distribution
15+
PACKAGE_FOLDER: redirecthandler-databasestorage
16+
17+
strategy:
18+
matrix:
19+
php-versions: ['8.2', '8.3']
1520

1621
runs-on: ubuntu-latest
1722

1823
steps:
1924
- uses: actions/checkout@v4
2025

26+
- name: Set package branch name
27+
run: echo "PACKAGE_TARGET_VERSION=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
28+
working-directory: .
29+
30+
- name: Set alias branch name
31+
run: if [ "${PACKAGE_TARGET_VERSION}" == "main" ]; then echo "PACKAGE_BRANCH_ALIAS=dev-main"; else echo "PACKAGE_BRANCH_ALIAS=${PACKAGE_TARGET_VERSION}.x-dev"; fi >> $GITHUB_ENV
32+
33+
- name: Setup PHP
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: ${{ matrix.php-versions }}
37+
extensions: mbstring, xml, json, zlib, iconv, intl, pdo_sqlite, mysql
38+
coverage: xdebug #optional
39+
ini-values: opcache.fast_shutdown=0
40+
2141
- name: Update Composer
2242
run: |
2343
sudo composer self-update
@@ -39,14 +59,15 @@ jobs:
3959
run: |
4060
git clone https://github.com/neos/flow-base-distribution.git -b "${FLOW_TARGET_VERSION}" "${FLOW_FOLDER}"
4161
cd ${FLOW_FOLDER}
42-
composer require --no-update --no-interaction neos/redirecthandler-databasestorage:dev-main
62+
63+
git -C ../${{ env.PACKAGE_FOLDER }} checkout -b build
64+
composer config repositories.package '{ "type": "path", "url": "../${{ env.PACKAGE_FOLDER }}", "options": { "symlink": false } }'
65+
composer require --no-update --no-interaction neos/redirecthandler-databasestorage:"dev-build as ${PACKAGE_BRANCH_ALIAS}"
4366
4467
- name: Install distribution
4568
run: |
46-
cd ${FLOW_FOLDER}
69+
cd ${FLOW_FOLDER}
4770
composer install --no-interaction --no-progress
48-
rm -rf Packages/Application/Neos.RedirectHandler.DatabaseStorage
49-
cp -r ../redirecthandler-databasestorage Packages/Application/Neos.RedirectHandler.DatabaseStorage
5071
5172
- name: Run Unit tests
5273
run: |

Classes/Domain/Repository/RedirectRepository.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
use Doctrine\ORM\Internal\Hydration\IterableResult;
1818
use Doctrine\ORM\Query;
1919
use Doctrine\ORM\QueryBuilder;
20-
use Neos\RedirectHandler\DatabaseStorage\Domain\Model\Redirect;
21-
use Neos\RedirectHandler\RedirectInterface;
22-
use Neos\RedirectHandler\Redirect as RedirectDto;
20+
use InvalidArgumentException;
2321
use Neos\Flow\Annotations as Flow;
2422
use Neos\Flow\Persistence\QueryInterface;
2523
use Neos\Flow\Persistence\Repository;
24+
use Neos\RedirectHandler\DatabaseStorage\Domain\Model\Redirect;
25+
use Neos\RedirectHandler\Redirect as RedirectDto;
26+
use Neos\RedirectHandler\RedirectInterface;
2627

2728
/**
2829
* Repository for redirect instances.
@@ -280,7 +281,11 @@ public function persistEntities(): void
280281
foreach ($this->entityManager->getUnitOfWork()->getIdentityMap() as $className => $entities) {
281282
if ($className === $this->entityClassName) {
282283
foreach ($entities as $entityToPersist) {
283-
$this->entityManager->flush($entityToPersist);
284+
try {
285+
$this->entityManager->flush($entityToPersist);
286+
} catch (InvalidArgumentException $e) {
287+
// Do nothing here, as we assume just changes to the state of the entities in the identity map
288+
}
284289
}
285290
$this->emitRepositoryObjectsPersisted();
286291
break;

0 commit comments

Comments
 (0)