From 609bb0aa5c4086df178cd550fc26e13a34c618ae Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Wed, 12 Mar 2025 14:46:24 +0100 Subject: [PATCH 01/14] Add (or update) GitHub Action (GHA) files and related config. --- {build => .config}/.remarkrc | 0 {build => .config}/.yamllint | 0 .config/hadolint.yml | 30 ++++ {build => .config}/phpcs.xml.dist | 2 +- .../workflows/dependancy-security-check.yml | 50 ------ .github/workflows/dockerfile.yml | 56 +++++++ .github/workflows/json.yml | 46 ++++++ .github/workflows/linting.yml | 37 ----- .github/workflows/markdown.yml | 42 +++++ .github/workflows/php-version-sniff.yml | 31 ---- .github/workflows/php.yml | 152 ++++++++++++++++++ .github/workflows/quality-checks.yml | 23 --- .github/workflows/shell.yml | 60 +++++++ .../{ci.yml => solid-tests-suites.yml} | 12 +- .github/workflows/xml.yml | 45 ++++++ .github/workflows/yaml.yml | 42 +++++ run-solid-test-suite.sh | 2 +- 17 files changed, 481 insertions(+), 149 deletions(-) rename {build => .config}/.remarkrc (100%) rename {build => .config}/.yamllint (100%) create mode 100644 .config/hadolint.yml rename {build => .config}/phpcs.xml.dist (98%) delete mode 100644 .github/workflows/dependancy-security-check.yml create mode 100644 .github/workflows/dockerfile.yml create mode 100644 .github/workflows/json.yml delete mode 100644 .github/workflows/linting.yml create mode 100644 .github/workflows/markdown.yml delete mode 100644 .github/workflows/php-version-sniff.yml create mode 100644 .github/workflows/php.yml delete mode 100644 .github/workflows/quality-checks.yml create mode 100644 .github/workflows/shell.yml rename .github/workflows/{ci.yml => solid-tests-suites.yml} (96%) create mode 100644 .github/workflows/xml.yml create mode 100644 .github/workflows/yaml.yml diff --git a/build/.remarkrc b/.config/.remarkrc similarity index 100% rename from build/.remarkrc rename to .config/.remarkrc diff --git a/build/.yamllint b/.config/.yamllint similarity index 100% rename from build/.yamllint rename to .config/.yamllint diff --git a/.config/hadolint.yml b/.config/hadolint.yml new file mode 100644 index 00000000..541ddd31 --- /dev/null +++ b/.config/hadolint.yml @@ -0,0 +1,30 @@ +--- +# For all available rules see: https://github.com/hadolint/hadolint#rules +ignored: + - DL3008 # We do not want to pin versions in apt get install. + - DL3018 # We do not want to pin versions in apk add + +# For full details see https://github.com/hadolint/hadolint#configure +# +# The following keys are available: +# +# failure-threshold: string # name of threshold level (error | warning | info | style | ignore | none) +# format: string # Output format (tty | json | checkstyle | codeclimate | gitlab_codeclimate | gnu | codacy) +# label-schema: # See https://github.com/hadolint/hadolint#linting-labels for details +# author: string # Your name +# contact: string # email address +# created: timestamp # rfc3339 datetime +# version: string # semver +# documentation: string # url +# git-revision: string # hash +# license: string # spdx +# no-color: boolean # true | false +# no-fail: boolean # true | false +# override: +# error: [string] # list of rules +# warning: [string] # list of rules +# info: [string] # list of rules +# style: [string] # list of rules +# strict-labels: boolean # true | false +# disable-ignore-pragma: boolean # true | false +# trustedRegistries: string | [string] # registry or list of registries diff --git a/build/phpcs.xml.dist b/.config/phpcs.xml.dist similarity index 98% rename from build/phpcs.xml.dist rename to .config/phpcs.xml.dist index fc1286ec..a6147742 100644 --- a/build/phpcs.xml.dist +++ b/.config/phpcs.xml.dist @@ -15,7 +15,7 @@ . - */vendor/*|*/build/* + */vendor/*|*/.config/* diff --git a/.github/workflows/dependancy-security-check.yml b/.github/workflows/dependancy-security-check.yml deleted file mode 100644 index 285f62b6..00000000 --- a/.github/workflows/dependancy-security-check.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: Security check - -on: - - push - - pull_request - # Allow manually triggering the workflow. - - workflow_dispatch - -# Cancels all previous workflow runs for the same branch that have not yet completed. -concurrency: - # The concurrency group contains the workflow name and the branch name. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - security-check: - runs-on: ubuntu-latest - name: "Security check" - - strategy: - matrix: - php: ['8.2'] - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none - - # Install dependencies and handle caching in one go. - # @link https://github.com/marketplace/actions/install-composer-dependencies - - name: Install Composer dependencies - uses: "ramsey/composer-install@v2" - with: - working-directory: "solid" - - - name: Download security checker - # yamllint disable-line rule:line-length - run: wget -P . https://github.com/fabpot/local-php-security-checker/releases/download/v2.0.4/local-php-security-checker_2.0.4_linux_amd64 - - - name: Make security checker executable - run: chmod +x ./local-php-security-checker_2.0.4_linux_amd64 - - - name: Check against insecure dependencies - run: ./local-php-security-checker_2.0.4_linux_amd64 --path=solid/composer.lock diff --git a/.github/workflows/dockerfile.yml b/.github/workflows/dockerfile.yml new file mode 100644 index 00000000..0fdbc00a --- /dev/null +++ b/.github/workflows/dockerfile.yml @@ -0,0 +1,56 @@ +--- +name: Dockerfile Quality Assistance + +on: + # This event occurs when there is activity on a pull request. The workflow + # will be run against the commits, after merge to the target branch (main). + pull_request: + branches: [ main ] + paths: + - '.config/hadolint.yml' + - '.dockerignore' + - '.github/workflows/dockerfile.yml' + - 'Dockerfile' + # Docker project specific, Dockerfile "COPY" and "ADD" entries. + - 'solid/' + - 'init-live.sh' + - 'init.sh' + - 'site.conf' + types: [ opened, reopened, synchronize ] + # This event occurs when there is a push to the repository. + push: + paths: + - '.config/hadolint.yml' + - '.dockerignore' + - '.github/workflows/dockerfile.yml' + - 'Dockerfile' + # Docker project specific, Dockerfile "COPY" and "ADD" entries. + - 'solid/' + - 'init-live.sh' + - 'init.sh' + - 'site.conf' + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + # Needed to allow the "concurrency" section to cancel a workflow run. + actions: write + +jobs: + # 03.quality.docker.lint.yml + lint-dockerfile: + name: Dockerfile Linting + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: docker://pipelinecomponents/hadolint + with: + args: >- + hadolint + --config .config/hadolint.yml + Dockerfile diff --git a/.github/workflows/json.yml b/.github/workflows/json.yml new file mode 100644 index 00000000..7e83269e --- /dev/null +++ b/.github/workflows/json.yml @@ -0,0 +1,46 @@ +--- +name: JSON Quality Assistance + +on: + # This event occurs when there is activity on a pull request. The workflow + # will be run against the commits, after merge to the target branch (main). + pull_request: + branches: [ main ] + paths: + - '**.json' + - '.github/workflows/json.yml' + types: [ opened, reopened, synchronize ] + # This event occurs when there is a push to the repository. + push: + paths: + - '**.json' + - '.github/workflows/json.yml' + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + # Needed to allow the "concurrency" section to cancel a workflow run. + actions: write + +jobs: + # 01.preflight.json.lint-syntax.yml + lint-json-syntax: + name: JSON Syntax Linting + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: docker://pipelinecomponents/jsonlint + with: + args: >- + find . + -not -path '*/.git/*' + -not -path '*/node_modules/*' + -not -path '*/vendor/*' + -name '*.json' + -type f + -exec jsonlint --quiet {} ; diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml deleted file mode 100644 index cbca0f41..00000000 --- a/.github/workflows/linting.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: Linting jobs - -on: - - push - - pull_request - -jobs: - lint-json: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: "docker://pipelinecomponents/jsonlint:latest" - with: - args: "find . -not -path './.git/*' -name '*.json' -type f" - - lint-php: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: pipeline-components/php-linter@master - - lint-markdown: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: pipeline-components/remark-lint@master - with: - options: --rc-path=build/.remarkrc --ignore-pattern='*/vendor/*' - - lint-yaml: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: pipeline-components/yamllint@master - with: - options: --config-file=build/.yamllint diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml new file mode 100644 index 00000000..581b9c7e --- /dev/null +++ b/.github/workflows/markdown.yml @@ -0,0 +1,42 @@ +--- +name: Markdown Quality Assistance + +on: + # This event occurs when there is activity on a pull request. The workflow + # will be run against the commits, after merge to the target branch (main). + pull_request: + branches: [ main ] + paths: + - '**.md' + - '.github/workflows/markdown.yml' + types: [ opened, reopened, synchronize ] + # This event occurs when there is a push to the repository. + push: + paths: + - '**.md' + - '.github/workflows/markdown.yml' + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + # Needed to allow the "concurrency" section to cancel a workflow run. + actions: write + +jobs: + # 01.quality.markdown.lint-syntax.yml + lint-markdown-syntax: + name: Markdown Linting + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: docker://pipelinecomponents/remark-lint + with: + args: >- + remark + --rc-path=.config/.remarkrc + --ignore-pattern='*/vendor/*' diff --git a/.github/workflows/php-version-sniff.yml b/.github/workflows/php-version-sniff.yml deleted file mode 100644 index 30cfd373..00000000 --- a/.github/workflows/php-version-sniff.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: PHP Version Compatibility - -on: - - push - - pull_request - # Allow manually triggering the workflow. - - workflow_dispatch - -# Cancels all previous workflow runs for the same branch that have not yet completed. -concurrency: - # The concurrency group contains the workflow name and the branch name. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - php-codesniffer: - strategy: - matrix: - php: [ '8.1' ] - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - uses: pipeline-components/php-codesniffer@master - with: - options: >- - -s - --ignore='*vendor/*' - --standard=PHPCompatibility - --extensions=php - --runtime-set testVersion ${{ matrix.php }} diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 00000000..8bd8937d --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,152 @@ +--- +name: PHP Quality Assistance + +on: + # This event occurs when there is activity on a pull request. The workflow + # will be run against the commits, after merge to the target branch (main). + pull_request: + paths: + - '**.php' + - '.config/phpcs.xml.dist' + - '.config/phpunit.xml.dist' + - '.github/workflows/php.yml' + - 'composer.json' + - 'composer.lock' + branches: [ main ] + types: [ opened, reopened, synchronize ] + # This event occurs when there is a push to the repository. + push: + paths: + - '**.php' + - '.config/phpcs.xml.dist' + - '.config/phpunit.xml.dist' + - '.github/workflows/php.yml' + - 'composer.json' + - 'composer.lock' + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + # Needed to allow the "concurrency" section to cancel a workflow run. + actions: write + +jobs: + # 01.preflight.php.lint-syntax.yml + lint-php-syntax: + name: PHP Syntax Linting + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: docker://pipelinecomponents/php-linter + with: + args: >- + parallel-lint + --exclude .git + --exclude vendor + --no-progress + . + # 01.quality.php.validate.dependencies-file.yml + validate-dependencies-file: + name: Validate dependencies file + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - run: >- + composer validate + --check-lock + --no-plugins + --no-scripts + --strict + working-directory: "solid" + # 02.test.php.test-unit.yml + php-unittest: + name: PHP Unit Tests + needs: + - lint-php-syntax + - validate-dependencies-file + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + php: + - '8.0' # from 2020-11 to 2022-11 (2023-11) + - '8.1' # from 2021-11 to 2023-11 (2025-12) + - '8.2' # from 2022-12 to 2024-12 (2026-12) + - '8.3' # from 2023-11 to 2025-12 (2027-12) + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + coverage: xdebug + ini-values: error_reporting=E_ALL, display_errors=On + php-version: ${{ matrix.php }} + - name: Install and Cache Composer dependencies + uses: "ramsey/composer-install@v2" + with: + working-directory: "solid" + env: + COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}' + - run: bin/phpunit --configuration .config/phpunit.xml.dist + # 03.quality.php.scan.dependencies-vulnerabilities.yml + scan-dependencies-vulnerabilities: + name: Scan Dependencies Vulnerabilities + needs: + - validate-dependencies-file + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - run: >- + composer audit + --abandoned=report + --locked + --no-dev + --no-plugins + --no-scripts + working-directory: "solid" + # 03.quality.php.lint-quality.yml + php-lint-quality: + needs: + - lint-php-syntax + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: docker://pipelinecomponents/php-codesniffer + with: + args: >- + phpcs + -s + --extensions=php + --ignore='*vendor/*' + --standard=.config/phpcs.xml.dist + . + # 03.quality.php.lint-version-compatibility.yml + php-check-version-compatibility: + name: PHP Version Compatibility + needs: + - lint-php-syntax + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + php: + - '8.0' # from 2020-11 to 2022-11 (2023-11) + - '8.1' # from 2021-11 to 2023-11 (2025-12) + - '8.2' # from 2022-12 to 2024-12 (2026-12) + - '8.3' # from 2023-11 to 2025-12 (2027-12) + steps: + - uses: actions/checkout@v4 + - uses: docker://pipelinecomponents/php-codesniffer + with: + args: >- + phpcs + -s + --extensions=php + --ignore='*vendor/*' + --runtime-set testVersion ${{ matrix.php }} + --standard=PHPCompatibility + . diff --git a/.github/workflows/quality-checks.yml b/.github/workflows/quality-checks.yml deleted file mode 100644 index 885c567a..00000000 --- a/.github/workflows/quality-checks.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Quality Assurance jobs - -on: - - push - - pull_request - -jobs: - composer-validate: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: "docker://composer" - with: - args: composer validate --strict --working-dir=solid/ - - php-codesniffer: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: pipeline-components/php-codesniffer@master - with: - options: --standard=build/phpcs.xml.dist diff --git a/.github/workflows/shell.yml b/.github/workflows/shell.yml new file mode 100644 index 00000000..3ef3d51d --- /dev/null +++ b/.github/workflows/shell.yml @@ -0,0 +1,60 @@ +--- +name: Shell Script Quality Assistance + +on: + # This event occurs when there is activity on a pull request. The workflow + # will be run against the commits, after merge to the target branch (main). + pull_request: + branches: [ main ] + paths: + - '**.bash' + - '**.sh' + - '.github/workflows/shell.yml' + types: [ opened, reopened, synchronize ] + # This event occurs when there is a push to the repository. + push: + paths: + - '**.bash' + - '**.sh' + - '.github/workflows/shell.yml' + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + # Needed to allow the "concurrency" section to cancel a workflow run. + actions: write + +jobs: + # 01.preflight.shell.lint-syntax.yml + lint-shell-syntax: + name: Shell Syntax Linting + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - run: >- + find . + -name '*.sh' + -not -path '*/.git/*' + -type f + -print0 + | xargs -0 -P"$(nproc)" -I{} bash -n "{}" + # 03.quality.shell.lint.yml + lint-shell-quality: + name: Shell Quality Linting + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: docker://pipelinecomponents/shellcheck + with: + args: >- + find . + -not -path '*/.git/*' + -name '*.sh' + -type f + -print0 + | xargs -0 -r -n1 shellcheck diff --git a/.github/workflows/ci.yml b/.github/workflows/solid-tests-suites.yml similarity index 96% rename from .github/workflows/ci.yml rename to .github/workflows/solid-tests-suites.yml index 4aa46902..895d0fb4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/solid-tests-suites.yml @@ -46,15 +46,15 @@ jobs: | tr --complement --squeeze-repeats '[:alnum:]._-' '_')" \ >> "${GITHUB_ENV}" - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: cache-solid-nextcloud-docker with: path: cache/solid-nextcloud key: solid-nextcloud-docker-${{ matrix.nextcloud_version }}-${{ github.sha }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: docker/login-action@v2 + - uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} @@ -101,15 +101,15 @@ jobs: | tr --complement --squeeze-repeats '[:alnum:]._-' '_')" \ >> "${GITHUB_ENV}" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: cache-solid-nextcloud-docker with: path: cache/solid-nextcloud key: solid-nextcloud-docker-${{ matrix.nextcloud_version }}-${{ github.sha }} - - uses: docker/login-action@v2 + - uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} diff --git a/.github/workflows/xml.yml b/.github/workflows/xml.yml new file mode 100644 index 00000000..62d0c2eb --- /dev/null +++ b/.github/workflows/xml.yml @@ -0,0 +1,45 @@ +--- +name: XML Quality Assistance + +on: + # This event occurs when there is activity on a pull request. The workflow + # will be run against the commits, after merge to the target branch (main). + pull_request: + branches: [ main ] + paths: + - '**.xml' + - '**.xml.dist' + - '.github/workflows/xml.yml' + types: [ opened, reopened, synchronize ] + # This event occurs when there is a push to the repository. + push: + paths: + - '**.xml' + - '**.xml.dist' + - '.github/workflows/xml.yml' + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + # Needed to allow the "concurrency" section to cancel a workflow run. + actions: write + +jobs: + # 01.preflight.xml.lint-syntax.yml + lint-xml: + name: XML Linting + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: docker://pipelinecomponents/xmllint + with: + args: >- + find . + -iname '*.xml' + -type f + -exec xmllint --noout {} \+ diff --git a/.github/workflows/yaml.yml b/.github/workflows/yaml.yml new file mode 100644 index 00000000..ad8fb9d3 --- /dev/null +++ b/.github/workflows/yaml.yml @@ -0,0 +1,42 @@ +--- +name: YAML Quality Assistance + +on: + # This event occurs when there is activity on a pull request. The workflow + # will be run against the commits, after merge to the target branch (main). + pull_request: + branches: [ main ] + paths: + - '**.yml' + - '**.yaml' + types: [ opened, reopened, synchronize ] + # This event occurs when there is a push to the repository. + push: + paths: + - '**.yml' + - '**.yaml' + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + # Needed to allow the "concurrency" section to cancel a workflow run. + actions: write + +jobs: + # 01.preflight.yaml.lint.yml + lint-yaml: + name: YAML Linting + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: docker://pipelinecomponents/yamllint + with: + args: >- + yamllint + --config-file=.config/.yamllint + . diff --git a/run-solid-test-suite.sh b/run-solid-test-suite.sh index 4416b4cb..9f35e320 100755 --- a/run-solid-test-suite.sh +++ b/run-solid-test-suite.sh @@ -2,7 +2,7 @@ set -e -# Note that .github/workflows/ci.yml does not use this, this function is just for manual runs of this script. +# Note that .github/workflows/solid-tests-suites.yml does not use this, this function is just for manual runs of this script. # You can pick different values for the NEXTCLOUD_VERSION build arg, as required: function setup { docker build -t pubsub-server https://github.com/pdsinterop/php-solid-pubsub-server.git#main From acc9f96616e8abdc83689093fc6c216b9eacff1d Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Mon, 26 May 2025 10:56:40 +0200 Subject: [PATCH 02/14] add no-install-recommends to solve Dockerfile:4 DL3015 info: Avoid additional packages by specifying `--no-install-recommends` --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 80ff378e..84340bee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ -ARG NEXTCLOUD_VERSION -FROM nextcloud:${NEXTCLOUD_VERSION} +#ARG NEXTCLOUD_VERSION +#FROM nextcloud:${NEXTCLOUD_VERSION} +FROM nextcloud:31 -RUN apt-get update && apt-get install -yq \ +RUN apt-get update && apt-get install --no-install-recommends -yq \ git \ sudo \ vim \ From ce7f573c4c754462028c4b7c32e8d0f848e30ad1 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Sat, 31 May 2025 11:24:33 +0200 Subject: [PATCH 03/14] fix shell and xml runs --- .github/workflows/shell.yml | 9 ++------- .github/workflows/xml.yml | 7 ++----- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/shell.yml b/.github/workflows/shell.yml index 3ef3d51d..d3026535 100644 --- a/.github/workflows/shell.yml +++ b/.github/workflows/shell.yml @@ -51,10 +51,5 @@ jobs: - uses: actions/checkout@v4 - uses: docker://pipelinecomponents/shellcheck with: - args: >- - find . - -not -path '*/.git/*' - -name '*.sh' - -type f - -print0 - | xargs -0 -r -n1 shellcheck + # yamllint disable-line rule:line-length + args: /bin/sh -c "find . -not -path '*/.git/*' -name '*.sh' -type f -print0 | xargs -0 -r -n1 shellcheck" diff --git a/.github/workflows/xml.yml b/.github/workflows/xml.yml index 62d0c2eb..0c30f8f5 100644 --- a/.github/workflows/xml.yml +++ b/.github/workflows/xml.yml @@ -38,8 +38,5 @@ jobs: - uses: actions/checkout@v4 - uses: docker://pipelinecomponents/xmllint with: - args: >- - find . - -iname '*.xml' - -type f - -exec xmllint --noout {} \+ + # yamllint disable-line rule:line-length + args: /bin/sh -c "find . -iname '*.xml' -type f -exec xmllint --noout {} \+" From 4ab38da106b8fd7d80d5a8c4439b31fe7e416ff6 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Sun, 1 Jun 2025 13:09:10 +0200 Subject: [PATCH 04/14] restore nextcloud_version --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 84340bee..9324cbad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ -#ARG NEXTCLOUD_VERSION -#FROM nextcloud:${NEXTCLOUD_VERSION} -FROM nextcloud:31 +ARG NEXTCLOUD_VERSION +FROM nextcloud:${NEXTCLOUD_VERSION} RUN apt-get update && apt-get install --no-install-recommends -yq \ git \ From 6c8689690ee6a805a43643e142e56ddac837a622 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Sun, 1 Jun 2025 20:24:39 +0200 Subject: [PATCH 05/14] Add project autoloader to Application boot. --- solid/lib/AppInfo/Application.php | 1 + 1 file changed, 1 insertion(+) diff --git a/solid/lib/AppInfo/Application.php b/solid/lib/AppInfo/Application.php index 5436450b..7b3ed3b5 100644 --- a/solid/lib/AppInfo/Application.php +++ b/solid/lib/AppInfo/Application.php @@ -76,5 +76,6 @@ public function register(IRegistrationContext $context): void { } public function boot(IBootContext $context): void { + require_once(__DIR__.'/../../vendor/autoload.php'); } } From 0a5733f6010cc208cdb44ca3e414407107d7c4ee Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Sun, 1 Jun 2025 20:25:04 +0200 Subject: [PATCH 06/14] Fix broken unit-test. --- .../Unit/Controller/PageControllerTest.php | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/solid/tests/Unit/Controller/PageControllerTest.php b/solid/tests/Unit/Controller/PageControllerTest.php index 2b488abf..b15ba6d1 100644 --- a/solid/tests/Unit/Controller/PageControllerTest.php +++ b/solid/tests/Unit/Controller/PageControllerTest.php @@ -1,25 +1,47 @@ getMockBuilder('OCP\IRequest')->getMock(); - $this->controller = new PageController('solid', $request, $this->userId); + public function setUp(): void + { + $mockConfig = $this->getMockBuilder(IConfig::class)->getMock(); + $mockRequest = $this->getMockBuilder(IRequest::class)->getMock(); + $mockUrlGenerator = $this->getMockBuilder(IURLGenerator::class)->getMock(); + $mockUserManager = $this->getMockBuilder(IUserManager::class)->getMock(); + + $this->controller = new PageController( + 'solid', + $mockRequest, + $mockConfig, + $mockUserManager, + $mockUrlGenerator, + self::MOCK_USER_ID + ); } - public function testIndex() { + /** + * @covers ::index + * @uses \OCA\Solid\BaseServerConfig::__construct + * @uses \OCA\Solid\ServerConfig::__construct + */ + public function testIndex() + { $result = $this->controller->index(); $this->assertEquals('index', $result->getTemplateName()); From 4aeb908aa0c3df68d45c83b4700a4c95d21b57b4 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Sun, 1 Jun 2025 20:25:54 +0200 Subject: [PATCH 07/14] Add unit-test code-coverage docblocks. --- solid/tests/Unit/JtiReplayDetectorTest.php | 30 +++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/solid/tests/Unit/JtiReplayDetectorTest.php b/solid/tests/Unit/JtiReplayDetectorTest.php index 5395a60d..888e73e8 100644 --- a/solid/tests/Unit/JtiReplayDetectorTest.php +++ b/solid/tests/Unit/JtiReplayDetectorTest.php @@ -9,20 +9,20 @@ use OCP\DB\IResult; use PHPUnit\Framework\TestCase; +/** + * @coversDefaultClass \OCA\Solid\JtiReplayDetector + * @covers ::__construct + * @covers :: + */ class JtiReplayDetectorTest extends TestCase { - public static function setUpBeforeClass(): void - { - require_once __DIR__.'/../../lib/JtiReplayDetector.php'; - } - private function createMocks($result) { $mockIDBConnection = $this->createMock(IDBConnection::class); $mockQueryBuilder = $this->createMock(IQueryBuilder::class); $mockExpr = $this->createMock(IExpressionBuilder::class); $mockResult = $this->createMock(IResult::class); - + $mockIDBConnection->expects($this->any()) ->method('getQueryBuilder') ->willReturn($mockQueryBuilder); @@ -34,7 +34,7 @@ private function createMocks($result) ->willReturn($mockExpr); $mockExpr->expects($this->any()) ->method('eq') - ->willReturn(""); + ->willReturn(''); $mockQueryBuilder->expects($this->once()) ->method('from') ->willReturnSelf(); @@ -67,13 +67,16 @@ private function createMocks($result) return $mockIDBConnection; } + /** + * @covers ::detect + */ public function testJtiDetected(): void - { + { $dateInterval = new DateInterval('PT90S'); $mockIDBConnection = $this->createMocks(true); - + $detector = new JtiReplayDetector($dateInterval, $mockIDBConnection); - + $mockUUID = 'mockUUID-with-some-more-text'; $mockURI = 'mockURI'; $result = $detector->detect($mockUUID, $mockURI); @@ -81,13 +84,16 @@ public function testJtiDetected(): void $this->assertTrue($result); } + /** + * @covers ::detect + */ public function testJtiNotDetected(): void { $dateInterval = new DateInterval('PT90S'); $mockIDBConnection = $this->createMocks(false); - + $detector = new JtiReplayDetector($dateInterval, $mockIDBConnection); - + $mockUUID = 'mockUUID-with-some-more-text'; $mockURI = 'mockURI'; $result = $detector->detect($mockUUID, $mockURI); From 03b5abf35aff6da5a5a118843ca17d30ae2274cc Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Sun, 1 Jun 2025 20:26:35 +0200 Subject: [PATCH 08/14] Remove unneeded backwards-compatible PHPUnit autoloader call. --- solid/tests/bootstrap.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/solid/tests/bootstrap.php b/solid/tests/bootstrap.php index 91a9a5b9..2f8f24ba 100644 --- a/solid/tests/bootstrap.php +++ b/solid/tests/bootstrap.php @@ -14,8 +14,4 @@ // Fix for "Autoload path not allowed: .../solid/tests/testcase.php" \OC_App::loadApp('solid'); -if(!class_exists('PHPUnit_Framework_TestCase')) { - require_once('PHPUnit/Autoload.php'); -} - OC_Hook::clear(); From 87f41ec48e6d961dddf3f41b144c4d7496328fa8 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Sun, 1 Jun 2025 20:27:34 +0200 Subject: [PATCH 09/14] Remove Nextcloud as development dependency. --- solid/composer.json | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/solid/composer.json b/solid/composer.json index 61dbb3b6..d1de8712 100644 --- a/solid/composer.json +++ b/solid/composer.json @@ -37,33 +37,6 @@ }, "require-dev": { "doctrine/dbal": "*", - "nextcloud/server": "*", "phpunit/phpunit": "^8 || ^9" - }, - "repositories": [ - { - "type": "package", - "package": { - "name": "nextcloud/server", - "version": "27.0.0", - "dist": { - "url": "https://github.com/nextcloud/server/archive/refs/tags/v27.0.0.zip", - "type": "zip" - }, - "source": { - "url": "https://github.com/nextcloud/server.git", - "type": "git", - "reference": "master" - }, - "autoload": { - "psr-4": { - "": "lib/private/legacy", - "OC\\": "lib/private", - "OC\\Core\\": "core/", - "OCP\\": "lib/public" - } - } - } - } - ] + } } From fcbe414539511cf7c574e32d8ee856e64e5cb39e Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Sun, 1 Jun 2025 20:39:04 +0200 Subject: [PATCH 10/14] Add script to determine required xDebug version. --- docker/xdebug.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docker/xdebug.sh diff --git a/docker/xdebug.sh b/docker/xdebug.sh new file mode 100644 index 00000000..c3dd2693 --- /dev/null +++ b/docker/xdebug.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +set -o errexit # Exit script when a command exits with non-zero status. +#set -o errtrace # Exit on error inside any functions or sub-shells. +set -o nounset # Exit script on use of an undefined variable. +#set -o pipefail # Return exit status of the last command in the pipe that exited with a non-zero exit code + +if [ -z "${NEXTCLOUD_VERSION}" ]; then + echo >&2 'The "NEXTCLOUD_VERSION" variable MUST be set during build: docker build --build-arg "NEXTCLOUD_VERSION=..."' + exit 65 +else + echo "NEXTCLOUD_VERSION is set to '${NEXTCLOUD_VERSION}'" +fi + +PHP_VERSION="${PHP_VERSION:-$(php -r 'echo PHP_VERSION;')}" +PHP_MAJOR="${PHP_VERSION%%.*}" +PHP_MINOR="$(echo "${PHP_VERSION}" | awk -F. '{print $2}')" + +if [ -z "${XDEBUG_VERSION:-}" ]; then + if [ "$PHP_MAJOR" -eq 8 ]; then + XDEBUG_VERSION=3.4.3 + elif [ "$PHP_MAJOR" -eq 7 ]; then + if [ "$PHP_MINOR" -ge 2 ] && [ "$PHP_MINOR" -le 4 ]; then + XDEBUG_VERSION=3.1.6 + elif [ "$PHP_MINOR" -eq 1 ]; then + XDEBUG_VERSION=2.9.8 + elif [ "$PHP_MINOR" -eq 0 ]; then + XDEBUG_VERSION=2.7.2 + else + echo >&2 "Unsupported PHP 7 minor version: $PHP_MINOR" + exit 66 + fi + elif [ "$PHP_MAJOR" -eq 5 ]; then + if [ "$PHP_MINOR" -ge 5 ] && [ "$PHP_MINOR" -le 6 ]; then + XDEBUG_VERSION=2.5.5 + elif [ "$PHP_MINOR" -eq 4 ]; then + XDEBUG_VERSION=2.4.1 + else + echo >&2 "Unsupported PHP 5 minor version: $PHP_MINOR" + exit 67 + fi + else + echo >&2 "Unsupported PHP version: ${PHP_VERSION}" + exit 68 + fi +fi + +echo "${XDEBUG_VERSION}" > /xdebug.version From 577658e37b17903bb61719db154cac299eee7812 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Sun, 1 Jun 2025 20:40:21 +0200 Subject: [PATCH 11/14] Add xDebug install and Nextcloud init to Dockerfile. --- Dockerfile | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9324cbad..d632ef24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,18 @@ ARG NEXTCLOUD_VERSION +ARG XDEBUG_VERSION + FROM nextcloud:${NEXTCLOUD_VERSION} -RUN apt-get update && apt-get install --no-install-recommends -yq \ +SHELL ["/bin/bash", "-c"] + +RUN apt-get update \ + && read -ra PHPIZE_DEPS <<< "${PHPIZE_DEPS}" \ + && apt-get install --no-install-recommends -yq \ git \ sudo \ vim \ zip \ + "${PHPIZE_DEPS[@]}" \ && rm -rf /var/lib/apt/lists/* \ && a2enmod ssl \ && mkdir /tls \ @@ -15,13 +22,24 @@ RUN apt-get update && apt-get install --no-install-recommends -yq \ -subj "/C=RO/ST=Bucharest/L=Bucharest/O=IT/CN=www.example.ro" COPY solid/ /usr/src/nextcloud/apps/solid +COPY docker/xdebug.sh /xdebug.sh COPY init.sh / COPY init-live.sh / COPY site.conf /etc/apache2/sites-enabled/000-default.conf COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer -RUN composer install --working-dir=/usr/src/nextcloud/apps/solid --no-dev --prefer-dist \ - && rm /usr/local/bin/composer + +RUN composer install --working-dir=/usr/src/nextcloud/apps/solid --prefer-dist \ + && sh /xdebug.sh \ + && pecl install "xdebug-$(cat /xdebug.version)" \ + && docker-php-ext-enable xdebug \ + && NEXTCLOUD_ADMIN_PASSWORD='alice123' \ + NEXTCLOUD_ADMIN_USER='alice' \ + NEXTCLOUD_TRUSTED_DOMAINS='localhost server thirdparty nextcloud.local *.nextcloud.local' \ + NEXTCLOUD_UPDATE=1 \ + /entrypoint.sh 'echo' \ + && php /var/www/html/console.php maintenance:install --admin-user='alice' --admin-pass='alice123' \ + && php /var/www/html/console.php app:enable solid WORKDIR /var/www/html EXPOSE 443 From eac291993350ef29469989f1b70c75e072c49302 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Sun, 1 Jun 2025 21:26:02 +0200 Subject: [PATCH 12/14] Update composer.lock file. --- solid/composer.lock | 140 ++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 75 deletions(-) diff --git a/solid/composer.lock b/solid/composer.lock index 40fd3303..aadefedb 100644 --- a/solid/composer.lock +++ b/solid/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1843d50801f15c12e9fb50345b3bfb3b", + "content-hash": "ad606694b5bceca2bc068799024e08f9", "packages": [ { "name": "arc/base", @@ -670,20 +670,20 @@ }, { "name": "league/event", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/thephpleague/event.git", - "reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119" + "reference": "062ebb450efbe9a09bc2478e89b7c933875b0935" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/event/zipball/d2cc124cf9a3fab2bb4ff963307f60361ce4d119", - "reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119", + "url": "https://api.github.com/repos/thephpleague/event/zipball/062ebb450efbe9a09bc2478e89b7c933875b0935", + "reference": "062ebb450efbe9a09bc2478e89b7c933875b0935", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=7.1.0" }, "require-dev": { "henrikbjorn/phpspec-code-coverage": "~1.0.1", @@ -718,9 +718,9 @@ ], "support": { "issues": "https://github.com/thephpleague/event/issues", - "source": "https://github.com/thephpleague/event/tree/master" + "source": "https://github.com/thephpleague/event/tree/2.3.0" }, - "time": "2018-11-26T11:52:41+00:00" + "time": "2025-03-14T19:51:10+00:00" }, { "name": "league/flysystem", @@ -1647,24 +1647,25 @@ }, { "name": "phrity/util-errorhandler", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sirn-se/phrity-util-errorhandler.git", - "reference": "483228156e06673963902b1cc1e6bd9541ab4d5e" + "reference": "61813189e4525fde4aecad3df849829d526d6f76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirn-se/phrity-util-errorhandler/zipball/483228156e06673963902b1cc1e6bd9541ab4d5e", - "reference": "483228156e06673963902b1cc1e6bd9541ab4d5e", + "url": "https://api.github.com/repos/sirn-se/phrity-util-errorhandler/zipball/61813189e4525fde4aecad3df849829d526d6f76", + "reference": "61813189e4525fde4aecad3df849829d526d6f76", "shasum": "" }, "require": { - "php": "^7.4 | ^8.0" + "php": "^8.1" }, "require-dev": { "php-coveralls/php-coveralls": "^2.0", - "phpunit/phpunit": "^9.0 | ^10.0 | ^11.0", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^10.0 | ^11.0 | ^12.0", "squizlabs/php_codesniffer": "^3.5" }, "type": "library", @@ -1692,9 +1693,9 @@ ], "support": { "issues": "https://github.com/sirn-se/phrity-util-errorhandler/issues", - "source": "https://github.com/sirn-se/phrity-util-errorhandler/tree/1.1.1" + "source": "https://github.com/sirn-se/phrity-util-errorhandler/tree/1.2.0" }, - "time": "2024-09-12T06:49:16+00:00" + "time": "2025-05-26T18:26:51+00:00" }, { "name": "pietercolpaert/hardf", @@ -2260,16 +2261,16 @@ "packages-dev": [ { "name": "doctrine/dbal", - "version": "4.2.2", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "19a2b7deb5fe8c2df0ff817ecea305e50acb62ec" + "reference": "33d2d7fe1269b2301640c44cf2896ea607b30e3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/19a2b7deb5fe8c2df0ff817ecea305e50acb62ec", - "reference": "19a2b7deb5fe8c2df0ff817ecea305e50acb62ec", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/33d2d7fe1269b2301640c44cf2896ea607b30e3e", + "reference": "33d2d7fe1269b2301640c44cf2896ea607b30e3e", "shasum": "" }, "require": { @@ -2346,7 +2347,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/4.2.2" + "source": "https://github.com/doctrine/dbal/tree/4.2.3" }, "funding": [ { @@ -2362,30 +2363,33 @@ "type": "tidelift" } ], - "time": "2025-01-16T08:40:56+00:00" + "time": "2025-03-07T18:29:05+00:00" }, { "name": "doctrine/deprecations", - "version": "1.1.4", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, + "conflict": { + "phpunit/phpunit": "<=7.5 || >=13" + }, "require-dev": { - "doctrine/coding-standard": "^9 || ^12", - "phpstan/phpstan": "1.4.10 || 2.0.3", + "doctrine/coding-standard": "^9 || ^12 || ^13", + "phpstan/phpstan": "1.4.10 || 2.1.11", "phpstan/phpstan-phpunit": "^1.0 || ^2", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", "psr/log": "^1 || ^2 || ^3" }, "suggest": { @@ -2405,9 +2409,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.4" + "source": "https://github.com/doctrine/deprecations/tree/1.1.5" }, - "time": "2024-12-07T21:18:45+00:00" + "time": "2025-04-07T20:06:18+00:00" }, { "name": "doctrine/instantiator", @@ -2481,16 +2485,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.0", + "version": "1.13.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414" + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", "shasum": "" }, "require": { @@ -2529,7 +2533,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" }, "funding": [ { @@ -2537,42 +2541,20 @@ "type": "tidelift" } ], - "time": "2025-02-12T12:17:51+00:00" - }, - { - "name": "nextcloud/server", - "version": "27.0.0", - "source": { - "type": "git", - "url": "https://github.com/nextcloud/server.git", - "reference": "master" - }, - "dist": { - "type": "zip", - "url": "https://github.com/nextcloud/server/archive/refs/tags/v27.0.0.zip" - }, - "type": "library", - "autoload": { - "psr-4": { - "": "lib/private/legacy", - "OC\\": "lib/private", - "OC\\Core\\": "core/", - "OCP\\": "lib/public" - } - } + "time": "2025-04-29T12:36:36+00:00" }, { "name": "nikic/php-parser", - "version": "v5.4.0", + "version": "v5.5.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494" + "reference": "ae59794362fe85e051a58ad36b289443f57be7a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ae59794362fe85e051a58ad36b289443f57be7a9", + "reference": "ae59794362fe85e051a58ad36b289443f57be7a9", "shasum": "" }, "require": { @@ -2615,9 +2597,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.5.0" }, - "time": "2024-12-30T11:07:19+00:00" + "time": "2025-05-31T08:24:38+00:00" }, { "name": "phar-io/manifest", @@ -3058,16 +3040,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.22", + "version": "9.6.23", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" + "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", + "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", "shasum": "" }, "require": { @@ -3078,7 +3060,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.1", + "myclabs/deep-copy": "^1.13.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -3141,7 +3123,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.23" }, "funding": [ { @@ -3152,12 +3134,20 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2024-12-05T13:48:26+00:00" + "time": "2025-05-02T06:40:34+00:00" }, { "name": "sebastian/cli-parser", @@ -4175,7 +4165,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -4185,6 +4175,6 @@ "ext-mbstring": "*", "ext-openssl": "*" }, - "platform-dev": [], - "plugin-api-version": "2.2.0" + "platform-dev": {}, + "plugin-api-version": "2.6.0" } From 1758eed5bde633435f01a8258f88407e2e2b4799 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Sun, 1 Jun 2025 21:48:57 +0200 Subject: [PATCH 13/14] Change PHP GitHub Action (GHA) to run PHPUnit in the Solid Nextcloud Docker image. --- .github/workflows/php.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8bd8937d..6c41e7bd 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -91,7 +91,15 @@ jobs: working-directory: "solid" env: COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}' - - run: bin/phpunit --configuration .config/phpunit.xml.dist + - run: | + docker run \ + --env 'XDEBUG_MODE=coverage' \ + --rm \ + --volume="./solid:/var/www/html/apps/solid" \ + --workdir=/var/www/html/apps/solid \ + ghcr.io/pdsinterop/solid-nextcloud:179_merge-30 \ + bin/phpunit --configuration phpunit.xml + # 03.quality.php.scan.dependencies-vulnerabilities.yml scan-dependencies-vulnerabilities: name: Scan Dependencies Vulnerabilities From 1a5177e6c43a8585313e58d823c2b4bc3d5db968 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Sun, 1 Jun 2025 21:59:28 +0200 Subject: [PATCH 14/14] Change PHP GitHub Action (GHA) for PHPUnit to use Nextcloud versions (instead of PHP versions). --- .github/workflows/php.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 6c41e7bd..54ebeccd 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -73,18 +73,16 @@ jobs: strategy: fail-fast: false matrix: - php: - - '8.0' # from 2020-11 to 2022-11 (2023-11) - - '8.1' # from 2021-11 to 2023-11 (2025-12) - - '8.2' # from 2022-12 to 2024-12 (2026-12) - - '8.3' # from 2023-11 to 2025-12 (2027-12) + nextcloud_version: + - 28 + - 29 + - 30 steps: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - coverage: xdebug ini-values: error_reporting=E_ALL, display_errors=On - php-version: ${{ matrix.php }} + php-version: 8.3 - name: Install and Cache Composer dependencies uses: "ramsey/composer-install@v2" with: @@ -97,7 +95,7 @@ jobs: --rm \ --volume="./solid:/var/www/html/apps/solid" \ --workdir=/var/www/html/apps/solid \ - ghcr.io/pdsinterop/solid-nextcloud:179_merge-30 \ + ghcr.io/pdsinterop/solid-nextcloud:179_merge-${{ matrix.nextcloud_version }} \ bin/phpunit --configuration phpunit.xml # 03.quality.php.scan.dependencies-vulnerabilities.yml