From 9392c154187a4e7bff278c9a7b0262dd572d2335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Niedzielski?= Date: Tue, 3 Mar 2026 10:26:34 +0100 Subject: [PATCH 1/4] Added support for doctrine/persistence versions 2.x and 3.x --- .github/workflows/backend-ci.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index 129ae31..07f719a 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -45,6 +45,9 @@ jobs: - '7.4' - '8.3' - '8.4' + doctrine-persistence: + - 'doctrine/persistence:^2.0' + - 'doctrine/persistence:^3.0' steps: - uses: actions/checkout@v6 @@ -60,7 +63,7 @@ jobs: - uses: ramsey/composer-install@v3 with: dependency-versions: "highest" - composer-options: "${{ matrix.composer_options }}" + composer-options: "--with ${{ matrix.doctrine-persistence }}" - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" @@ -97,6 +100,9 @@ jobs: - '7.4' - '8.3' - '8.4' + doctrine-persistence: + - 'doctrine/persistence:^2.0' + - 'doctrine/persistence:^3.0' steps: - uses: actions/checkout@v6 @@ -112,6 +118,7 @@ jobs: - uses: ramsey/composer-install@v3 with: dependency-versions: "highest" + composer-options: "--with ${{ matrix.doctrine-persistence }}" - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" @@ -159,6 +166,9 @@ jobs: - '7.4' - '8.3' - '8.4' + doctrine-persistence: + - 'doctrine/persistence:^2.0' + - 'doctrine/persistence:^3.0' steps: - uses: actions/checkout@v6 @@ -174,6 +184,7 @@ jobs: - uses: ramsey/composer-install@v3 with: dependency-versions: "highest" + composer-options: "--with ${{ matrix.doctrine-persistence }}" - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" @@ -217,6 +228,9 @@ jobs: - '7.4' - '8.3' - '8.4' + doctrine-persistence: + - 'doctrine/persistence:^2.0' + - 'doctrine/persistence:^3.0' steps: - uses: actions/checkout@v6 @@ -232,6 +246,7 @@ jobs: - uses: ramsey/composer-install@v3 with: dependency-versions: "highest" + composer-options: "--with ${{ matrix.doctrine-persistence }}" - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" From 5527212ccd28c4270b5d9eaecc6035b37bacfed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Niedzielski?= Date: Tue, 3 Mar 2026 10:28:19 +0100 Subject: [PATCH 2/4] Added support for doctrine/persistence versions 2.x and 3.x --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b2a1999..eb4d7be 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "require": { "php": "^7.4 || ^8.0", - "doctrine/persistence": "^3", + "doctrine/persistence": "^2 || ^3", "ibexa/core": "~4.6.x-dev", "ibexa/core-persistence": "~4.6.x-dev", "ibexa/polyfill-php82": "^1.0", From 2a864cbe5b60e28130b68a5556c1f01bc52cdad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Niedzielski?= Date: Tue, 3 Mar 2026 10:40:06 +0100 Subject: [PATCH 3/4] Updated ConnectionRegistry to ensure compatibility with doctrine/persistence v2 --- src/bundle/Transport/ConnectionRegistry.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bundle/Transport/ConnectionRegistry.php b/src/bundle/Transport/ConnectionRegistry.php index d4982cb..f390a9d 100644 --- a/src/bundle/Transport/ConnectionRegistry.php +++ b/src/bundle/Transport/ConnectionRegistry.php @@ -32,7 +32,12 @@ public function getDefaultConnectionName(): string return $this->registry->getDefaultConnectionName(); } - public function getConnection(?string $name = null): object + /** + * Cannot declare types to maintain compatibility with doctrine/persistence v2. + * + * @param string|null $name + */ + public function getConnection($name = null): object { if ($name === self::DEFAULT_IBEXA_CONNECTION) { $name = $this->repositoryConfigurationProvider->getStorageConnectionName(); From 40dfc86d0ba30f7f07fbf8cba2c385f46a7840f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Niedzielski?= Date: Tue, 3 Mar 2026 11:01:11 +0100 Subject: [PATCH 4/4] Replaced custom PHP setup with ibexa/composer-install action in CI workflows --- .github/workflows/backend-ci.yaml | 104 ++++++++++++------------------ 1 file changed, 41 insertions(+), 63 deletions(-) diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index 07f719a..233731b 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -16,22 +16,17 @@ jobs: php: - '8.3' steps: - - uses: actions/checkout@v6 - - - name: Setup PHP Action - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none - extensions: 'pdo_sqlite, gd' - tools: cs2pr + - uses: actions/checkout@v6 - - uses: ramsey/composer-install@v3 - with: - dependency-versions: "highest" + - uses: ibexa/gh-workflows/actions/composer-install@main + with: + gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} + gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} + satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} + satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} - - name: Run code style check - run: composer run-script check-cs -- --format=checkstyle | cs2pr + - name: Run code style check + run: composer run-script check-cs -- --format=checkstyle | cs2pr tests: name: Tests @@ -50,29 +45,24 @@ jobs: - 'doctrine/persistence:^3.0' steps: - - uses: actions/checkout@v6 - - - name: Setup PHP Action - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none - extensions: pdo_sqlite, gd - tools: cs2pr + - uses: actions/checkout@v6 - - uses: ramsey/composer-install@v3 - with: - dependency-versions: "highest" - composer-options: "--with ${{ matrix.doctrine-persistence }}" + - uses: ibexa/gh-workflows/actions/composer-install@main + with: + gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} + gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} + satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} + satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} + composer-options: "--with ${{ matrix.doctrine-persistence }}" - - name: Setup problem matchers for PHPUnit - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Run PHPStan analysis - run: composer run-script phpstan + - name: Run PHPStan analysis + run: composer run-script phpstan - - name: Run test suite - run: composer run-script --timeout=600 test + - name: Run test suite + run: composer run-script --timeout=600 test integration-tests-postgres: name: PostgreSQL integration tests @@ -107,18 +97,14 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Setup PHP Action - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none - extensions: pdo_pgsql, gd - tools: cs2pr - - - uses: ramsey/composer-install@v3 + - uses: ibexa/gh-workflows/actions/composer-install@main with: - dependency-versions: "highest" + gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} + gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} + satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} + satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} composer-options: "--with ${{ matrix.doctrine-persistence }}" + php-extensions: 'pdo_pgsql, gd' - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" @@ -173,18 +159,14 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Setup PHP Action - uses: shivammathur/setup-php@v2 + - uses: ibexa/gh-workflows/actions/composer-install@main with: - php-version: ${{ matrix.php }} - coverage: none - extensions: pdo_pgsql, gd - tools: cs2pr - - - uses: ramsey/composer-install@v3 - with: - dependency-versions: "highest" + gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} + gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} + satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} + satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} composer-options: "--with ${{ matrix.doctrine-persistence }}" + php-extensions: 'pdo_mysql, gd' - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" @@ -235,18 +217,14 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Setup PHP Action - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none - extensions: pdo_mysql, gd - tools: cs2pr - - - uses: ramsey/composer-install@v3 + - uses: ibexa/gh-workflows/actions/composer-install@main with: - dependency-versions: "highest" + gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }} + gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }} + satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }} + satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }} composer-options: "--with ${{ matrix.doctrine-persistence }}" + php-extensions: 'pdo_mysql, gd' - name: Setup problem matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"