diff --git a/.github/workflows/block-merge-eol.yml b/.github/workflows/block-merge-eol.yml deleted file mode 100644 index 8c7653eac9e0a..0000000000000 --- a/.github/workflows/block-merge-eol.yml +++ /dev/null @@ -1,37 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Block merges for EOL - -on: pull_request - -permissions: - contents: read - -concurrency: - group: block-merge-eol-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - block-merges-eol: - name: Block merges for EOL branches - - # Only run on stableXX branches - if: startsWith( github.base_ref, 'stable') - runs-on: ubuntu-latest - - steps: - - name: Download updater config - run: curl https://raw.githubusercontent.com/nextcloud/updater_server/production/config/config.php --output config.php - - - name: Set server major version environment - run: | - # retrieve version number from branch reference - server_major=$(echo "${{ github.base_ref }}" | sed -En 's/stable//p') - echo "server_major=$server_major" >> $GITHUB_ENV - - - name: Checking if ${{ env.server_major }} is EOL - run: | - php -r 'echo json_encode(require_once "config.php");' | jq --arg version "${{ env.server_major }}" '.stable[$version]["100"].eol // .beta[$version]["100"].eol' | grep --silent -i 'false' diff --git a/.github/workflows/block-merge-freeze.yml b/.github/workflows/block-merge-freeze.yml deleted file mode 100644 index f2d029c9927c8..0000000000000 --- a/.github/workflows/block-merge-freeze.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Block merges during freezes - -on: - pull_request: - types: [opened, ready_for_review, reopened, synchronize] - -permissions: - contents: read - -concurrency: - group: block-merge-freeze-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - block-merges-during-freeze: - name: Block merges during freezes - - if: github.event.pull_request.draft == false - - runs-on: ubuntu-latest - - steps: - - name: Download version.php from ${{ github.base_ref }} - run: curl https://raw.githubusercontent.com/nextcloud/server/${{ github.base_ref }}/version.php --output version.php - - - name: Run check - run: cat version.php | grep 'OC_VersionString' | grep -i -v 'RC' diff --git a/.github/workflows/command-compile.yml b/.github/workflows/command-compile.yml deleted file mode 100644 index 09131179feff9..0000000000000 --- a/.github/workflows/command-compile.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: Compile Command -on: - issue_comment: - types: [created] - -jobs: - init: - runs-on: ubuntu-latest - - # On pull requests and if the comment starts with `/compile` - if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/compile') - - outputs: - git_path: ${{ steps.git-path.outputs.path }} - arg1: ${{ steps.command.outputs.arg1 }} - arg2: ${{ steps.command.outputs.arg2 }} - head_ref: ${{ steps.comment-branch.outputs.head_ref }} - - steps: - - name: Check actor permission - uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2 - with: - require: write - - - name: Add reaction on start - uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3.0.1 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: "+1" - - - name: Parse command - uses: skjnldsv/parse-command-comment@7cef1df370a99dfd5bf896d50121390c96785db8 # v2 - id: command - - # Init path depending on which command is run - - name: Init path - id: git-path - run: | - if ${{ startsWith(steps.command.outputs.arg1, '/') }}; then - echo "path=${{ github.workspace }}${{steps.command.outputs.arg1}}" >> $GITHUB_OUTPUT - else - echo "path=${{ github.workspace }}${{steps.command.outputs.arg2}}" >> $GITHUB_OUTPUT - fi - - - name: Init branch - uses: xt0rted/pull-request-comment-branch@d97294d304604fa98a2600a6e2f916a84b596dc7 # v1 - id: comment-branch - - process: - runs-on: ubuntu-latest - needs: init - - steps: - - name: Checkout ${{ needs.init.outputs.head_ref }} - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - fetch-depth: 0 - ref: ${{ needs.init.outputs.head_ref }} - - - name: Setup git - run: | - git config --local user.email "nextcloud-command@users.noreply.github.com" - git config --local user.name "nextcloud-command" - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.1 - id: package-engines-versions - with: - fallbackNode: '^16' - fallbackNpm: '^7' - - - name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }} - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 - with: - node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }} - cache: npm - - - name: Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }} - run: npm i -g npm@"${{ steps.package-engines-versions.outputs.npmVersion }}" - - - name: Install dependencies & build - run: | - npm ci - npm run build --if-present - - - name: Commit and push default - if: ${{ needs.init.outputs.arg1 != 'fixup' && needs.init.outputs.arg1 != 'amend' }} - run: | - git add ${{ needs.init.outputs.git_path }} - git commit --signoff -m 'chore(assets): Recompile assets' - git push origin ${{ needs.init.outputs.head_ref }} - - - name: Commit and push fixup - if: ${{ needs.init.outputs.arg1 == 'fixup' }} - run: | - git add ${{ needs.init.outputs.git_path }} - git commit --fixup=HEAD --signoff - git push origin ${{ needs.init.outputs.head_ref }} - - - name: Commit and push amend - if: ${{ needs.init.outputs.arg1 == 'amend' }} - run: | - git add ${{ needs.init.outputs.git_path }} - git commit --amend --no-edit --signoff - git push --force origin ${{ needs.init.outputs.head_ref }} - - - name: Add reaction on failure - uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3.0.1 - if: failure() - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: "-1" diff --git a/.github/workflows/command-pull-3rdparty.yml b/.github/workflows/command-pull-3rdparty.yml deleted file mode 100644 index e5ebaff285bd5..0000000000000 --- a/.github/workflows/command-pull-3rdparty.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Update 3rdparty command - -on: - issue_comment: - types: created - -permissions: - contents: read - -jobs: - rebase: - runs-on: ubuntu-latest - permissions: - contents: none - - # On pull requests and if the comment starts with `/update-3rdparty` - if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/update-3rdparty') - - steps: - - name: Add reaction on start - uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3.0.1 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: "+1" - - - name: Init branch - uses: xt0rted/pull-request-comment-branch@d97294d304604fa98a2600a6e2f916a84b596dc7 # v1 - id: comment-branch - - - name: Checkout ${{ steps.comment-branch.outputs.head_ref }} - uses: actions/checkout@v3 - with: - fetch-depth: 0 - token: ${{ secrets.COMMAND_BOT_PAT }} - ref: ${{ steps.comment-branch.outputs.head_ref }} - - - name: Setup git - run: | - git config --local user.email "nextcloud-command@users.noreply.github.com" - git config --local user.name "nextcloud-command" - - - name: Pull 3rdparty - run: git submodule foreach 'if [ "$sm_path" == "3rdparty" ]; then git pull origin ${{ github.event.issue.pull_request.base.ref }}; fi' - - - name: Commit and push changes - run: | - git add 3rdparty - git commit -s -m "Update submodule 3rdparty to latest ${{ github.event.issue.pull_request.base.ref }}" - git push - - - name: Add reaction on failure - uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3.0.1 - if: failure() - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: "-1" diff --git a/.github/workflows/command-rebase.yml b/.github/workflows/command-rebase.yml deleted file mode 100644 index d713df36c6d8a..0000000000000 --- a/.github/workflows/command-rebase.yml +++ /dev/null @@ -1,51 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Rebase command - -on: - issue_comment: - types: created - -permissions: - contents: read - -jobs: - rebase: - runs-on: ubuntu-latest - permissions: - contents: none - - # On pull requests and if the comment starts with `/rebase` - if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/rebase') - - steps: - - name: Add reaction on start - uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3.0.1 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reaction-type: "+1" - - - name: Checkout the latest code - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - fetch-depth: 0 - token: ${{ secrets.COMMAND_BOT_PAT }} - - - name: Automatic Rebase - uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 # 1.8 - env: - GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} - - - name: Add reaction on failure - uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3.0.1 - if: failure() - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reaction-type: "-1" diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index bc2d9937974a6..b833616b0abe8 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -13,6 +13,8 @@ env: APP_NAME: ${{ github.event.repository.name }} # Server requires head_ref instead of base_ref, as we want to test the PR branch BRANCH: ${{ github.head_ref || github.ref_name }} + # Easier to get forks refs + PR_NUMBER: ${{ github.event.number }} jobs: init: @@ -104,6 +106,7 @@ jobs: env: # Needs to be prefixed with CYPRESS_ CYPRESS_BRANCH: ${{ env.BRANCH }} + CYPRESS_PR_NUMBER: ${{ env.PR_NUMBER }} # https://github.com/cypress-io/github-action/issues/124 COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }} # Needed for some specific code workarounds diff --git a/.github/workflows/dependabot-approve-merge.yml b/.github/workflows/dependabot-approve-merge.yml deleted file mode 100644 index 9951547f76aec..0000000000000 --- a/.github/workflows/dependabot-approve-merge.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Dependabot - -on: - pull_request_target: - branches: - - main - - master - - stable* - -permissions: - contents: read - -concurrency: - group: dependabot-approve-merge-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - auto-approve-merge: - if: github.actor == 'dependabot[bot]' - runs-on: ubuntu-latest - permissions: - # for hmarr/auto-approve-action to approve PRs - pull-requests: write - - steps: - # Github actions bot approve - - uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - # Nextcloud bot approve and merge request - - uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2 - with: - target: minor - github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }} diff --git a/.github/workflows/fixup.yml b/.github/workflows/fixup.yml deleted file mode 100644 index 9548d19f2d5cd..0000000000000 --- a/.github/workflows/fixup.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Block fixup and squash commits - -on: - pull_request: - types: [opened, ready_for_review, reopened, synchronize] - -permissions: - contents: read - -concurrency: - group: fixup-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - commit-message-check: - if: github.event.pull_request.draft == false - - permissions: - pull-requests: write - name: Block fixup and squash commits - - runs-on: ubuntu-latest - - steps: - - name: Run check - uses: skjnldsv/block-fixup-merge-action@42d26e1b536ce61e5cf467d65fb76caf4aa85acf # v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ftp.yml b/.github/workflows/ftp.yml deleted file mode 100644 index c4324cdcebcab..0000000000000 --- a/.github/workflows/ftp.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: FTP unit tests -on: - push: - branches: - - master - - stable* - paths: - - 'apps/files_external/**' - pull_request: - paths: - - 'apps/files_external/**' - -env: - APP_NAME: files_external - -jobs: - ftp-tests: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - strategy: - # do not stop on another job's failure - fail-fast: false - matrix: - php-versions: ['8.0'] - ftpd: ['proftpd', 'vsftpd', 'pure-ftpd'] - - name: php${{ matrix.php-versions }}-${{ matrix.ftpd }} - - steps: - - name: Checkout server - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set up ftpd - run: | - sudo mkdir /tmp/ftp - sudo chown -R 0777 /tmp/ftp - if [[ "${{ matrix.ftpd }}" == 'proftpd' ]]; then docker run --name ftp -d --net host -e FTP_USERNAME=test -e FTP_PASSWORD=test -v /tmp/ftp:/home/test hauptmedia/proftpd; fi - if [[ "${{ matrix.ftpd }}" == 'vsftpd' ]]; then docker run --name ftp -d --net host -e FTP_USER=test -e FTP_PASS=test -e PASV_ADDRESS=127.0.0.1 -v /tmp/ftp:/home/vsftpd/test fauria/vsftpd; fi - if [[ "${{ matrix.ftpd }}" == 'pure-ftpd' ]]; then docker run --name ftp -d --net host -e "PUBLICHOST=localhost" -e FTP_USER_NAME=test -e FTP_USER_PASS=test -e FTP_USER_HOME=/home/test -v /tmp/ftp2:/home/test -v /tmp/ftp2:/etc/pure-ftpd/passwd stilliard/pure-ftpd; fi - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 - with: - php-version: ${{ matrix.php-versions }} - tools: phpunit:9 - extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Nextcloud - run: | - mkdir data - ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password - ./occ app:enable --force ${{ env.APP_NAME }} - php -S localhost:8080 & - - name: smoketest ftp - run: | - php -r 'var_dump(file_put_contents("ftp://test:test@localhost/ftp.txt", "asd"));' - php -r 'var_dump(file_get_contents("ftp://test:test@localhost/ftp.txt"));' - php -r 'var_dump(mkdir("ftp://test:test@localhost/asdads"));' - ls -l /tmp/ftp - - name: PHPUnit - run: | - echo " true,'host' => 'localhost','user' => 'test','password' => 'test', 'root' => ''];" > apps/${{ env.APP_NAME }}/tests/config.ftp.php - phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/FtpTest.php - - name: ftpd logs - if: always() - run: | - docker logs ftp - - ftp-summary: - runs-on: ubuntu-latest - needs: ftp-tests - - if: always() - - steps: - - name: Summary status - run: if ${{ needs.ftp-tests.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/lint-eslint-when-unrelated.yml b/.github/workflows/lint-eslint-when-unrelated.yml deleted file mode 100644 index c8e3f0605f949..0000000000000 --- a/.github/workflows/lint-eslint-when-unrelated.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -# -# Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions -# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks - -name: Lint eslint - -on: - pull_request: - paths-ignore: - - '.github/workflows/**' - - 'src/**' - - 'apps/**/appinfo/info.xml' - - 'package.json' - - 'package-lock.json' - - 'tsconfig.json' - - '.eslintrc.*' - - '.eslintignore' - - '**.js' - - '**.ts' - - '**.vue' - -permissions: - contents: read - -jobs: - lint: - permissions: - contents: none - - runs-on: ubuntu-latest - - name: eslint - - steps: - - run: 'echo "No eslint required"' diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml deleted file mode 100644 index f53f38666e19a..0000000000000 --- a/.github/workflows/lint-eslint.yml +++ /dev/null @@ -1,62 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -# -# Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions -# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks - -name: Lint eslint - -on: - pull_request: - paths: - - '.github/workflows/**' - - 'src/**' - - 'apps/**/appinfo/info.xml' - - 'package.json' - - 'package-lock.json' - - 'tsconfig.json' - - '.eslintrc.*' - - '.eslintignore' - - '**.js' - - '**.ts' - - '**.vue' - -permissions: - contents: read - -concurrency: - group: lint-eslint-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - lint: - runs-on: ubuntu-latest - - name: eslint - - steps: - - name: Checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.1 - id: versions - with: - fallbackNode: '^16' - fallbackNpm: '^7' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" - - - name: Install dependencies - run: npm ci - - - name: Lint - run: npm run lint diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml deleted file mode 100644 index f8d3375111fef..0000000000000 --- a/.github/workflows/lint-php-cs.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Lint php-cs - -on: pull_request - -permissions: - contents: read - -concurrency: - group: lint-php-cs-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - lint: - runs-on: ubuntu-latest - - name: php-cs - - steps: - - name: Checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - - name: Set up php - uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 - with: - php-version: 8.1 - coverage: none - ini-file: development - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Install dependencies - run: composer i - - - name: Lint - run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml deleted file mode 100644 index 8d7f63f84b46f..0000000000000 --- a/.github/workflows/lint-php.yml +++ /dev/null @@ -1,60 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Lint php - -on: - pull_request: - push: - branches: - - main - - master - - stable* - -permissions: - contents: read - -concurrency: - group: lint-php-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - php-lint: - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: [ "8.0", "8.1", "8.2" ] - - name: php-lint - - steps: - - name: Checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 - with: - php-version: ${{ matrix.php-versions }} - coverage: none - ini-file: development - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Lint - run: composer run lint - - summary: - permissions: - contents: none - runs-on: ubuntu-latest - needs: php-lint - - if: always() - - name: php-lint-summary - - steps: - - name: Summary status - run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi diff --git a/.github/workflows/node-tests.yml b/.github/workflows/node-tests.yml deleted file mode 100644 index fad74c4e3961b..0000000000000 --- a/.github/workflows/node-tests.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: Node tests - -on: - pull_request: - push: - branches: - - master - - stable* - -jobs: - versions: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - outputs: - nodeVersion: ${{ steps.versions.outputs.nodeVersion }} - npmVersion: ${{ steps.versions.outputs.npmVersion }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 - id: versions - with: - fallbackNode: '^16' - fallbackNpm: '^7' - - test: - runs-on: ubuntu-latest - needs: versions - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up node ${{ needs.versions.outputs.nodeVersion }} - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c - with: - node-version: ${{ needs.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ needs.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ needs.versions.outputs.npmVersion }}" - - - name: Install dependencies - run: npm ci - - - name: Test and process coverage - run: npm run test:coverage - - - name: Collect coverage - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 - with: - files: ./coverage/lcov.info - - jsunit: - runs-on: ubuntu-latest - needs: versions - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up node ${{ needs.versions.outputs.nodeVersion }} - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c - with: - node-version: ${{ needs.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ needs.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ needs.versions.outputs.npmVersion }}" - - - name: Install dependencies - run: npm ci - - - name: Test - run: npm run test:jsunit - - handlebars: - runs-on: ubuntu-latest - needs: versions - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up node ${{ needs.versions.outputs.nodeVersion }} - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c - with: - node-version: ${{ needs.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ needs.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ needs.versions.outputs.npmVersion }}" - - - name: Install dependencies - run: npm ci - - - name: Run compile - run: ./build/compile-handlebars-templates.sh diff --git a/.github/workflows/node-when-unrelated.yml b/.github/workflows/node-when-unrelated.yml deleted file mode 100644 index 5957422d222e1..0000000000000 --- a/.github/workflows/node-when-unrelated.yml +++ /dev/null @@ -1,43 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -# -# Use node together with node-when-unrelated to make eslint a required check for GitHub actions -# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks - -name: Node - -on: - pull_request: - paths-ignore: - - '.github/workflows/**' - - 'src/**' - - 'apps/**/appinfo/info.xml' - - 'package.json' - - 'package-lock.json' - - 'tsconfig.json' - - '**.js' - - '**.ts' - - '**.vue' - push: - branches: - - main - - master - - stable* - -concurrency: - group: node-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - build: - permissions: - contents: none - - runs-on: ubuntu-latest - - name: node - steps: - - name: Skip - run: 'echo "No JS/TS files changed, skipped Node"' diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml deleted file mode 100644 index 8a2a1d7a52fe8..0000000000000 --- a/.github/workflows/node.yml +++ /dev/null @@ -1,71 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Node - -on: - pull_request: - paths: - - '.github/workflows/**' - - 'src/**' - - 'apps/**/appinfo/info.xml' - - 'package.json' - - 'package-lock.json' - - 'tsconfig.json' - - '**.js' - - '**.ts' - - '**.vue' - push: - branches: - - main - - master - - stable* - -permissions: - contents: read - -concurrency: - group: node-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - - name: node - steps: - - name: Checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.1 - id: versions - with: - fallbackNode: '^16' - fallbackNpm: '^7' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" - - - name: Install dependencies & build - run: | - npm ci - npm run build --if-present - - - name: Check webpack build changes - run: | - bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)" - - - name: Show changes on failure - if: failure() - run: | - git status - git --no-pager diff - exit 1 # make it red to grab attention diff --git a/.github/workflows/npm-audit-fix.yml b/.github/workflows/npm-audit-fix.yml deleted file mode 100644 index 4aa628efaf45a..0000000000000 --- a/.github/workflows/npm-audit-fix.yml +++ /dev/null @@ -1,71 +0,0 @@ -# This workflow is provided via the organization template repository -# -# https://github.com/nextcloud/.github -# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization - -name: Npm audit fix and compile - -on: - workflow_dispatch: - schedule: - # At 2:30 on Sundays - - cron: '30 2 * * 0' - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - branches: ["main", "master", "stable27", "stable26", "stable25", "stable24"] - - name: npm-audit-fix-${{ matrix.branches }} - - steps: - - name: Checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - with: - ref: ${{ matrix.branches }} - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.1 - id: versions - with: - fallbackNode: '^16' - fallbackNpm: '^7' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" - - - name: Fix npm audit - run: | - npm audit fix - - - name: Run npm ci and npm run build - if: always() - run: | - npm ci - npm run build --if-present - - - name: Create Pull Request - if: always() - uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v5 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - commit-message: "chore(deps): fix npm audit" - committer: GitHub - author: nextcloud-command - signoff: true - branch: automated/noid/${{ matrix.branches }}-fix-npm-audit - title: "[${{ matrix.branches }}] Fix npm audit" - body: | - Auto-generated fix of npm audit - labels: | - dependencies - 3. to review diff --git a/.github/workflows/oci.yml b/.github/workflows/oci.yml deleted file mode 100644 index 56c03ba534c9a..0000000000000 --- a/.github/workflows/oci.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: PHPUnit oci - -on: pull_request - -permissions: - contents: read - -concurrency: - group: phpunit-oci-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - phpunit-oci: - runs-on: ubuntu-20.04 - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - strategy: - matrix: - php-versions: ['8.0', '8.1', '8.2'] - - services: - oracle: - image: ghcr.io/gvenzl/oracle-xe:11 - - # Provide passwords and other environment variables to container - env: - ORACLE_RANDOM_PASSWORD: true - APP_USER: autotest - APP_USER_PASSWORD: owncloud - - # Forward Oracle port - ports: - - 1521:1521/tcp - - # Provide healthcheck script options for startup - options: >- - --health-cmd healthcheck.sh - --health-interval 10s - --health-timeout 5s - --health-retries 10 - - steps: - - name: Checkout server - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 - with: - php-version: ${{ matrix.php-versions }} - extensions: ctype, curl, dom, fileinfo, gd, imagick, intl, json, mbstring, oci8, openssl, pcntl, pdo_sqlite, posix, sqlite, xml, zip - tools: phpunit:9 - coverage: none - ini-file: development - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Nextcloud - run: | - mkdir data - ./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=1521 --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin - php -f index.php - - - name: PHPUnit - working-directory: tests - run: phpunit --configuration phpunit-autotest.xml --group DB,SLOWDB - - - name: Run repair steps - run: | - ./occ maintenance:repair --include-expensive - - summary: - permissions: - contents: none - runs-on: ubuntu-latest - needs: phpunit-oci - - if: always() - - name: phpunit-oci-summary - - steps: - - name: Summary status - run: if ${{ needs.phpunit-oci.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/openapi.yml b/.github/workflows/openapi.yml deleted file mode 100644 index aa149e6a7fcaf..0000000000000 --- a/.github/workflows/openapi.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: OpenAPI - -on: - pull_request: - push: - branches: - - master - - stable* - -jobs: - openapi: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up php - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - extensions: xml - coverage: none - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Composer install - run: composer i - - - name: OpenAPI checker - run: build/openapi-checker.sh diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml deleted file mode 100644 index b545e265e46e9..0000000000000 --- a/.github/workflows/performance.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: Performance testing -on: - pull_request: - -jobs: - performance-testing: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - strategy: - fail-fast: false - matrix: - php-versions: ['8.0'] - - name: performance-${{ matrix.php-versions }} - - steps: - - name: Checkout server before PR - uses: actions/checkout@v3 - with: - submodules: true - ref: ${{ github.event.pull_request.base.ref }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 - with: - php-version: ${{ matrix.php-versions }} - tools: phpunit:9 - extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Nextcloud - run: | - mkdir data - ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password - - php -S localhost:8080 & - - name: Apply blueprint - uses: icewind1991/blueprint@v0.1.2 - with: - blueprint: tests/blueprints/basic.toml - ref: ${{ github.event.pull_request.head.ref }} - - name: Run before measurements - uses: nextcloud/profiler@1e66a9de5f76a01e9d1db4f0153bcc1cbf989b3d - with: - run: | - curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test - curl -s -u test:test http://localhost:8080/remote.php/dav/files/test/test.txt - curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test/many_files - curl -s -u test:test -T README.md http://localhost:8080/remote.php/dav/files/test/new_file.txt - curl -s -u test:test -X DELETE http://localhost:8080/remote.php/dav/files/test/new_file.txt - output: before.json - profiler-branch: master - - - name: Apply PR - run: | - git remote add pr ${{ github.event.pull_request.head.repo.clone_url }} - git fetch pr ${{ github.event.pull_request.head.ref }} - git checkout -b pr/${{ github.event.pull_request.head.ref }} - git submodule update - - ./occ upgrade - - - name: Run after measurements - id: compare - uses: nextcloud/profiler@1e66a9de5f76a01e9d1db4f0153bcc1cbf989b3d - with: - run: | - curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test - curl -s -u test:test http://localhost:8080/remote.php/dav/files/test/test.txt - curl -s -X PROPFIND -u test:test http://localhost:8080/remote.php/dav/files/test/many_files - curl -s -u test:test -T README.md http://localhost:8080/remote.php/dav/files/test/new_file.txt - curl -s -u test:test -X DELETE http://localhost:8080/remote.php/dav/files/test/new_file.txt - output: after.json - profiler-branch: master - compare-with: before.json - - - name: Upload profiles - if: always() - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce - with: - name: profiles - path: | - before.json - after.json - - - uses: actions/github-script@v6 - if: failure() && steps.compare.outcome == 'failure' - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - let comment = `Possible performance regression detected\n`; - comment += `
Show Output - - \`\`\` - ${{ steps.compare.outputs.compare }} - \`\`\` - -
`; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment - }) diff --git a/.github/workflows/phpunit-32bits.yml b/.github/workflows/phpunit-32bits.yml deleted file mode 100644 index 0ed52fe3d9760..0000000000000 --- a/.github/workflows/phpunit-32bits.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: PHPUnit 32bits - -on: - pull_request: - paths: - - 'version.php' - - '.github/workflows/phpunit-32bits.yml' - workflow_dispatch: - schedule: - - cron: "15 1 * * 1-6" - -permissions: - contents: read - -concurrency: - group: phpunit-32bits-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - phpunit-32bits: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - container: shivammathur/node:latest-i386 - - strategy: - matrix: - php-versions: ['8.0'] - - steps: - - name: Checkout server - uses: actions/checkout@v3 - with: - submodules: true - - - name: Install tools - run: | - sudo apt-get update - sudo apt-get install -y ffmpeg imagemagick libmagickcore-6.q16-3-extra - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@9c77701ae57b0c47f6732beebfbdec76e4e5c90a #debian bookworm fix - with: - php-version: ${{ matrix.php-versions }} - extensions: ctype, curl, dom, fileinfo, gd, imagick, intl, json, mbstring, openssl, pdo_sqlite, posix, sqlite, xml, zip, apcu - tools: phpunit:9 - coverage: none - ini-values: - apc.enabled=on, - apc.enable_cli=on - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Nextcloud - env: - DB_PORT: 4444 - run: | - mkdir data - ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=rootpassword --admin-user admin --admin-pass admin - php -f index.php - - - name: PHPUnit - working-directory: tests - run: phpunit --configuration phpunit-autotest.xml --exclude-group PRIMARY-azure,PRIMARY-s3,PRIMARY-swift,Memcached,Redis,RoutingWeirdness diff --git a/.github/workflows/pr-feedback.yml b/.github/workflows/pr-feedback.yml deleted file mode 100644 index ea40f79433618..0000000000000 --- a/.github/workflows/pr-feedback.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: 'Ask for feedback on PRs' -on: - schedule: - - cron: '30 1 * * *' - -jobs: - pr-feedback: - runs-on: ubuntu-22.04 - steps: - - name: The get-github-handles-from-website action - uses: marcelklehr/get-github-handles-from-website-action@a739600f6b91da4957f51db0792697afbb2f143c # v1.0.0 - id: scrape - with: - website: 'https://nextcloud.com/team/' - - uses: marcelklehr/pr-feedback-action@601109aa729eb4c8d6d0ece7567b9d4901db4aef - with: - feedback-message: | - Hello there, - Thank you so much for taking the time and effort to create a pull request to our Nextcloud project. - - We hope that the reviewing process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR reviewing process. - - Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 - - Thank you for contributing to Nextcloud and we hope to hear from you soon! - days-before-feedback: 14 - start-date: "2023-07-10" - exempt-authors: "${{ steps.scrape.outputs.users }}" - exempt-bots: true diff --git a/.github/workflows/s3-external.yml b/.github/workflows/s3-external.yml deleted file mode 100644 index b77f19230ab5a..0000000000000 --- a/.github/workflows/s3-external.yml +++ /dev/null @@ -1,132 +0,0 @@ -name: S3 External storage -on: - push: - branches: - - master - - stable* - paths: - - 'apps/files_external/**' - pull_request: - paths: - - 'apps/files_external/**' - -env: - APP_NAME: files_external - -jobs: - s3-external-tests-minio: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - strategy: - # do not stop on another job's failure - fail-fast: false - matrix: - php-versions: ['8.0', '8.1'] - - name: php${{ matrix.php-versions }}-minio - - services: - minio: - env: - MINIO_ACCESS_KEY: minio - MINIO_SECRET_KEY: minio123 - image: bitnami/minio:2021.10.6 - ports: - - "9000:9000" - - steps: - - name: Checkout server - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 - with: - php-version: ${{ matrix.php-versions }} - tools: phpunit:9 - extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Nextcloud - run: | - mkdir data - ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password - ./occ app:enable --force ${{ env.APP_NAME }} - php -S localhost:8080 & - - name: PHPUnit - run: | - echo " true, 'secret' => 'actually-not-secret', 'passwordsalt' => 'actually-not-secret', 'hostname' => 'localhost','key' => 'minio','secret' => 'minio123', 'bucket' => 'bucket', 'port' => 9000, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/${{ env.APP_NAME }}/tests/config.amazons3.php - phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/Amazons3Test.php - phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/VersionedAmazonS3Test.php - - name: S3 logs - if: always() - run: | - docker ps -a - docker logs $(docker ps -aq) - s3-external-tests-localstack: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - strategy: - # do not stop on another job's failure - fail-fast: false - matrix: - php-versions: ['8.0', '8.1'] - - name: php${{ matrix.php-versions }}-localstack - - services: - minio: - env: - SERVICES: s3 - DEBUG: 1 - image: localstack/localstack:0.12.7 - ports: - - "4566:4566" - - steps: - - name: Checkout server - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 - with: - php-version: ${{ matrix.php-versions }} - tools: phpunit:9 - extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Nextcloud - run: | - mkdir data - ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password - ./occ app:enable --force ${{ env.APP_NAME }} - php -S localhost:8080 & - - name: PHPUnit - run: | - echo " true,'hostname' => 'localhost','key' => 'ignored','secret' => 'ignored', 'bucket' => 'bucket', 'port' => 4566, 'use_ssl' => false, 'autocreate' => true, 'use_path_style' => true];" > apps/${{ env.APP_NAME }}/tests/config.amazons3.php - phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/Amazons3Test.php - phpunit --configuration tests/phpunit-autotest-external.xml apps/files_external/tests/Storage/VersionedAmazonS3Test.php - - name: S3 logs - if: always() - run: | - docker ps -a - docker logs $(docker ps -aq) - - s3-external-summary: - runs-on: ubuntu-latest - needs: [s3-external-tests-minio, s3-external-tests-localstack] - - if: always() - - steps: - - name: Summary status - run: if ${{ needs.s3-external-tests-minio.result != 'success' }} || ${{ needs.s3-external-tests-localstack.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/s3-primary-integration.yml b/.github/workflows/s3-primary-integration.yml deleted file mode 100644 index 7d12f1a584bdb..0000000000000 --- a/.github/workflows/s3-primary-integration.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: S3 primary storage integration tests -on: - pull_request: - push: - branches: - - master - - stable* - -jobs: - s3-primary-integration-tests-minio: - runs-on: ubuntu-20.04 - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - strategy: - # do not stop on another job's failure - fail-fast: false - matrix: - php-versions: ['8.0'] - key: ['objectstore', 'objectstore_multibucket'] - - name: php${{ matrix.php-versions }}-${{ matrix.key }}-minio - - services: - redis: - image: redis - ports: - - "6379:6379" - minio: - env: - MINIO_ACCESS_KEY: minio - MINIO_SECRET_KEY: minio123 - image: bitnami/minio:2021.12.29 - ports: - - "9000:9000" - - steps: - - name: Checkout server - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 - with: - php-version: ${{ matrix.php-versions }} - tools: phpunit:9 - extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, redis - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Wait for S3 - run: | - sleep 10 - curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready - - - name: Set up Nextcloud - run: | - mkdir data - echo ' ["class" => "OC\Files\ObjectStore\S3", "arguments" => ["bucket" => "nextcloud", "autocreate" => true, "key" => "minio", "secret" => "minio123", "hostname" => "localhost", "port" => 9000, "use_ssl" => false, "use_path_style" => true, "uploadPartSize" => 52428800]]];' > config/config.php - echo ' ["host" => "localhost", "port" => 6379], "memcache.local" => "\OC\Memcache\Redis", "memcache.distributed" => "\OC\Memcache\Redis"];' > config/redis.config.php - ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin - php -f index.php - - - name: Integration - run: | - cd build/integration - bash run.sh --tags "~@failure-s3" features/webdav-related.feature - - - name: S3 logs - if: always() - run: | - cat data/nextcloud.log - docker ps -a - docker ps -aq | while read container ; do IMAGE=$(docker inspect --format='{{.Config.Image}}' $container); echo $IMAGE; docker logs $container; echo "\n\n" ; done - - - s3-primary-integration-summary: - runs-on: ubuntu-latest - needs: [s3-primary-integration-tests-minio] - - if: always() - - steps: - - name: Summary status - run: if ${{ needs.s3-primary-integration-tests-minio.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/s3-primary.yml b/.github/workflows/s3-primary.yml deleted file mode 100644 index 21f6219e1f782..0000000000000 --- a/.github/workflows/s3-primary.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: S3 primary storage -on: - pull_request: - push: - branches: - - master - - stable* - -jobs: - s3-primary-tests-minio: - runs-on: ubuntu-20.04 - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - strategy: - # do not stop on another job's failure - fail-fast: false - matrix: - php-versions: ['8.0'] - key: ['objectstore', 'objectstore_multibucket'] - - name: php${{ matrix.php-versions }}-${{ matrix.key }}-minio - - services: - minio: - env: - MINIO_ACCESS_KEY: minio - MINIO_SECRET_KEY: minio123 - image: bitnami/minio:2021.12.29 - ports: - - "9000:9000" - - steps: - - name: Checkout server - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2 - with: - php-version: ${{ matrix.php-versions }} - tools: phpunit:9 - extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Nextcloud - run: | - mkdir data - echo ' ["class" => "OC\Files\ObjectStore\S3", "arguments" => ["bucket" => "nextcloud", "autocreate" => true, "key" => "minio", "secret" => "minio123", "hostname" => "localhost", "port" => 9000, "use_ssl" => false, "use_path_style" => true, "uploadPartSize" => 52428800]]];' > config/config.php - ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password - php -f index.php - - - name: Wait for S3 - run: | - sleep 10 - curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready - - - name: PHPUnit - working-directory: tests - run: phpunit --configuration phpunit-autotest.xml --group DB,SLOWDB - - name: S3 logs - if: always() - run: | - docker ps -a - docker logs $(docker ps -aq) - - - s3-primary-summary: - runs-on: ubuntu-latest - needs: [s3-primary-tests-minio] - - if: always() - - steps: - - name: Summary status - run: if ${{ needs.s3-primary-tests-minio.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/smb-kerberos.yml b/.github/workflows/smb-kerberos.yml deleted file mode 100644 index c069d665a6ae6..0000000000000 --- a/.github/workflows/smb-kerberos.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: Samba Kerberos SSO -on: - push: - branches: - - master - - stable* - paths: - - 'apps/files_external/**' - - '.github/workflows/smb-kerberos.yml' - pull_request: - paths: - - 'apps/files_external/**' - - '.github/workflows/smb-kerberos.yml' - -jobs: - smb-kerberos-tests: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - name: smb-kerberos-sso - - steps: - - name: Checkout server - uses: actions/checkout@v3 - with: - submodules: true - - name: Pull images - run: | - docker pull icewind1991/samba-krb-test-dc - docker pull icewind1991/samba-krb-test-apache - docker pull icewind1991/samba-krb-test-client - - name: Setup AD-DC - run: | - cp apps/files_external/tests/*.sh . - mkdir data - sudo chown -R 33 data apps config - DC_IP=$(./start-dc.sh) - ./start-apache.sh $DC_IP $PWD - echo "DC_IP=$DC_IP" >> $GITHUB_ENV - - name: Set up Nextcloud - run: | - docker exec --user 33 apache ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password - docker exec --user 33 apache ./occ config:system:set trusted_domains 1 --value 'httpd.domain.test' - - # setup user_saml - docker exec --user 33 apache ./occ app:enable user_saml --force - docker exec --user 33 apache ./occ config:app:set user_saml type --value 'environment-variable' - docker exec --user 33 apache ./occ saml:config:create - docker exec --user 33 apache ./occ saml:config:set 1 --general-uid_mapping=REMOTE_USER - - # setup external storage - docker exec --user 33 apache ./occ app:enable files_external --force - docker exec --user 33 apache ./occ files_external:create smb smb smb::kerberosapache - docker exec --user 33 apache ./occ files_external:config 1 host krb.domain.test - docker exec --user 33 apache ./occ files_external:config 1 share netlogon - docker exec --user 33 apache ./occ files_external:list - - name: Test SSO - run: | - mkdir /tmp/shared/cookies - chmod 0777 /tmp/shared/cookies - - echo "SAML login" - ./client-cmd.sh ${{ env.DC_IP }} curl -c /shared/cookies/jar -s --negotiate -u testuser@DOMAIN.TEST: --delegation always http://httpd.domain.test/index.php/apps/user_saml/saml/login - echo "Check we are logged in" - CONTENT=$(./client-cmd.sh ${{ env.DC_IP }} curl -b /shared/cookies/jar -s --negotiate -u testuser@DOMAIN.TEST: --delegation always http://httpd.domain.test/remote.php/webdav/smb/test.txt) - CONTENT=$(echo $CONTENT | head -n 1 | tr -d '[:space:]') - [[ $CONTENT == "testfile" ]] - - name: Show logs - if: failure() - run: | - docker exec --user 33 apache ./occ log:file - FILEPATH=$(docker exec --user 33 apache ./occ log:file | grep "Log file:" | cut -d' ' -f3) - docker exec --user 33 apache cat $FILEPATH diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 7016f5108a676..0000000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Close stale issues - -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * *" - -jobs: - stale: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - permissions: - issues: write - - steps: - - uses: actions/stale@v8 - with: - repo-token: ${{ secrets.COMMAND_BOT_PAT }} - stale-issue-message: > - This issue has been automatically marked as stale because it has not had - recent activity and seems to be missing some essential information. - It will be closed if no further activity occurs. Thank you - for your contributions. - stale-issue-label: 'stale' - only-labels: 'needs info' - labels-to-remove-when-unstale: 'needs info,stale' - exempt-issue-labels: '1. to develop,2. developing,3. to review,4. to release,security' - days-before-stale: 30 - days-before-close: 14 - # debug-only: true - diff --git a/.github/workflows/static-code-analysis.yml b/.github/workflows/static-code-analysis.yml deleted file mode 100644 index 22a1a69a977f2..0000000000000 --- a/.github/workflows/static-code-analysis.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: Psalm static code analysis - -on: - pull_request: - push: - branches: - - master - - stable* - -jobs: - static-code-analysis: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set up php - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - extensions: apcu,ctype,curl,dom,fileinfo,ftp,gd,intl,json,ldap,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip - coverage: none - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Composer install - run: composer i - - - name: Psalm - run: composer run psalm:ci -- --monochrome --no-progress --output-format=github --update-baseline --report=results.sarif - - - name: Show potential changes in Psalm baseline - if: always() - run: git diff -- . ':!lib/composer' - - - name: Upload Analysis results to GitHub - if: always() - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: results.sarif - - static-code-analysis-security: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set up php - uses: shivammathur/setup-php@master - with: - php-version: '8.0' - extensions: ctype,curl,dom,fileinfo,ftp,gd,intl,json,ldap,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip - coverage: none - - - name: Composer install - run: composer i - - - name: Psalm taint analysis - run: composer run psalm:ci -- --monochrome --no-progress --output-format=github --report=results.sarif --taint-analysis - - - name: Upload Security Analysis results to GitHub - if: always() - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: results.sarif - - static-code-analysis-ocp: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set up php - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip - coverage: none - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Composer install - run: composer i - - - name: Psalm - run: composer run psalm:ci -- -c psalm-ocp.xml --monochrome --no-progress --output-format=github --update-baseline - - - name: Show potential changes in Psalm baseline - if: always() - run: git diff -- . ':!lib/composer' diff --git a/.github/workflows/update-cacert-bundle.yml b/.github/workflows/update-cacert-bundle.yml deleted file mode 100644 index 72c72f940ccb7..0000000000000 --- a/.github/workflows/update-cacert-bundle.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Update CA certificate bundle - -on: - workflow_dispatch: - schedule: - - cron: "5 2 * * *" - -jobs: - update-ca-certificate-bundle: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - branches: ["master", "stable27", "stable26", "stable25", "stable24", "stable23", "stable22"] - - name: update-ca-certificate-bundle-${{ matrix.branches }} - - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ matrix.branches }} - submodules: true - - - name: Download CA certificate bundle from curl - run: curl --etag-compare build/ca-bundle-etag.txt --etag-save build/ca-bundle-etag.txt --output resources/config/ca-bundle.crt https://curl.se/ca/cacert.pem - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - commit-message: "fix(security): Update CA certificate bundle" - committer: GitHub - author: nextcloud-command - signoff: true - branch: automated/noid/${{ matrix.branches }}-update-ca-cert-bundle - title: "[${{ matrix.branches }}] fix(security): Update CA certificate bundle" - body: | - Auto-generated update of CA certificate bundle from [https://curl.se/docs/caextract.html](https://curl.se/docs/caextract.html) - labels: | - dependencies - 3. to review diff --git a/.github/workflows/update-psalm-baseline.yml b/.github/workflows/update-psalm-baseline.yml deleted file mode 100644 index 20056b456315c..0000000000000 --- a/.github/workflows/update-psalm-baseline.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Update Psalm baseline - -on: - workflow_dispatch: - schedule: - - cron: "5 2 * * *" - -jobs: - update-psalm-baseline: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - strategy: - fail-fast: false - matrix: - branches: ["master", "stable27", "stable26", "stable25"] - - name: update-psalm-baseline-${{ matrix.branches }} - - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ matrix.branches }} - submodules: true - - - name: Set up php - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip - coverage: none - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Composer install - run: composer install - - - name: Psalm - run: composer run psalm -- --monochrome --no-progress --output-format=text --update-baseline - continue-on-error: true - - - name: Psalm OCP - run: composer run psalm -- -c psalm-ocp.xml --monochrome --no-progress --output-format=github --update-baseline - continue-on-error: true - - - name: Reset composer - run: | - git clean -f lib/composer - git checkout composer.json composer.lock lib/composer - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - commit-message: Update psalm baseline - committer: GitHub - author: nextcloud-command - signoff: true - branch: automated/noid/${{ matrix.branches }}-update-psalm-baseline - title: "[${{ matrix.branches }}] Update psalm-baseline.xml" - body: | - Auto-generated update psalm-baseline.xml with fixed psalm warnings - labels: | - automated pr - 3. to review - team-reviewers: server-backend diff --git a/cypress.config.ts b/cypress.config.ts index 4f15c9a2a2328..c3d3d337199aa 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -4,6 +4,7 @@ import { startNextcloud, stopNextcloud, waitOnNextcloud, + gitPullRef, } from './cypress/dockerNode' import { defineConfig } from 'cypress' import webpackPreprocessor from '@cypress/webpack-preprocessor' @@ -83,6 +84,7 @@ export default defineConfig({ return ip }) .then(waitOnNextcloud) + .then(() => gitPullRef(process.env.PR_NUMBER))) .then(configureNextcloud) .then(applyChangesToNextcloud) .then(() => { diff --git a/cypress/dockerNode.ts b/cypress/dockerNode.ts index af5619bbf806d..72edef17ea7f3 100644 --- a/cypress/dockerNode.ts +++ b/cypress/dockerNode.ts @@ -108,12 +108,23 @@ export const startNextcloud = async function(branch: string = getCurrentGitBranc } } +export const gitPullRef = async function(prNumber: string) { + if (!prNumber) { + console.log('\nNo PR ref to pull...') + return + } + + console.log('\nPulling PR ref...') + const container = docker.getContainer(CONTAINER_NAME) + await runExec(container, ['git', 'checkout', 'https://github.com/nextcloud/server/pull/' + prNumber], true) + console.log('└─ Successfully pulled PR ref' + prNumber) +} + /** * Configure Nextcloud */ export const configureNextcloud = async function() { console.log('\nConfiguring nextcloud...') - const container = docker.getContainer(CONTAINER_NAME) await runExec(container, ['php', 'occ', '--version'], true) // Be consistent for screenshots diff --git a/lib/private/Updater.php b/lib/private/Updater.php index 5a14bb1750779..3bdc667e581b4 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -48,6 +48,7 @@ use OCP\ILogger; use OCP\Util; use OC\App\AppManager; +use OC\App\AppStore\Fetcher\AppFetcher; use OC\DB\Connection; use OC\DB\MigrationService; use OC\DB\MigratorExecuteSqlEvent; @@ -272,7 +273,7 @@ private function doUpgrade(string $currentVersion, string $installedVersion): vo $this->doAppUpgrade(); // Update the appfetchers version so it downloads the correct list from the appstore - \OC::$server->getAppFetcher()->setVersion($currentVersion); + \OC::$server->get(AppFetcher::class)->setVersion($currentVersion); /** @var AppManager $appManager */ $appManager = \OC::$server->getAppManager(); diff --git a/tests/lib/InstallerTest.php b/tests/lib/InstallerTest.php index 60c8ac1cc947a..2e68e0de2fc62 100644 --- a/tests/lib/InstallerTest.php +++ b/tests/lib/InstallerTest.php @@ -51,7 +51,7 @@ protected function setUp(): void { $this->appstore = $config->setSystemValue('appstoreenabled', true); $config->setSystemValue('appstoreenabled', true); $installer = new Installer( - \OC::$server->getAppFetcher(), + \OC::$server->get(AppFetcher::class), \OC::$server->getHTTPClientService(), \OC::$server->getTempManager(), \OC::$server->get(LoggerInterface::class), @@ -74,7 +74,7 @@ protected function getInstaller() { protected function tearDown(): void { $installer = new Installer( - \OC::$server->getAppFetcher(), + \OC::$server->get(AppFetcher::class), \OC::$server->getHTTPClientService(), \OC::$server->getTempManager(), \OC::$server->get(LoggerInterface::class), @@ -98,7 +98,7 @@ public function testInstallApp() { // Install app $installer = new Installer( - \OC::$server->getAppFetcher(), + \OC::$server->get(AppFetcher::class), \OC::$server->getHTTPClientService(), \OC::$server->getTempManager(), \OC::$server->get(LoggerInterface::class),