From e8b08da28bb48f0b192b98c339cff27ed87fc0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 16 Feb 2026 10:19:25 +0100 Subject: [PATCH 01/11] ci: use GitHub workflows --- .github/workflows/lint-and-codestyle.yml | 264 +++++++++++++++++++++++ 1 file changed, 264 insertions(+) create mode 100644 .github/workflows/lint-and-codestyle.yml diff --git a/.github/workflows/lint-and-codestyle.yml b/.github/workflows/lint-and-codestyle.yml new file mode 100644 index 000000000000..d5a61df21a26 --- /dev/null +++ b/.github/workflows/lint-and-codestyle.yml @@ -0,0 +1,264 @@ +name: Lint and Code Style + +on: + push: + branches: + - master + pull_request: + types: + - opened + - synchronize + - reopened + +concurrency: + group: lint-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint-php-codestyle: + name: PHP Code Style + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-version: ["7.4"] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check if changes affect PHP + id: changes + uses: dorny/paths-filter@v2 + with: + filters: | + php: + - '**/*.php' + - '!tests/acceptance/**' + - '!build/**' + + - name: Setup PHP + if: steps.changes.outputs.php == 'true' + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: curl, gd, json, xml, zip + ini-values: "memory_limit=1024M" + tools: phpstan, codesniffer + + - name: Cache Composer dependencies + if: steps.changes.outputs.php == 'true' + uses: actions/cache@v3 + with: + path: vendor/ + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install Composer dependencies + if: steps.changes.outputs.php == 'true' + run: | + composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader + + - name: Install vendor-bin dependencies + if: steps.changes.outputs.php == 'true' + run: | + composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/owncloud-codestyle + composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phpstan + composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phan + + - name: Run PHP Code Sniffer + if: steps.changes.outputs.php == 'true' + run: make test-php-style + continue-on-error: true + + phpstan-analysis: + name: PHPStan Static Analysis + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-version: ["7.4"] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check if changes affect PHP + id: changes + uses: dorny/paths-filter@v2 + with: + filters: | + php: + - '**/*.php' + - '!tests/acceptance/**' + - '!build/**' + + - name: Setup PHP + if: steps.changes.outputs.php == 'true' + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: curl, gd, json, xml, zip + ini-values: "memory_limit=1024M" + + - name: Cache Composer dependencies + if: steps.changes.outputs.php == 'true' + uses: actions/cache@v3 + with: + path: vendor/ + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install Composer dependencies + if: steps.changes.outputs.php == 'true' + run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader + + - name: Install vendor-bin dependencies + if: steps.changes.outputs.php == 'true' + run: composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phpstan + + - name: Install server dependencies + if: steps.changes.outputs.php == 'true' + run: make install-server + + - name: Run PHPStan + if: steps.changes.outputs.php == 'true' + run: make test-php-phpstan + continue-on-error: true + + phan-analysis: + name: Phan Static Analysis + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-version: ["7.4"] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check if changes affect PHP + id: changes + uses: dorny/paths-filter@v2 + with: + filters: | + php: + - '**/*.php' + - '!tests/acceptance/**' + - '!build/**' + + - name: Setup PHP + if: steps.changes.outputs.php == 'true' + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: curl, gd, json, xml, zip + ini-values: "memory_limit=1024M" + + - name: Cache Composer dependencies + if: steps.changes.outputs.php == 'true' + uses: actions/cache@v3 + with: + path: vendor/ + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install Composer dependencies + if: steps.changes.outputs.php == 'true' + run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader + + - name: Install vendor-bin dependencies + if: steps.changes.outputs.php == 'true' + run: composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phan + + - name: Install server dependencies + if: steps.changes.outputs.php == 'true' + run: make install-server + + - name: Run Phan + if: steps.changes.outputs.php == 'true' + run: make test-php-phan + continue-on-error: true + + javascript-lint: + name: JavaScript Linting + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check if changes affect JavaScript + id: changes + uses: dorny/paths-filter@v2 + with: + filters: | + javascript: + - '**/*.js' + - 'package.json' + - 'package-lock.json' + + - name: Setup Node.js + if: steps.changes.outputs.javascript == 'true' + uses: actions/setup-node@v3 + with: + node-version: "14" + cache: npm + + - name: Install Node dependencies + if: steps.changes.outputs.javascript == 'true' + run: npm ci + + - name: Run JavaScript linting + if: steps.changes.outputs.javascript == 'true' + run: npm run lint + continue-on-error: true + + git-commit-messages: + name: Git Commit Messages + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Validate commit messages + run: | + # Get all commits in the PR + git log --format=%B origin/master..${{ github.head_ref }} | while read line; do + # Check for common issues + if [[ $line =~ ^Merge\ branch ]]; then + echo "⚠️ Merge commits detected" + fi + done + continue-on-error: true + + changelog-check: + name: Changelog Check + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check for changelog entry + run: | + if [ -d "changelog/unreleased" ]; then + if [ "$(ls -A changelog/unreleased)" ]; then + echo "✓ Changelog entry found" + else + echo "⚠️ No changelog entry in changelog/unreleased" + fi + fi + continue-on-error: true From 0ac92e8d85682fdd83a70eba8a816a3f64c82e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 16 Feb 2026 11:24:27 +0100 Subject: [PATCH 02/11] fix: Commitsar step --- .github/workflows/lint-and-codestyle.yml | 29 +----------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/.github/workflows/lint-and-codestyle.yml b/.github/workflows/lint-and-codestyle.yml index d5a61df21a26..2e8ac1167ca9 100644 --- a/.github/workflows/lint-and-codestyle.yml +++ b/.github/workflows/lint-and-codestyle.yml @@ -233,32 +233,5 @@ jobs: fetch-depth: 0 - name: Validate commit messages - run: | - # Get all commits in the PR - git log --format=%B origin/master..${{ github.head_ref }} | while read line; do - # Check for common issues - if [[ $line =~ ^Merge\ branch ]]; then - echo "⚠️ Merge commits detected" - fi - done - continue-on-error: true + uses: aevea/commitsar@v1.0.2 - changelog-check: - name: Changelog Check - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Check for changelog entry - run: | - if [ -d "changelog/unreleased" ]; then - if [ "$(ls -A changelog/unreleased)" ]; then - echo "✓ Changelog entry found" - else - echo "⚠️ No changelog entry in changelog/unreleased" - fi - fi - continue-on-error: true From 7ca51afc89904846d33e2c7137a5e35cae98f982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 16 Feb 2026 11:30:44 +0100 Subject: [PATCH 03/11] fix: always run all jobs --- .github/workflows/lint-and-codestyle.yml | 69 ++---------------------- 1 file changed, 4 insertions(+), 65 deletions(-) diff --git a/.github/workflows/lint-and-codestyle.yml b/.github/workflows/lint-and-codestyle.yml index 2e8ac1167ca9..f2681d3e5605 100644 --- a/.github/workflows/lint-and-codestyle.yml +++ b/.github/workflows/lint-and-codestyle.yml @@ -10,6 +10,9 @@ on: - synchronize - reopened +permissions: + contents: read + concurrency: group: lint-${{ github.ref }} cancel-in-progress: true @@ -28,18 +31,7 @@ jobs: with: fetch-depth: 0 - - name: Check if changes affect PHP - id: changes - uses: dorny/paths-filter@v2 - with: - filters: | - php: - - '**/*.php' - - '!tests/acceptance/**' - - '!build/**' - - name: Setup PHP - if: steps.changes.outputs.php == 'true' uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} @@ -48,7 +40,6 @@ jobs: tools: phpstan, codesniffer - name: Cache Composer dependencies - if: steps.changes.outputs.php == 'true' uses: actions/cache@v3 with: path: vendor/ @@ -62,16 +53,13 @@ jobs: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader - name: Install vendor-bin dependencies - if: steps.changes.outputs.php == 'true' run: | composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/owncloud-codestyle composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phpstan composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phan - name: Run PHP Code Sniffer - if: steps.changes.outputs.php == 'true' run: make test-php-style - continue-on-error: true phpstan-analysis: name: PHPStan Static Analysis @@ -86,18 +74,7 @@ jobs: with: fetch-depth: 0 - - name: Check if changes affect PHP - id: changes - uses: dorny/paths-filter@v2 - with: - filters: | - php: - - '**/*.php' - - '!tests/acceptance/**' - - '!build/**' - - name: Setup PHP - if: steps.changes.outputs.php == 'true' uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} @@ -105,7 +82,6 @@ jobs: ini-values: "memory_limit=1024M" - name: Cache Composer dependencies - if: steps.changes.outputs.php == 'true' uses: actions/cache@v3 with: path: vendor/ @@ -114,21 +90,16 @@ jobs: ${{ runner.os }}-composer- - name: Install Composer dependencies - if: steps.changes.outputs.php == 'true' run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader - name: Install vendor-bin dependencies - if: steps.changes.outputs.php == 'true' run: composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phpstan - name: Install server dependencies - if: steps.changes.outputs.php == 'true' run: make install-server - name: Run PHPStan - if: steps.changes.outputs.php == 'true' run: make test-php-phpstan - continue-on-error: true phan-analysis: name: Phan Static Analysis @@ -143,18 +114,7 @@ jobs: with: fetch-depth: 0 - - name: Check if changes affect PHP - id: changes - uses: dorny/paths-filter@v2 - with: - filters: | - php: - - '**/*.php' - - '!tests/acceptance/**' - - '!build/**' - - name: Setup PHP - if: steps.changes.outputs.php == 'true' uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} @@ -162,7 +122,6 @@ jobs: ini-values: "memory_limit=1024M" - name: Cache Composer dependencies - if: steps.changes.outputs.php == 'true' uses: actions/cache@v3 with: path: vendor/ @@ -171,21 +130,16 @@ jobs: ${{ runner.os }}-composer- - name: Install Composer dependencies - if: steps.changes.outputs.php == 'true' run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader - name: Install vendor-bin dependencies - if: steps.changes.outputs.php == 'true' run: composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phan - name: Install server dependencies - if: steps.changes.outputs.php == 'true' run: make install-server - - name: Run Phan - if: steps.changes.outputs.php == 'true' + - name: Run PHP-Phan run: make test-php-phan - continue-on-error: true javascript-lint: name: JavaScript Linting @@ -196,36 +150,21 @@ jobs: with: fetch-depth: 0 - - name: Check if changes affect JavaScript - id: changes - uses: dorny/paths-filter@v2 - with: - filters: | - javascript: - - '**/*.js' - - 'package.json' - - 'package-lock.json' - - name: Setup Node.js - if: steps.changes.outputs.javascript == 'true' uses: actions/setup-node@v3 with: node-version: "14" cache: npm - name: Install Node dependencies - if: steps.changes.outputs.javascript == 'true' run: npm ci - name: Run JavaScript linting - if: steps.changes.outputs.javascript == 'true' run: npm run lint - continue-on-error: true git-commit-messages: name: Git Commit Messages runs-on: ubuntu-latest - if: github.event_name == 'pull_request' steps: - name: Checkout code uses: actions/checkout@v4 From d1fc5f540e79df1e0461dc66e95c7db08740a582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 16 Feb 2026 11:43:30 +0100 Subject: [PATCH 04/11] fix: simplify --- .github/workflows/lint-and-codestyle.yml | 116 ++--------------------- 1 file changed, 6 insertions(+), 110 deletions(-) diff --git a/.github/workflows/lint-and-codestyle.yml b/.github/workflows/lint-and-codestyle.yml index f2681d3e5605..a99930ed2f12 100644 --- a/.github/workflows/lint-and-codestyle.yml +++ b/.github/workflows/lint-and-codestyle.yml @@ -48,119 +48,15 @@ jobs: ${{ runner.os }}-composer- - name: Install Composer dependencies - if: steps.changes.outputs.php == 'true' run: | - composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader - - - name: Install vendor-bin dependencies - run: | - composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/owncloud-codestyle - composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phpstan - composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phan + make install-composer-deps + make vendor-bin-deps - name: Run PHP Code Sniffer - run: make test-php-style - - phpstan-analysis: - name: PHPStan Static Analysis - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php-version: ["7.4"] - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - extensions: curl, gd, json, xml, zip - ini-values: "memory_limit=1024M" - - - name: Cache Composer dependencies - uses: actions/cache@v3 - with: - path: vendor/ - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Install Composer dependencies - run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader - - - name: Install vendor-bin dependencies - run: composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phpstan - - - name: Install server dependencies - run: make install-server - - - name: Run PHPStan - run: make test-php-phpstan - - phan-analysis: - name: Phan Static Analysis - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php-version: ["7.4"] - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - extensions: curl, gd, json, xml, zip - ini-values: "memory_limit=1024M" - - - name: Cache Composer dependencies - uses: actions/cache@v3 - with: - path: vendor/ - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Install Composer dependencies - run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader - - - name: Install vendor-bin dependencies - run: composer install --no-progress --no-interaction --prefer-dist --working-dir=vendor-bin/phan - - - name: Install server dependencies - run: make install-server - - - name: Run PHP-Phan - run: make test-php-phan - - javascript-lint: - name: JavaScript Linting - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: "14" - cache: npm - - - name: Install Node dependencies - run: npm ci - - - name: Run JavaScript linting - run: npm run lint + run: | + make test-php-style + make test-php-phpstan + make test-php-phan git-commit-messages: name: Git Commit Messages From 0a3ff4ef18fb60a4823acc6497b1a7b6d841e1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 16 Feb 2026 11:46:36 +0100 Subject: [PATCH 05/11] fix: split code tool into own steps --- .github/workflows/lint-and-codestyle.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint-and-codestyle.yml b/.github/workflows/lint-and-codestyle.yml index a99930ed2f12..df97c63a0bd1 100644 --- a/.github/workflows/lint-and-codestyle.yml +++ b/.github/workflows/lint-and-codestyle.yml @@ -52,10 +52,16 @@ jobs: make install-composer-deps make vendor-bin-deps - - name: Run PHP Code Sniffer + - name: Run PHP Code Style Checks run: | make test-php-style + + - name: Run PHP Stan + run: | make test-php-phpstan + + - name: Run PHP Phan + run: | make test-php-phan git-commit-messages: From 96d95abb66bd1e9679d34f22173ab5feb1468fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 16 Feb 2026 11:51:59 +0100 Subject: [PATCH 06/11] fix: install server --- .github/workflows/lint-and-codestyle.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/lint-and-codestyle.yml b/.github/workflows/lint-and-codestyle.yml index df97c63a0bd1..fae9385da85f 100644 --- a/.github/workflows/lint-and-codestyle.yml +++ b/.github/workflows/lint-and-codestyle.yml @@ -52,6 +52,10 @@ jobs: make install-composer-deps make vendor-bin-deps + - name: Install Server + run: | + DATA_DIRECTORY=$(pwd)/data bash tests/drone/install-server.sh + - name: Run PHP Code Style Checks run: | make test-php-style From 59da43f026b2e8341b33ba8442c8bd46220a2174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 16 Feb 2026 12:38:02 +0100 Subject: [PATCH 07/11] chore: drop commitsar from droneci --- .drone.star | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.drone.star b/.drone.star index 85598b2fec6d..6454b5cd7045 100644 --- a/.drone.star +++ b/.drone.star @@ -508,7 +508,7 @@ def main(ctx): return initial + before + coverageTests + afterCoverageTests + nonCoverageTests + stages def initialPipelines(ctx): - return dependencies(ctx) + checkStarlark() + checkGitCommit() + return dependencies(ctx) + checkStarlark() def beforePipelines(ctx): return codestyle(ctx) + changelog(ctx) + phpstan(ctx) + phan(ctx) @@ -2951,25 +2951,6 @@ def checkStarlark(): }, }] -def checkGitCommit(): - return [{ - "kind": "pipeline", - "type": "docker", - "name": "check-git-commit-messages", - "steps": [ - { - "name": "format-check-git-commit", - "image": "aevea/commitsar:latest", - }, - ], - "depends_on": [], - "trigger": { - "ref": [ - "refs/pull/**", - ], - }, - }] - def skipIfUnchanged(ctx, type): if ("full-ci" in ctx.build.title.lower()): return [] From 1fa9e3f81db2d358c6dfb7d2ad8114e99fe1e28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 16 Feb 2026 12:45:26 +0100 Subject: [PATCH 08/11] fix: drop php code tools from drone --- .drone.star | 286 +--------------------------------------------------- 1 file changed, 1 insertion(+), 285 deletions(-) diff --git a/.drone.star b/.drone.star index 6454b5cd7045..9527e7c21a41 100644 --- a/.drone.star +++ b/.drone.star @@ -59,8 +59,6 @@ config = { ], "dependencies": True, "codestyle": True, - "phpstan": True, - "phan": True, "javascript": True, "litmus": True, "dav": True, @@ -511,7 +509,7 @@ def initialPipelines(ctx): return dependencies(ctx) + checkStarlark() def beforePipelines(ctx): - return codestyle(ctx) + changelog(ctx) + phpstan(ctx) + phan(ctx) + return codestyle(ctx) + changelog(ctx) def coveragePipelines(ctx): # All unit test pipelines that have coverage or other test analysis reported @@ -593,10 +591,6 @@ def dependencies(ctx): "steps": cacheRestore() + cacheClearOnEventPush(phpVersion) + composerInstall(phpVersion) + - vendorbinCodestyle(phpVersion) + - vendorbinCodesniffer(phpVersion) + - vendorbinPhan(phpVersion) + - vendorbinPhpstan(phpVersion) + vendorbinBehat() + yarnInstall() + cacheRebuildOnEventPush() + @@ -617,80 +611,6 @@ def dependencies(ctx): return pipelines -def codestyle(ctx): - pipelines = [] - - if "codestyle" not in config: - return pipelines - - default = { - "phpVersions": [DEFAULT_PHP_VERSION], - } - - if "defaults" in config: - if "codestyle" in config["defaults"]: - for item in config["defaults"]["codestyle"]: - default[item] = config["defaults"]["codestyle"][item] - - codestyleConfig = config["codestyle"] - - if type(codestyleConfig) == "bool": - if codestyleConfig: - # the config has 'codestyle' true, so specify an empty dict that will get the defaults - codestyleConfig = {} - else: - return pipelines - - if len(codestyleConfig) == 0: - # 'codestyle' is an empty dict, so specify a single section that will get the defaults - codestyleConfig = {"doDefault": {}} - - for category, matrix in codestyleConfig.items(): - params = {} - for item in default: - params[item] = matrix[item] if item in matrix else default[item] - - for phpVersion in params["phpVersions"]: - name = "coding-standard-php%s" % phpVersion - - result = { - "kind": "pipeline", - "type": "docker", - "name": name, - "workspace": { - "base": dir["base"], - "path": "src", - }, - "steps": skipIfUnchanged(ctx, "lint") + - cacheRestore() + - composerInstall(phpVersion) + - vendorbinCodestyle(phpVersion) + - vendorbinCodesniffer(phpVersion) + - [ - { - "name": "php-style", - "image": OC_CI_PHP % phpVersion, - "commands": [ - "make test-php-style", - ], - }, - ], - "depends_on": [], - "trigger": { - "ref": [ - "refs/pull/**", - "refs/tags/**", - ], - }, - } - - for branch in config["branches"]: - result["trigger"]["ref"].append("refs/heads/%s" % branch) - - pipelines.append(result) - - return pipelines - def changelog(ctx): repo_slug = ctx.build.source_repo if ctx.build.source_repo else ctx.repo.slug pipelines = [] @@ -785,150 +705,6 @@ def changelog(ctx): return pipelines -def phpstan(ctx): - pipelines = [] - - if "phpstan" not in config: - return pipelines - - default = { - "phpVersions": [DEFAULT_PHP_VERSION], - "logLevel": "2", - } - - if "defaults" in config: - if "phpstan" in config["defaults"]: - for item in config["defaults"]["phpstan"]: - default[item] = config["defaults"]["phpstan"][item] - - phpstanConfig = config["phpstan"] - - if type(phpstanConfig) == "bool": - if phpstanConfig: - # the config has 'phpstan' true, so specify an empty dict that will get the defaults - phpstanConfig = {} - else: - return pipelines - - if len(phpstanConfig) == 0: - # 'phpstan' is an empty dict, so specify a single section that will get the defaults - phpstanConfig = {"doDefault": {}} - - for category, matrix in phpstanConfig.items(): - params = {} - for item in default: - params[item] = matrix[item] if item in matrix else default[item] - - for phpVersion in params["phpVersions"]: - name = "phpstan-php%s" % phpVersion - - result = { - "kind": "pipeline", - "type": "docker", - "name": name, - "workspace": { - "base": dir["base"], - "path": "src", - }, - "steps": skipIfUnchanged(ctx, "lint") + - cacheRestore() + - composerInstall(phpVersion) + - vendorbinPhpstan(phpVersion) + - installServer(phpVersion, "sqlite", params["logLevel"]) + - enableAppsForPhpStan(phpVersion) + - [ - { - "name": "php-phpstan", - "image": OC_CI_PHP % phpVersion, - "commands": [ - "make test-php-phpstan", - ], - }, - ], - "depends_on": [], - "trigger": { - "ref": [ - "refs/pull/**", - "refs/tags/**", - ], - }, - } - - pipelines.append(result) - - return pipelines - -def phan(ctx): - pipelines = [] - - if "phan" not in config: - return pipelines - - default = { - "phpVersions": [DEFAULT_PHP_VERSION], - "logLevel": "2", - } - - if "defaults" in config: - if "phan" in config["defaults"]: - for item in config["defaults"]["phan"]: - default[item] = config["defaults"]["phan"][item] - - phanConfig = config["phan"] - - if type(phanConfig) == "bool": - if phanConfig: - # the config has 'phan' true, so specify an empty dict that will get the defaults - phanConfig = {} - else: - return pipelines - - if len(phanConfig) == 0: - # 'phan' is an empty dict, so specify a single section that will get the defaults - phanConfig = {"doDefault": {}} - - for category, matrix in phanConfig.items(): - params = {} - for item in default: - params[item] = matrix[item] if item in matrix else default[item] - - for phpVersion in params["phpVersions"]: - name = "phan-php%s" % phpVersion - - result = { - "kind": "pipeline", - "type": "docker", - "name": name, - "workspace": { - "base": dir["base"], - "path": "src", - }, - "steps": skipIfUnchanged(ctx, "lint") + cacheRestore() + - composerInstall(phpVersion) + - vendorbinPhan(phpVersion) + - installServer(phpVersion, "sqlite", params["logLevel"]) + - [ - { - "name": "phan", - "image": OC_CI_PHP % phpVersion, - "commands": [ - "make test-php-phan", - ], - }, - ], - "depends_on": [], - "trigger": { - "ref": [ - "refs/pull/**", - "refs/tags/**", - ], - }, - } - - pipelines.append(result) - - return pipelines - def litmus(): pipelines = [] @@ -2391,54 +2167,6 @@ def composerInstall(phpVersion): ], }] -def vendorbinCodestyle(phpVersion): - return [{ - "name": "vendorbin-codestyle", - "image": OC_CI_PHP % phpVersion, - "environment": { - "COMPOSER_HOME": "%s/.cache/composer" % dir["server"], - }, - "commands": [ - "make vendor-bin-codestyle", - ], - }] - -def vendorbinCodesniffer(phpVersion): - return [{ - "name": "vendorbin-codesniffer", - "image": OC_CI_PHP % phpVersion, - "environment": { - "COMPOSER_HOME": "%s/.cache/composer" % dir["server"], - }, - "commands": [ - "make vendor-bin-codesniffer", - ], - }] - -def vendorbinPhan(phpVersion): - return [{ - "name": "vendorbin-phan", - "image": OC_CI_PHP % phpVersion, - "environment": { - "COMPOSER_HOME": "%s/.cache/composer" % dir["server"], - }, - "commands": [ - "make vendor-bin-phan", - ], - }] - -def vendorbinPhpstan(phpVersion): - return [{ - "name": "vendorbin-phpstan", - "image": OC_CI_PHP % phpVersion, - "environment": { - "COMPOSER_HOME": "%s/.cache/composer" % dir["server"], - }, - "commands": [ - "make vendor-bin-phpstan", - ], - }] - def vendorbinBehat(): return [{ "name": "vendorbin-behat", @@ -2577,18 +2305,6 @@ def installServer(phpVersion, db, logLevel = "2", ssl = False, federatedServerNe ], }] -def enableAppsForPhpStan(phpVersion): - return [{ - "name": "enable-apps-for-phpstan", - "image": OC_CI_PHP % phpVersion, - "commands": [ - # files_external can be disabled. - # We need it to be enabled so that the PHP static analyser can find classes in it. - "php occ a:e files_external", - "php occ a:l", - ], - }] - def installAndConfigureFederated(ctx, federatedServerVersion, phpVersion, logLevel, protocol, db, dbSuffix = "fed"): return [ installFederated(ctx, federatedServerVersion, db, dbSuffix), From 5e6b09bd98988b7272026de9eee2df7e7fa296c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 16 Feb 2026 12:57:35 +0100 Subject: [PATCH 09/11] fix: use commitsar from docker --- .github/workflows/lint-and-codestyle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-and-codestyle.yml b/.github/workflows/lint-and-codestyle.yml index fae9385da85f..207adf3a4bcc 100644 --- a/.github/workflows/lint-and-codestyle.yml +++ b/.github/workflows/lint-and-codestyle.yml @@ -78,5 +78,5 @@ jobs: fetch-depth: 0 - name: Validate commit messages - uses: aevea/commitsar@v1.0.2 + uses: docker://aevea/commitsar:latest From 2345fb5d4e14d147715b8ff202dcef8e006e74f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 16 Feb 2026 12:59:06 +0100 Subject: [PATCH 10/11] fix: drone.star --- .drone.star | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.drone.star b/.drone.star index 9527e7c21a41..a7988995db7b 100644 --- a/.drone.star +++ b/.drone.star @@ -58,7 +58,6 @@ config = { "master", ], "dependencies": True, - "codestyle": True, "javascript": True, "litmus": True, "dav": True, @@ -509,7 +508,7 @@ def initialPipelines(ctx): return dependencies(ctx) + checkStarlark() def beforePipelines(ctx): - return codestyle(ctx) + changelog(ctx) + return changelog(ctx) def coveragePipelines(ctx): # All unit test pipelines that have coverage or other test analysis reported From 98410101b64696894711a7298cb49068723897a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Mon, 16 Feb 2026 17:06:11 +0100 Subject: [PATCH 11/11] fix: remove cache + fetch-depth --- .github/workflows/lint-and-codestyle.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/lint-and-codestyle.yml b/.github/workflows/lint-and-codestyle.yml index 207adf3a4bcc..5c8161b75786 100644 --- a/.github/workflows/lint-and-codestyle.yml +++ b/.github/workflows/lint-and-codestyle.yml @@ -28,8 +28,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -39,14 +37,6 @@ jobs: ini-values: "memory_limit=1024M" tools: phpstan, codesniffer - - name: Cache Composer dependencies - uses: actions/cache@v3 - with: - path: vendor/ - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - name: Install Composer dependencies run: | make install-composer-deps