From 0031029f6440072f5f1d64fd4d1986f50ac064a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Nowak?= Date: Mon, 10 Aug 2026 11:48:48 +0200 Subject: [PATCH 1/5] IBX-12229: Added unified deptrac layers configuration Co-Authored-By: Claude Fable 5 --- .github/workflows/backend-ci.yaml | 22 ++++++++++++ .gitignore | 1 + composer.json | 10 ++++-- deptrac.yaml | 40 +++++++++++++++------ src/internal-contracts/InternalContract.php | 14 ++++++++ 5 files changed, 74 insertions(+), 13 deletions(-) create mode 100644 src/internal-contracts/InternalContract.php diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index f7bc485..f3a9573 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -28,6 +28,28 @@ jobs: - name: Run code style check run: composer run-script check-cs -- --format=checkstyle | cs2pr + deptrac: + name: Deptrac + runs-on: "ubuntu-22.04" + strategy: + fail-fast: false + matrix: + php: + - '8.3' + steps: + - uses: actions/checkout@v5 + + - 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: Tests runs-on: "ubuntu-22.04" diff --git a/.gitignore b/.gitignore index 4d90817..0faeeee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.deptrac.cache /.php-cs-fixer.cache /.phpunit.result.cache /composer.lock diff --git a/composer.json b/composer.json index 20bce1a..d95c1bb 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ }, "require-dev": { "dama/doctrine-test-bundle": "^8.2", + "deptrac/deptrac": "^4.7", "ibexa/code-style": "~2.0.0", "ibexa/rector": "~6.0.x-dev", "ibexa/test-core": "~6.0.x-dev", @@ -30,7 +31,8 @@ "psr-4": { "Ibexa\\Bundle\\CorePersistence\\": "src/bundle/", "Ibexa\\Contracts\\CorePersistence\\": "src/contracts/", - "Ibexa\\CorePersistence\\": "src/lib/" + "Ibexa\\CorePersistence\\": "src/lib/", + "Ibexa\\InternalContracts\\CorePersistence\\": "src/internal-contracts/" } }, "autoload-dev": { @@ -45,13 +47,15 @@ "check-cs": "@fix-cs --dry-run", "test": "phpunit -c phpunit.xml.dist", "test-integration": "phpunit -c phpunit.integration.xml", - "phpstan": "phpstan analyse -c phpstan.neon" + "phpstan": "phpstan analyse -c phpstan.neon", + "deptrac": "php vendor/bin/deptrac analyse" }, "scripts-descriptions": { "fix-cs": "Automatically fixes code style in all files", "check-cs": "Run code style checker for all files", "test": "Run automatic tests", - "phpstan": "Run static code analysis" + "phpstan": "Run static code analysis", + "deptrac": "Run Deptrac architecture testing" }, "extra": { "branch-alias": { diff --git a/deptrac.yaml b/deptrac.yaml index 174c771..581cb23 100644 --- a/deptrac.yaml +++ b/deptrac.yaml @@ -1,26 +1,46 @@ deptrac: paths: - ./src + - ./tests layers: - name: Bundle collectors: - - type: directory - value: bundle/.* + - 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: contracts/.* - - name: Library + value: src/contracts/.* + - name: InternalContracts + collectors: + - type: directory + value: src/internal-contracts/.* + - type: attribute + value: InternalContract + - name: Test collectors: - type: directory - value: lib/.* + value: tests/.* ruleset: Bundle: - - Bundle - Contracts - - Library - Contracts: + - InternalContracts + Contracts: ~ + InternalContracts: - Contracts - Library: + Test: + - Bundle - Contracts - - Library + - InternalContracts diff --git a/src/internal-contracts/InternalContract.php b/src/internal-contracts/InternalContract.php new file mode 100644 index 0000000..d4d2119 --- /dev/null +++ b/src/internal-contracts/InternalContract.php @@ -0,0 +1,14 @@ + Date: Tue, 11 Aug 2026 08:37:45 +0200 Subject: [PATCH 2/5] IBX-12229: Aligned CI jobs to ubuntu-26.04, PHP 8.4 and actions/checkout v7 --- .github/workflows/backend-ci.yaml | 27 ++++++++++++--------------- .github/workflows/frontend-ci.yaml | 4 ++-- .github/workflows/rector.yaml | 6 +++--- .github/workflows/release.yaml | 2 +- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index f3a9573..b4774b1 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -10,13 +10,13 @@ on: jobs: cs-fix: name: Run code style check - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-26.04" strategy: matrix: php: - - '8.3' + - '8.4' steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - uses: ibexa/gh-workflows/actions/composer-install@main with: @@ -30,14 +30,14 @@ jobs: deptrac: name: Deptrac - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-26.04" strategy: fail-fast: false matrix: php: - - '8.3' + - '8.4' steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Install Composer dependencies uses: ibexa/gh-workflows/actions/composer-install@main @@ -52,18 +52,17 @@ jobs: tests: name: Tests - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-26.04" timeout-minutes: 10 strategy: fail-fast: false matrix: php: - - '8.3' - '8.4' steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Setup PHP Action uses: shivammathur/setup-php@v2 @@ -102,17 +101,16 @@ jobs: --health-timeout 5s --health-retries 5 --tmpfs /var/lib/postgresql/data - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-26.04" timeout-minutes: 20 strategy: matrix: php: - - '8.3' - '8.4' steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Setup PHP Action uses: shivammathur/setup-php@v2 @@ -154,17 +152,16 @@ jobs: --health-timeout=5s --health-retries=5 --tmpfs=/var/lib/mysql - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-26.04" timeout-minutes: 20 strategy: matrix: php: - - '8.3' - '8.4' steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Setup PHP Action uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/frontend-ci.yaml b/.github/workflows/frontend-ci.yaml index cdfc5c9..9dc0a94 100644 --- a/.github/workflows/frontend-ci.yaml +++ b/.github/workflows/frontend-ci.yaml @@ -14,11 +14,11 @@ on: jobs: frontend-test: name: Frontend build test - runs-on: "ubuntu-24.04" + runs-on: "ubuntu-26.04" timeout-minutes: 5 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - uses: actions/setup-node@v4 with: node-version: '18' diff --git a/.github/workflows/rector.yaml b/.github/workflows/rector.yaml index dd5ea18..98a3230 100644 --- a/.github/workflows/rector.yaml +++ b/.github/workflows/rector.yaml @@ -10,13 +10,13 @@ on: jobs: rector: name: Run rector - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-26.04" strategy: matrix: php: - - '8.3' + - '8.4' steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - uses: ibexa/gh-workflows/actions/composer-install@main with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1503cbe..dc27adb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,7 +8,7 @@ on: jobs: release: - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - uses: actions/checkout@master From 387ac711e48c278c8b1dc85441bedeb9fac8ec6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Nowak?= Date: Tue, 11 Aug 2026 08:42:20 +0200 Subject: [PATCH 3/5] IBX-12229: Allowed php-cs-fixer to run on PHP 8.4 --- .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 b4774b1..eed78e6 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -27,6 +27,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 315a1b1b9d44f643b7b4691a5763fe2b72308d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Nowak?= Date: Tue, 11 Aug 2026 11:19:45 +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 581cb23..35a4bc3 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 0000000..e69de29 diff --git a/src/internal-contracts/InternalContract.php b/src/internal-contracts/InternalContract.php deleted file mode 100644 index d4d2119..0000000 --- a/src/internal-contracts/InternalContract.php +++ /dev/null @@ -1,14 +0,0 @@ - Date: Wed, 12 Aug 2026 14:16:07 +0200 Subject: [PATCH 5/5] IBX-12229: Added deptrac baseline suppressing current violations Co-Authored-By: Claude Fable 5 --- deptrac.baseline.yaml | 8 ++++++++ deptrac.yaml | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 deptrac.baseline.yaml diff --git a/deptrac.baseline.yaml b/deptrac.baseline.yaml new file mode 100644 index 0000000..6d183c5 --- /dev/null +++ b/deptrac.baseline.yaml @@ -0,0 +1,8 @@ +deptrac: + skip_violations: + Ibexa\Contracts\CorePersistence\Gateway\AbstractDoctrineDatabase: + - Ibexa\CorePersistence\Gateway\ExpressionVisitor + - Ibexa\CorePersistence\Gateway\RelationshipTypeStrategyRegistry + Ibexa\Contracts\CorePersistence\Gateway\AbstractTranslationGateway: + - Ibexa\CorePersistence\Gateway\ExpressionVisitor + - Ibexa\CorePersistence\Gateway\RelationshipTypeStrategyRegistry diff --git a/deptrac.yaml b/deptrac.yaml index 35a4bc3..75bc12d 100644 --- a/deptrac.yaml +++ b/deptrac.yaml @@ -1,3 +1,6 @@ +imports: + - deptrac.baseline.yaml + deptrac: paths: - ./src