diff --git a/.github/workflows/appstore-build-publish.yml b/.github/workflows/appstore-build-publish.yml index eec59474..84dd91f1 100644 --- a/.github/workflows/appstore-build-publish.yml +++ b/.github/workflows/appstore-build-publish.yml @@ -32,7 +32,7 @@ jobs: echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: Checkout - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: path: ${{ env.APP_NAME }} diff --git a/.github/workflows/litmus.yml b/.github/workflows/litmus.yml index aa98e225..be5056b9 100644 --- a/.github/workflows/litmus.yml +++ b/.github/workflows/litmus.yml @@ -20,7 +20,7 @@ jobs: matrix: php-versions: ['8.0'] databases: ['mysql'] - server-versions: ['master'] + server-versions: ['stable24', 'stable25', 'stable26', 'stable27'] name: litmus ${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 3e65ffab..fd410ba8 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -20,7 +20,7 @@ jobs: matrix: php-versions: ['8.0', '8.1', '8.2'] databases: ['sqlite', 'mysql', 'pgsql'] - server-versions: ['master'] + server-versions: ['stable27'] name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} diff --git a/.github/workflows/pr-feedback.yml b/.github/workflows/pr-feedback.yml index 5976f560..e85c4ecd 100644 --- a/.github/workflows/pr-feedback.yml +++ b/.github/workflows/pr-feedback.yml @@ -1,3 +1,8 @@ +# 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: 'Ask for feedback on PRs' on: schedule: @@ -5,7 +10,7 @@ on: jobs: pr-feedback: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: The get-github-handles-from-website action uses: marcelklehr/get-github-handles-from-website-action@a739600f6b91da4957f51db0792697afbb2f143c # v1.0.0 @@ -25,5 +30,5 @@ jobs: 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 }},nextcloud-command" + exempt-authors: "${{ steps.scrape.outputs.users }},nextcloud-command,nextcloud-android-bot,skjnldsv" exempt-bots: true diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index a320d81e..4ae59ed9 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ocp-version: [ 'dev-master' ] + ocp-version: [ 'dev-stable27', 'dev-stable25', 'dev-stable26' ] name: Nextcloud ${{ matrix.ocp-version }} steps: - name: Checkout @@ -22,11 +22,11 @@ jobs: uses: shivammathur/setup-php@2.18.1 with: php-version: 8.0 - tools: composer:v1 + tools: composer coverage: none - name: Install dependencies run: composer i - name: Install dependencies - run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }} + run: composer require --dev nextcloud/ocp:${{ matrix.ocp-version }} --ignore-platform-reqs -W - name: Run coding standards check run: composer run psalm diff --git a/.github/workflows/update-nextcloud-ocp.yml b/.github/workflows/update-nextcloud-ocp.yml index e40744d3..908eedb0 100644 --- a/.github/workflows/update-nextcloud-ocp.yml +++ b/.github/workflows/update-nextcloud-ocp.yml @@ -22,13 +22,16 @@ jobs: name: update-nextcloud-ocp-${{ matrix.branches }} steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - id: checkout + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: ref: ${{ matrix.branches }} submodules: true + continue-on-error: true - name: Set up php8.1 - uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 + if: steps.checkout.outcome == 'success' + uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2 with: php-version: 8.1 # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation @@ -37,37 +40,67 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Read codeowners + if: steps.checkout.outcome == 'success' + id: codeowners + run: | + grep '/appinfo/info.xml' .github/CODEOWNERS | cut -f 2- -d ' ' | xargs | awk '{ print "codeowners="$0 }' >> $GITHUB_OUTPUT + continue-on-error: true + - name: Composer install + if: steps.checkout.outcome == 'success' run: composer install - name: Composer update nextcloud/ocp - if: matrix.branches != 'main' + id: update_branch + if: ${{ steps.checkout.outcome == 'success' && matrix.branches != 'main' }} run: composer require --dev nextcloud/ocp:dev-${{ matrix.branches }} + - name: Raise on issue on failure + uses: dacbd/create-issue-action@ba4d1c45cccf9c483f2720cefb40e437f0ee6f7d # v1.2.1 + if: ${{ steps.checkout.outcome == 'success' && failure() && steps.update_branch.conclusion == 'failure' }} + with: + token: ${{ secrets.GITHUB_TOKEN }} + title: Failed to update nextcloud/ocp package on branch ${{ matrix.branches }} + body: Please check the output of the GitHub action and manually resolve the issues
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ steps.codeowners.outputs.codeowners }} + - name: Composer update nextcloud/ocp - if: matrix.branches == 'main' + id: update_main + if: ${{ steps.checkout.outcome == 'success' && matrix.branches == 'main' }} run: composer require --dev nextcloud/ocp:dev-master + - name: Raise on issue on failure + uses: dacbd/create-issue-action@ba4d1c45cccf9c483f2720cefb40e437f0ee6f7d # v1.2.1 + if: ${{ steps.checkout.outcome == 'success' && failure() && steps.update_main.conclusion == 'failure' }} + with: + token: ${{ secrets.GITHUB_TOKEN }} + title: Failed to update nextcloud/ocp package on branch ${{ matrix.branches }} + body: Please check the output of the GitHub action and manually resolve the issues
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ steps.codeowners.outputs.codeowners }} + - name: Reset checkout 3rdparty + if: steps.checkout.outcome == 'success' run: | git clean -f 3rdparty git checkout 3rdparty continue-on-error: true - name: Reset checkout vendor + if: steps.checkout.outcome == 'success' run: | git clean -f vendor git checkout vendor continue-on-error: true - name: Reset checkout vendor-bin + if: steps.checkout.outcome == 'success' run: | git clean -f vendor-bin git checkout vendor-bin continue-on-error: true - name: Create Pull Request - uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v3 + if: steps.checkout.outcome == 'success' + uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v3 with: token: ${{ secrets.COMMAND_BOT_PAT }} commit-message: "chore(dev-deps): Bump nextcloud/ocp package" diff --git a/composer.json b/composer.json index d38ce466..6551b902 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "nextcloud/coding-standard": "^1.0", "psalm/phar": "^5.2", "sabre/dav": "^4.3", - "nextcloud/ocp": "dev-master" + "nextcloud/ocp": "dev-stable25" }, "config": { "platform": { diff --git a/composer.lock b/composer.lock index 5d059b33..9b3b7dd0 100644 --- a/composer.lock +++ b/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": "727f94b5da348fb237d9d93f4751680f", + "content-hash": "7aa07b89c5d35d4c0092cbc76f91738a", "packages": [], "packages-dev": [ { @@ -179,26 +179,24 @@ }, { "name": "nextcloud/ocp", - "version": "dev-master", + "version": "dev-stable25", "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "1aaead8ad471e72441257d41fb15eb55ea174d00" + "reference": "94192422c97feb772526ad46eeaf918a31c518d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/1aaead8ad471e72441257d41fb15eb55ea174d00", - "reference": "1aaead8ad471e72441257d41fb15eb55ea174d00", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/94192422c97feb772526ad46eeaf918a31c518d6", + "reference": "94192422c97feb772526ad46eeaf918a31c518d6", "shasum": "" }, "require": { "php": "^7.4 || ~8.0 || ~8.1", - "psr/clock": "^1.0", "psr/container": "^1.1.1", "psr/event-dispatcher": "^1.0", "psr/log": "^1.1" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { @@ -218,9 +216,9 @@ "description": "Composer package containing Nextcloud's public API (classes, interfaces)", "support": { "issues": "https://github.com/nextcloud-deps/ocp/issues", - "source": "https://github.com/nextcloud-deps/ocp/tree/master" + "source": "https://github.com/nextcloud-deps/ocp/tree/stable25" }, - "time": "2023-01-11T00:37:34+00:00" + "time": "2023-10-10T00:31:16+00:00" }, { "name": "nikic/php-parser", @@ -898,54 +896,6 @@ }, "time": "2023-08-21T03:20:52+00:00" }, - { - "name": "psr/clock", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/clock.git", - "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", - "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Clock\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for reading the clock.", - "homepage": "https://github.com/php-fig/clock", - "keywords": [ - "clock", - "now", - "psr", - "psr-20", - "time" - ], - "support": { - "issues": "https://github.com/php-fig/clock/issues", - "source": "https://github.com/php-fig/clock/tree/1.0.0" - }, - "time": "2022-11-25T14:36:26+00:00" - }, { "name": "psr/container", "version": "1.1.2", @@ -2568,5 +2518,5 @@ "platform-overrides": { "php": "7.4" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/lib/Service/LockService.php b/lib/Service/LockService.php index 7adabe9b..6540e24a 100644 --- a/lib/Service/LockService.php +++ b/lib/Service/LockService.php @@ -132,6 +132,7 @@ public function getLockForNodeIds(array $nodeIds): array { $locks[$nodeId] = $this->lockCache[$nodeId]; } else { $locksToRequest[] = $nodeId; + $this->lockCache[$nodeId] = false; } } if (count($locksToRequest) === 0) { @@ -144,10 +145,10 @@ public function getLockForNodeIds(array $nodeIds): array { } $newLocks = array_merge(...$newLocks); + $expiredLocks = []; foreach ($newLocks as $lock) { if ($lock->getETA() === 0) { - // TODO batch remove - $this->locksRequest->delete($lock); + $expiredLocks[] = $lock->getId(); $locks[$lock->getFileId()] = false; $this->lockCache[$lock->getFileId()] = false; } else { @@ -156,6 +157,10 @@ public function getLockForNodeIds(array $nodeIds): array { } } + if (count($expiredLocks) > 0) { + $this->locksRequest->removeIds($expiredLocks); + } + return $locks; }