From 2bf0c83120dafcd621db8d220e4863a68049d29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Nowak?= Date: Mon, 10 Aug 2026 11:47:26 +0200 Subject: [PATCH 1/5] IBX-12229: Added unified deptrac layers configuration Co-Authored-By: Claude Fable 5 --- .github/workflows/backend-ci.yaml | 20 +++++++++ .gitignore | 1 + composer.json | 4 ++ deptrac.yaml | 46 +++++++++++++++++++++ src/internal-contracts/InternalContract.php | 14 +++++++ 5 files changed, 85 insertions(+) create mode 100644 deptrac.yaml create mode 100644 src/internal-contracts/InternalContract.php diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index 780c1ecb70..9bd8ec566e 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -27,6 +27,26 @@ jobs: - name: Run code style check run: composer run-script check-cs -- --format=checkstyle | cs2pr + deptrac: + name: Deptrac + runs-on: "ubuntu-26.04" + strategy: + fail-fast: false + matrix: + php: + - '8.3' + steps: + - uses: actions/checkout@v7 + - name: Install Composer dependencies + 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 deptrac + run: composer run-script deptrac + tests: name: Unit tests & SQLite integration tests runs-on: "ubuntu-26.04" diff --git a/.gitignore b/.gitignore index 0e0fe9fb47..d066dbaba1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,6 @@ var/ composer.lock .php-cs-fixer.cache .phpunit.result.cache +/.deptrac.cache phpstan.neon .rules/ diff --git a/composer.json b/composer.json index 8ab252a362..2cab86426e 100644 --- a/composer.json +++ b/composer.json @@ -64,6 +64,7 @@ }, "require-dev": { "behat/behat": "^3.6.1", + "deptrac/deptrac": "^4.7", "friends-of-behat/mink-extension": "^2.4", "ibexa/code-style": "~2.1.0", "ibexa/rector": "~6.0.x-dev", @@ -94,6 +95,7 @@ "Ibexa\\Bundle\\LegacySearchEngine\\": "src/bundle/LegacySearchEngine", "Ibexa\\Contracts\\Core\\": "src/contracts", "Ibexa\\Core\\": "src/lib", + "Ibexa\\InternalContracts\\Core\\": "src/internal-contracts/", "Ibexa\\Tests\\Core\\": "tests/lib", "Ibexa\\Tests\\Integration\\Core\\": "tests/integration/Core", "Ibexa\\Tests\\Bundle\\Core\\": "tests/bundle/Core", @@ -128,6 +130,7 @@ "fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots", "unit": "phpunit -c phpunit.xml", "phpstan": "phpstan analyse", + "deptrac": "php vendor/bin/deptrac analyse", "integration": [ "Composer\\Config::disableProcessTimeout", "phpunit -c phpunit-integration-legacy.xml" @@ -140,6 +143,7 @@ }, "scripts-descriptions": { "check-cs": "Run code style checker for all files", + "deptrac": "Run Deptrac architecture testing", "fix-cs": "Fix Coding standard issues in current checkout.", "test": "Run all tests (unit & integration, not functional), might not work on Windows." }, diff --git a/deptrac.yaml b/deptrac.yaml new file mode 100644 index 0000000000..581cb23bff --- /dev/null +++ b/deptrac.yaml @@ -0,0 +1,46 @@ +deptrac: + paths: + - ./src + - ./tests + layers: + - name: Bundle + collectors: + - type: bool + must: + - type: directory + value: src/bundle/.* + must_not: + - type: layer + value: InternalContracts + - type: bool + must: + - type: directory + value: src/lib/.* + must_not: + - type: layer + value: InternalContracts + - name: Contracts + collectors: + - type: directory + value: src/contracts/.* + - name: InternalContracts + collectors: + - type: directory + value: src/internal-contracts/.* + - type: attribute + value: InternalContract + - name: Test + collectors: + - type: directory + value: tests/.* + ruleset: + Bundle: + - Contracts + - InternalContracts + Contracts: ~ + InternalContracts: + - Contracts + Test: + - Bundle + - Contracts + - InternalContracts diff --git a/src/internal-contracts/InternalContract.php b/src/internal-contracts/InternalContract.php new file mode 100644 index 0000000000..1259237abf --- /dev/null +++ b/src/internal-contracts/InternalContract.php @@ -0,0 +1,14 @@ + Date: Tue, 11 Aug 2026 08:36:47 +0200 Subject: [PATCH 2/5] IBX-12229: Aligned CI jobs to ubuntu-26.04, PHP 8.4 and actions/checkout v7 Co-Authored-By: Claude Fable 5 --- .github/workflows/backend-ci.yaml | 8 ++------ .github/workflows/gha-docker-solr.yaml | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index 9bd8ec566e..f221c58d7a 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: php: - - '8.3' + - '8.4' steps: - uses: actions/checkout@v7 @@ -34,7 +34,7 @@ jobs: fail-fast: false matrix: php: - - '8.3' + - '8.4' steps: - uses: actions/checkout@v7 - name: Install Composer dependencies @@ -56,7 +56,6 @@ jobs: fail-fast: false matrix: php: - - '8.3' - '8.4' steps: @@ -105,7 +104,6 @@ jobs: fail-fast: false matrix: php: - - '8.3' - '8.4' image: - 'postgres:14' @@ -157,7 +155,6 @@ jobs: fail-fast: false matrix: php: - - '8.3' - '8.4' image: - 'mysql:8.0' @@ -209,7 +206,6 @@ jobs: fail-fast: false matrix: php: - - '8.3' - '8.4' steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/gha-docker-solr.yaml b/.github/workflows/gha-docker-solr.yaml index f045fdf60f..dd148cc8d6 100644 --- a/.github/workflows/gha-docker-solr.yaml +++ b/.github/workflows/gha-docker-solr.yaml @@ -18,7 +18,7 @@ jobs: runs-on: "ubuntu-26.04" strategy: matrix: - php-version: [8.3, 8.4] + php-version: [8.4] permissions: packages: write services: From b345d551fee6b0cb79ae16d9d155582228eaf10b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Nowak?= Date: Tue, 11 Aug 2026 08:48:50 +0200 Subject: [PATCH 3/5] IBX-12229: Allowed php-cs-fixer to run on PHP 8.4 php-cs-fixer 3.75 declares PHP 8.3.* as its maximum supported version and refuses to run on PHP 8.4 without PHP_CS_FIXER_IGNORE_ENV being set. Co-Authored-By: Claude Fable 5 --- .github/workflows/backend-ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index f221c58d7a..dec1940277 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -26,6 +26,8 @@ jobs: - name: Run code style check run: composer run-script check-cs -- --format=checkstyle | cs2pr + env: + PHP_CS_FIXER_IGNORE_ENV: 1 deptrac: name: Deptrac From 7b744ab1f9b12701d519b1833bf189ecc342beca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Nowak?= Date: Tue, 11 Aug 2026 11:19:25 +0200 Subject: [PATCH 4/5] IBX-12229: Removed InternalContract attribute Team decision: the attribute-based collection mechanism will not be used. The InternalContracts layer remains, collected from the dedicated src/internal-contracts/ directory (kept via .gitkeep); Bundle collectors simplified back to plain directory collectors. Co-Authored-By: Claude Fable 5 --- deptrac.yaml | 20 ++++---------------- src/internal-contracts/.gitkeep | 0 src/internal-contracts/InternalContract.php | 14 -------------- 3 files changed, 4 insertions(+), 30 deletions(-) create mode 100644 src/internal-contracts/.gitkeep delete mode 100644 src/internal-contracts/InternalContract.php diff --git a/deptrac.yaml b/deptrac.yaml index 581cb23bff..35a4bc3a31 100644 --- a/deptrac.yaml +++ b/deptrac.yaml @@ -5,20 +5,10 @@ deptrac: layers: - name: Bundle collectors: - - type: bool - must: - - type: directory - value: src/bundle/.* - must_not: - - type: layer - value: InternalContracts - - type: bool - must: - - type: directory - value: src/lib/.* - must_not: - - type: layer - value: InternalContracts + - type: directory + value: src/bundle/.* + - type: directory + value: src/lib/.* - name: Contracts collectors: - type: directory @@ -27,8 +17,6 @@ deptrac: collectors: - type: directory value: src/internal-contracts/.* - - type: attribute - value: InternalContract - name: Test collectors: - type: directory diff --git a/src/internal-contracts/.gitkeep b/src/internal-contracts/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/internal-contracts/InternalContract.php b/src/internal-contracts/InternalContract.php deleted file mode 100644 index 1259237abf..0000000000 --- a/src/internal-contracts/InternalContract.php +++ /dev/null @@ -1,14 +0,0 @@ - Date: Thu, 13 Aug 2026 11:49:51 +0200 Subject: [PATCH 5/5] IBX-12229: Added deptrac baseline suppressing current violations --- deptrac.baseline.yaml | 91 +++++++++++++++++++++++++++++++++++++++++++ deptrac.yaml | 3 ++ 2 files changed, 94 insertions(+) create mode 100644 deptrac.baseline.yaml diff --git a/deptrac.baseline.yaml b/deptrac.baseline.yaml new file mode 100644 index 0000000000..9f2b7999e2 --- /dev/null +++ b/deptrac.baseline.yaml @@ -0,0 +1,91 @@ +deptrac: + skip_violations: + Ibexa\Contracts\Core\Event\View\PostBuildViewEvent: + - Ibexa\Core\MVC\Symfony\View\View + Ibexa\Contracts\Core\Limitation\Target\Builder\VersionBuilder: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\MVC\EventSubscriber\ConfigScopeChangeSubscriber: + - Ibexa\Core\MVC\Symfony\Event\ScopeChangeEvent + Ibexa\Contracts\Core\MVC\Templating\BaseRenderStrategy: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + - Ibexa\Core\MVC\Symfony\SiteAccess + - Ibexa\Core\MVC\Symfony\Templating\RenderOptions + Ibexa\Contracts\Core\MVC\Templating\RenderStrategy: + - Ibexa\Core\MVC\Symfony\Templating\RenderOptions + Ibexa\Contracts\Core\MVC\View\VariableProvider: + - Ibexa\Core\MVC\Symfony\View\View + Ibexa\Contracts\Core\MVC\View\ViewMatcherRegistryInterface: + - Ibexa\Core\MVC\Symfony\Matcher\ViewMatcherInterface + Ibexa\Contracts\Core\Persistence\Content\Type\CriterionHandlerInterface: + - Ibexa\Core\Persistence\Legacy\Content\Type\Gateway\CriterionVisitor\CriterionVisitor + Ibexa\Contracts\Core\Persistence\Filter\Doctrine\FilteringQueryBuilder: + - Ibexa\Core\Base\Exceptions\DatabaseException + - Ibexa\Core\Persistence\Legacy\Content\Gateway + - Ibexa\Core\Persistence\Legacy\Content\Location\Gateway + - Ibexa\Core\Repository\Values\Content\VersionInfo + Ibexa\Contracts\Core\Persistence\Handler: + - Ibexa\Core\Persistence\Legacy\URL\Handler + Ibexa\Contracts\Core\Pool\Pool: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\Content: + - Ibexa\Core\FieldType\Value + Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Location\SubtreeTermAggregation: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image\AbstractImageCompositeCriterion: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image\AbstractImageRangeCriterion: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image\Dimensions: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image\FileSize: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image\Height: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image\Orientation: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + - Ibexa\Core\FieldType\Image\Orientation + Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Image\Width: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard\Query\Criterion\SourceUrl: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard\Query\SortClause: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard\Query\SortClause\DestinationUrl: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard\Query\SortClause\Id: + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\Filter\Filter: + - Ibexa\Core\Base\Exceptions\BadStateException + - Ibexa\Core\Base\Exceptions\InvalidArgumentException + Ibexa\Contracts\Core\Repository\Values\User\User: + - Ibexa\Core\FieldType\Value + Ibexa\Contracts\Core\Repository\Values\User\UserGroup: + - Ibexa\Core\FieldType\Value + Ibexa\Contracts\Core\Test\IbexaKernelTestCase: + - Ibexa\Core\Repository\Values\User\UserReference + - Ibexa\Tests\Core\Repository\LegacySchemaImporter + Ibexa\Contracts\Core\Test\IbexaKernelTestTrait: + - Ibexa\Core\Repository\Values\User\UserReference + - Ibexa\Tests\Core\Repository\LegacySchemaImporter + Ibexa\Contracts\Core\Test\IbexaTestKernel: + - Ibexa\Bundle\Core\IbexaCoreBundle + - Ibexa\Bundle\LegacySearchEngine\IbexaLegacySearchEngineBundle + - Ibexa\Tests\Integration\Core\IO\FlysystemTestAdapter + - Ibexa\Tests\Integration\Core\IO\FlysystemTestAdapterInterface + Ibexa\Contracts\Core\Test\Repository\SetupFactory: + - Ibexa\Core\Base\ServiceContainer + - Ibexa\Tests\Integration\Core\Repository\IdManager + Ibexa\Contracts\Core\Test\Repository\SetupFactory\Legacy: + - Ibexa\Bundle\Core\DependencyInjection\ServiceTags + - Ibexa\Core\Base\Container\Compiler\Search\FieldRegistryPass + - Ibexa\Core\Base\ServiceContainer + - Ibexa\Core\Persistence\Legacy\Content\Language\CachingHandler + - Ibexa\Core\Persistence\Legacy\Content\Type\MemoryCachingHandler + - Ibexa\Core\Persistence\Legacy\Handler + - Ibexa\Core\Repository\Values\User\UserReference + - Ibexa\Tests\Core\Repository\IdManager\Php + - Ibexa\Tests\Core\Repository\LegacySchemaImporter + - Ibexa\Tests\Integration\Core\LegacyTestContainerBuilder + - Ibexa\Tests\Integration\Core\Repository\IdManager diff --git a/deptrac.yaml b/deptrac.yaml index 35a4bc3a31..75bc12dc23 100644 --- a/deptrac.yaml +++ b/deptrac.yaml @@ -1,3 +1,6 @@ +imports: + - deptrac.baseline.yaml + deptrac: paths: - ./src