From 28d44226c0cc7e3e422e2468d32e48beba7c82ed Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Thu, 20 Mar 2025 00:41:34 +0000 Subject: [PATCH 01/15] Fix(l10n): Update translations from Transifex Signed-off-by: Nextcloud bot --- l10n/et_EE.js | 1 + l10n/et_EE.json | 1 + 2 files changed, 2 insertions(+) diff --git a/l10n/et_EE.js b/l10n/et_EE.js index 2580d898c..2c76bb828 100644 --- a/l10n/et_EE.js +++ b/l10n/et_EE.js @@ -21,6 +21,7 @@ OC.L10N.register( "Can edit" : "Võib redigeerida", "Cannot copy, please copy the link manually" : "Ei saa kopeerida, palun kopeeri link käsitsi", "Password protection (enforced)" : "Paroolikaitse (jõustatud)", + "Password" : "Salasõna", "Add another link" : "Lisa veel üks link", "Advanced settings" : "Lisavalikud", "Unshare" : "Lõpeta jagamine", diff --git a/l10n/et_EE.json b/l10n/et_EE.json index 805cd4579..f07f81c19 100644 --- a/l10n/et_EE.json +++ b/l10n/et_EE.json @@ -19,6 +19,7 @@ "Can edit" : "Võib redigeerida", "Cannot copy, please copy the link manually" : "Ei saa kopeerida, palun kopeeri link käsitsi", "Password protection (enforced)" : "Paroolikaitse (jõustatud)", + "Password" : "Salasõna", "Add another link" : "Lisa veel üks link", "Advanced settings" : "Lisavalikud", "Unshare" : "Lõpeta jagamine", From ce3130b1b4bf7fd70ccdfde8ae6866f331435eec Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Tue, 25 Mar 2025 00:38:31 +0000 Subject: [PATCH 02/15] Fix(l10n): Update translations from Transifex Signed-off-by: Nextcloud bot --- l10n/et_EE.js | 3 ++- l10n/et_EE.json | 3 ++- l10n/lt_LT.js | 1 + l10n/lt_LT.json | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/l10n/et_EE.js b/l10n/et_EE.js index 2c76bb828..1def1d1b6 100644 --- a/l10n/et_EE.js +++ b/l10n/et_EE.js @@ -30,6 +30,7 @@ OC.L10N.register( "No other versions available" : "Muid versioone pole saadaval", "Sharing" : "Jagamine", "Versions" : "Versioonid", - "Link copied" : "Link kopeeritud" + "Link copied" : "Link kopeeritud", + "Copied" : "Kopeeritud" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/et_EE.json b/l10n/et_EE.json index f07f81c19..0a5ece31e 100644 --- a/l10n/et_EE.json +++ b/l10n/et_EE.json @@ -28,6 +28,7 @@ "No other versions available" : "Muid versioone pole saadaval", "Sharing" : "Jagamine", "Versions" : "Versioonid", - "Link copied" : "Link kopeeritud" + "Link copied" : "Link kopeeritud", + "Copied" : "Kopeeritud" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/lt_LT.js b/l10n/lt_LT.js index 923f4e2e5..6e86b2480 100644 --- a/l10n/lt_LT.js +++ b/l10n/lt_LT.js @@ -60,6 +60,7 @@ OC.L10N.register( "Hide templates" : "Slėpti šablonus", "Show templates" : "Rodyti šablonus", "Sort order" : "Rikiavimo tvarka", + "Sort by title" : "Rikiuoti pagal sąveiką", "View only" : "Tik peržiūrėti", "Can edit" : "Gali taisyti", "Cannot copy, please copy the link manually" : "Nepavyksta nukopijuoti, nukopijuokite nuorodą rankiniu būdu", diff --git a/l10n/lt_LT.json b/l10n/lt_LT.json index dc31a892e..e3d19bfac 100644 --- a/l10n/lt_LT.json +++ b/l10n/lt_LT.json @@ -58,6 +58,7 @@ "Hide templates" : "Slėpti šablonus", "Show templates" : "Rodyti šablonus", "Sort order" : "Rikiavimo tvarka", + "Sort by title" : "Rikiuoti pagal sąveiką", "View only" : "Tik peržiūrėti", "Can edit" : "Gali taisyti", "Cannot copy, please copy the link manually" : "Nepavyksta nukopijuoti, nukopijuokite nuorodą rankiniu būdu", From c6c853c3161296cc1cac668b05c5c59a81b5e0ba Mon Sep 17 00:00:00 2001 From: Nextcloud bot Date: Wed, 26 Mar 2025 00:38:26 +0000 Subject: [PATCH 03/15] Fix(l10n): Update translations from Transifex Signed-off-by: Nextcloud bot --- l10n/et_EE.js | 1 + l10n/et_EE.json | 1 + 2 files changed, 2 insertions(+) diff --git a/l10n/et_EE.js b/l10n/et_EE.js index 1def1d1b6..81a9d0f62 100644 --- a/l10n/et_EE.js +++ b/l10n/et_EE.js @@ -18,6 +18,7 @@ OC.L10N.register( "Favorite" : "Lemmik", "Favorites" : "Lemmikud", "Deleted" : "Kustutatud", + "View only" : "Ainult vaatamine", "Can edit" : "Võib redigeerida", "Cannot copy, please copy the link manually" : "Ei saa kopeerida, palun kopeeri link käsitsi", "Password protection (enforced)" : "Paroolikaitse (jõustatud)", diff --git a/l10n/et_EE.json b/l10n/et_EE.json index 0a5ece31e..26a422d1e 100644 --- a/l10n/et_EE.json +++ b/l10n/et_EE.json @@ -16,6 +16,7 @@ "Favorite" : "Lemmik", "Favorites" : "Lemmikud", "Deleted" : "Kustutatud", + "View only" : "Ainult vaatamine", "Can edit" : "Võib redigeerida", "Cannot copy, please copy the link manually" : "Ei saa kopeerida, palun kopeeri link käsitsi", "Password protection (enforced)" : "Paroolikaitse (jõustatud)", From 695506098d1a3c97d2acd80c27896e066bbef3b7 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Mon, 17 Mar 2025 23:24:33 +0100 Subject: [PATCH 04/15] fix(ci): cache CYPRESS install in action path Otherwise unpacking the tar file failed on github runners if the cache was created by garm runners and the binary could not be found on garm runners if the cache was created by github runners. Co-authored-by: Max Signed-off-by: Julius Knorr --- .github/workflows/cypress-e2e.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cypress-e2e.yml b/.github/workflows/cypress-e2e.yml index 3a128483a..1d2f4740c 100644 --- a/.github/workflows/cypress-e2e.yml +++ b/.github/workflows/cypress-e2e.yml @@ -13,6 +13,7 @@ env: # Adjust APP_NAME if your repository name is different APP_NAME: ${{ github.event.repository.name }} CYPRESS_baseUrl: http://localhost:8081/index.php + CYPRESS_CACHE_FOLDER: ${{ github.workspace }}/Cypress jobs: changes: @@ -144,7 +145,6 @@ jobs: key: cypress-context-${{ matrix.server-versions }}-${{ github.run_id }} path: | ./ - /home/runner/.cache/Cypress cypress: runs-on: ubuntu-latest @@ -174,7 +174,6 @@ jobs: key: cypress-context-${{ matrix.server-versions }}-${{ github.run_id }} path: | ./ - /home/runner/.cache/Cypress - name: Set up node ${{ needs.init.outputs.nodeVersion }} uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 From d5c3410f19a330751abc8a61188dfcb2e1a9087c Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Tue, 18 Mar 2025 08:16:57 +0100 Subject: [PATCH 05/15] chore: Bump github actions from templates Signed-off-by: Julius Knorr --- .../workflows/dependabot-approve-merge.yml | 4 +-- .github/workflows/lint-eslint.yml | 4 ++- .github/workflows/lint-info-xml.yml | 2 ++ .github/workflows/lint-php-cs.yml | 10 ++++--- .github/workflows/lint-php.yml | 5 ++++ .github/workflows/lint-stylelint.yml | 4 ++- .github/workflows/node.yml | 27 +++++++++++++------ .github/workflows/phpunit-sqlite.yml | 12 ++++++++- .github/workflows/pr-feedback.yml | 7 ++++- .github/workflows/psalm.yml | 19 +++++++++++-- .github/workflows/renovate-approve-merge.yml | 6 ++--- .github/workflows/reuse.yml | 3 +++ 12 files changed, 81 insertions(+), 22 deletions(-) diff --git a/.github/workflows/dependabot-approve-merge.yml b/.github/workflows/dependabot-approve-merge.yml index efe8bfe37..ed902d928 100644 --- a/.github/workflows/dependabot-approve-merge.yml +++ b/.github/workflows/dependabot-approve-merge.yml @@ -9,7 +9,7 @@ name: Dependabot on: - pull_request_target: + pull_request_target: # zizmor: ignore[dangerous-triggers] branches: - main - master @@ -24,7 +24,7 @@ concurrency: jobs: auto-approve-merge: - if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]' + if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]' runs-on: ubuntu-latest-low permissions: # for hmarr/auto-approve-action to approve PRs diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml index d5dda99b2..104a05c42 100644 --- a/.github/workflows/lint-eslint.yml +++ b/.github/workflows/lint-eslint.yml @@ -57,6 +57,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Read package.json node and npm engines version uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 @@ -66,7 +68,7 @@ jobs: fallbackNpm: '^10' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/lint-info-xml.yml b/.github/workflows/lint-info-xml.yml index 290f4eeed..25b655043 100644 --- a/.github/workflows/lint-info-xml.yml +++ b/.github/workflows/lint-info-xml.yml @@ -25,6 +25,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Download schema run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml index 0da64534d..681ecca65 100644 --- a/.github/workflows/lint-php-cs.yml +++ b/.github/workflows/lint-php-cs.yml @@ -26,15 +26,17 @@ jobs: steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Get php version id: versions uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - name: Set up php${{ steps.versions.outputs.php-available }} + - name: Set up php${{ steps.versions.outputs.php-min }} uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0 with: - php-version: ${{ steps.versions.outputs.php-available }} + php-version: ${{ steps.versions.outputs.php-min }} extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite coverage: none ini-file: development @@ -42,7 +44,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Install dependencies - run: composer i + run: | + composer remove nextcloud/ocp --dev + 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 index d817e798d..cdb2ba45c 100644 --- a/.github/workflows/lint-php.yml +++ b/.github/workflows/lint-php.yml @@ -25,6 +25,9 @@ jobs: steps: - name: Checkout app uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + - name: Get version matrix id: versions uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0 @@ -41,6 +44,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Set up php ${{ matrix.php-versions }} uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0 diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml index ecb5bb713..9601a972f 100644 --- a/.github/workflows/lint-stylelint.yml +++ b/.github/workflows/lint-stylelint.yml @@ -26,6 +26,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Read package.json node and npm engines version uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 @@ -35,7 +37,7 @@ jobs: fallbackNpm: '^10' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 71afe4345..0137e9795 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -44,16 +44,18 @@ jobs: - '**.ts' - '**.vue' - test: + build: runs-on: ubuntu-latest needs: changes if: needs.changes.outputs.src != 'false' - name: NPM test + name: NPM build steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Read package.json node and npm engines version uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 @@ -63,28 +65,37 @@ jobs: fallbackNpm: '^10' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 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 + - name: Install dependencies & build env: CYPRESS_INSTALL_BINARY: 0 PUPPETEER_SKIP_DOWNLOAD: true 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: Test - run: npm test + - name: Show changes on failure + if: failure() + run: | + git status + git --no-pager diff + exit 1 # make it red to grab attention summary: permissions: contents: none runs-on: ubuntu-latest-low - needs: [changes, test] + needs: [changes, build] if: always() @@ -93,4 +104,4 @@ jobs: steps: - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi + run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/phpunit-sqlite.yml b/.github/workflows/phpunit-sqlite.yml index e17bbc899..d33592ed1 100644 --- a/.github/workflows/phpunit-sqlite.yml +++ b/.github/workflows/phpunit-sqlite.yml @@ -26,6 +26,8 @@ jobs: steps: - name: Checkout app uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Get version matrix id: versions @@ -73,6 +75,7 @@ jobs: steps: - name: Set app env + if: ${{ env.APP_NAME == '' }} run: | # Split and keep last echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV @@ -80,6 +83,7 @@ jobs: - name: Checkout server uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: + persist-credentials: false submodules: true repository: nextcloud/server ref: ${{ matrix.server-versions }} @@ -87,6 +91,7 @@ jobs: - name: Checkout circles app uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: + persist-credentials: false repository: nextcloud/circles path: apps/circles ref: ${{ matrix.server-versions }} @@ -94,6 +99,7 @@ jobs: - name: Checkout app uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: + persist-credentials: false path: apps/${{ env.APP_NAME }} - name: Set up php ${{ matrix.php-versions }} @@ -104,6 +110,8 @@ jobs: extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite coverage: none ini-file: development + # Temporary workaround for missing pcntl_* in PHP 8.3 + ini-values: disable_functions= env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -117,7 +125,9 @@ jobs: # Only run if phpunit config file exists if: steps.check_composer.outputs.files_exists == 'true' working-directory: apps/${{ env.APP_NAME }} - run: composer i + run: | + composer remove nextcloud/ocp --dev + composer i - name: Set up Nextcloud env: diff --git a/.github/workflows/pr-feedback.yml b/.github/workflows/pr-feedback.yml index 98d2715e2..98e9fada7 100644 --- a/.github/workflows/pr-feedback.yml +++ b/.github/workflows/pr-feedback.yml @@ -15,8 +15,13 @@ on: schedule: - cron: '30 1 * * *' +permissions: + contents: read + pull-requests: write + jobs: pr-feedback: + if: ${{ github.repository_owner == 'nextcloud' }} runs-on: ubuntu-latest steps: - name: The get-github-handles-from-website action @@ -31,7 +36,7 @@ jobs: blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -) echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT" - - uses: marcelklehr/pr-feedback-action@1883b38a033fb16f576875e0cf45f98b857655c4 + - uses: nextcloud/pr-feedback-action@1883b38a033fb16f576875e0cf45f98b857655c4 # main with: feedback-message: | Hello there, diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index e4dad2d41..0b15f3adb 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -14,6 +14,9 @@ concurrency: group: psalm-${{ github.head_ref || github.run_id }} cancel-in-progress: true +permissions: + contents: read + jobs: static-analysis: runs-on: ubuntu-latest @@ -22,11 +25,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Get php version id: versions uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 + - name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml + run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml + - name: Set up php${{ steps.versions.outputs.php-available }} uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0 with: @@ -34,11 +42,18 @@ jobs: extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite coverage: none ini-file: development + # Temporary workaround for missing pcntl_* in PHP 8.3 + ini-values: disable_functions= env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Install dependencies - run: composer i + run: | + composer remove nextcloud/ocp --dev + composer i + + - name: Install nextcloud/ocp + run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} --ignore-platform-reqs --with-dependencies - name: Run coding standards check - run: composer run psalm + run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github diff --git a/.github/workflows/renovate-approve-merge.yml b/.github/workflows/renovate-approve-merge.yml index 48b98e91a..ccfed3974 100644 --- a/.github/workflows/renovate-approve-merge.yml +++ b/.github/workflows/renovate-approve-merge.yml @@ -9,7 +9,7 @@ name: Auto approve renovate PRs on: - pull_request_target: + pull_request_target: # zizmor: ignore[dangerous-triggers] branches: - main - master @@ -24,7 +24,7 @@ concurrency: jobs: auto-approve-merge: - if: github.actor == 'renovate[bot]' + if: github.event.pull_request.user.login == 'renovate[bot]' runs-on: ubuntu-latest permissions: # for hmarr/auto-approve-action to approve PRs @@ -52,7 +52,7 @@ jobs: # Enable GitHub auto merge - name: Auto merge - uses: alexwilson/enable-github-automerge-action@main + uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # v2.0.0 if: startsWith(steps.branchname.outputs.branch, 'renovate/') with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index b6828556a..0d8e1962a 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -11,6 +11,9 @@ name: REUSE Compliance Check on: [pull_request] +permissions: + contents: read + jobs: reuse-compliance-check: runs-on: ubuntu-latest From c301631b53fe36cdd0dad679a3ab19175b68b365 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Tue, 18 Mar 2025 08:18:36 +0100 Subject: [PATCH 06/15] chore: Pin github actions Signed-off-by: Julius Knorr --- .github/workflows/pages.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 22cc222b2..dbe5a26bd 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -53,7 +53,7 @@ jobs: - name: Setup Pages id: pages - uses: actions/configure-pages@v5 + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 - name: Install Node.js dependencies run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" @@ -72,7 +72,7 @@ jobs: mv build/pages public - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 with: path: ./public @@ -86,4 +86,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 From 217563831f75ffa3f33ee59e101fd6483c40e9f3 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Tue, 18 Mar 2025 08:21:19 +0100 Subject: [PATCH 07/15] chore: Set minimum php version for psalm Signed-off-by: Julius Knorr --- psalm.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/psalm.xml b/psalm.xml index b8448a28b..94dd4e775 100644 --- a/psalm.xml +++ b/psalm.xml @@ -6,6 +6,7 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor-bin/vimeo/psalm/config.xsd" errorBaseline="tests/psalm-baseline.xml" + phpVersion="8.0" > From 840d315af1919ddbd09188718685a480ecb1c727 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 18 Mar 2025 12:16:35 +0100 Subject: [PATCH 08/15] fix(psalm) getPasswordHash returns nullable string Signed-off-by: Max --- lib/Controller/PublicCollectiveController.php | 2 +- lib/Controller/PublicPageController.php | 2 +- lib/Controller/PublicPageTrashController.php | 2 +- lib/Controller/PublicStartController.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Controller/PublicCollectiveController.php b/lib/Controller/PublicCollectiveController.php index 40ac8b109..f5a0cc8e4 100644 --- a/lib/Controller/PublicCollectiveController.php +++ b/lib/Controller/PublicCollectiveController.php @@ -55,7 +55,7 @@ protected function getShare(): IShare { return $this->share; } - protected function getPasswordHash(): string { + protected function getPasswordHash(): ?string { return $this->getShare()->getPassword(); } diff --git a/lib/Controller/PublicPageController.php b/lib/Controller/PublicPageController.php index ae3c15885..380f239dd 100644 --- a/lib/Controller/PublicPageController.php +++ b/lib/Controller/PublicPageController.php @@ -75,7 +75,7 @@ private function getCollectiveShare(): CollectiveShare { return $this->collectiveShare; } - protected function getPasswordHash(): string { + protected function getPasswordHash(): ?string { return $this->getShare()->getPassword(); } diff --git a/lib/Controller/PublicPageTrashController.php b/lib/Controller/PublicPageTrashController.php index ea8a21e05..b1156f620 100644 --- a/lib/Controller/PublicPageTrashController.php +++ b/lib/Controller/PublicPageTrashController.php @@ -76,7 +76,7 @@ private function getCollectiveShare(): CollectiveShare { return $this->collectiveShare; } - protected function getPasswordHash(): string { + protected function getPasswordHash(): ?string { return $this->getShare()->getPassword(); } diff --git a/lib/Controller/PublicStartController.php b/lib/Controller/PublicStartController.php index b1a8ccff0..8d1f59f3a 100644 --- a/lib/Controller/PublicStartController.php +++ b/lib/Controller/PublicStartController.php @@ -54,7 +54,7 @@ protected function getShare(): IShare { return $this->share; } - protected function getPasswordHash(): string { + protected function getPasswordHash(): ?string { return $this->getShare()->getPassword(); } From 7af1286bd395ff82498a86768af4b09ec3bec85c Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 18 Mar 2025 12:17:23 +0100 Subject: [PATCH 09/15] fix(psalm): use OCP\DB\Types for addType Signed-off-by: Max --- lib/Db/Page.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Db/Page.php b/lib/Db/Page.php index b0279912f..e845b8f22 100644 --- a/lib/Db/Page.php +++ b/lib/Db/Page.php @@ -12,6 +12,7 @@ use JsonSerializable; use OCP\AppFramework\Db\Entity; +use OCP\DB\Types; /** * @method int getId() @@ -38,7 +39,7 @@ class Page extends Entity implements JsonSerializable { protected ?int $trashTimestamp = null; public function __construct() { - $this->addType('fullWidth', 'bool'); + $this->addType('fullWidth', Types::BOOLEAN); } public function jsonSerialize(): array { From d5f98877fc29a08212aabec13c7bb4cdbbe4ea55 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 18 Mar 2025 13:16:16 +0100 Subject: [PATCH 10/15] fix(psalm): return an array of strings Signed-off-by: Max --- lib/Team/CollectiveTeamResourceProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Team/CollectiveTeamResourceProvider.php b/lib/Team/CollectiveTeamResourceProvider.php index 58c3a69ac..685724add 100644 --- a/lib/Team/CollectiveTeamResourceProvider.php +++ b/lib/Team/CollectiveTeamResourceProvider.php @@ -73,6 +73,7 @@ public function getTeamsForResource(string $resourceId): array { } catch (NotFoundException|NotPermittedException) { return []; } - return [$collective->getCircleId()]; + $circleId = $collective->getCircleId(); + return $circleId === null ? [] : [$circleId]; } } From 71a99fada6365b455a74486df1e9d378a0d0522a Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 19 Mar 2025 09:07:15 +0100 Subject: [PATCH 11/15] test(psalm): update baseline Signed-off-by: Max --- tests/psalm-baseline.xml | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index e8c89aeda..64e1cecc4 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -1,17 +1,5 @@ - - - - - - - - - - - - - + @@ -28,16 +16,6 @@ - - - - - - - - - - @@ -51,11 +29,6 @@ - - - - - From 0734a55a6b3a65ec390a276aad599eae92675109 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 19 Mar 2025 10:34:27 +0100 Subject: [PATCH 12/15] test(psalm) find unused baseline entries but not code Signed-off-by: Max --- psalm.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/psalm.xml b/psalm.xml index 94dd4e775..5949f5d36 100644 --- a/psalm.xml +++ b/psalm.xml @@ -6,6 +6,8 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor-bin/vimeo/psalm/config.xsd" errorBaseline="tests/psalm-baseline.xml" + findUnusedBaselineEntry="true" + findUnusedCode="false" phpVersion="8.0" > From 9b7fdf97116e9367b86d989657d7434fbbed4d26 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 19 Mar 2025 10:36:13 +0100 Subject: [PATCH 13/15] enh(team): implement isSharedWithTeam Signed-off-by: Max --- lib/Team/CollectiveTeamResourceProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Team/CollectiveTeamResourceProvider.php b/lib/Team/CollectiveTeamResourceProvider.php index 685724add..1f80da991 100644 --- a/lib/Team/CollectiveTeamResourceProvider.php +++ b/lib/Team/CollectiveTeamResourceProvider.php @@ -64,7 +64,8 @@ public function getSharedWith(string $teamId): array { } public function isSharedWithTeam(string $teamId, string $resourceId): bool { - // TODO: Implement isSharedWithTeam() method. + $teamIds = $this->getTeamsForResource($resourceId); + return in_array($teamId, $teamIds); } public function getTeamsForResource(string $resourceId): array { From 312085dae0eaa420a8d1183502dbed82467193a3 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 19 Mar 2025 10:36:48 +0100 Subject: [PATCH 14/15] fix(psalm): add new methods to stubs Signed-off-by: Max --- tests/stub.phpstub | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/stub.phpstub b/tests/stub.phpstub index a88933a48..921b6c119 100644 --- a/tests/stub.phpstub +++ b/tests/stub.phpstub @@ -589,6 +589,14 @@ namespace OC\Files\Storage\Wrapper{ public function getWatcher() { throw new \Exception('stub'); } + + public function needsPartFile(): bool { + throw new \Exception('stub'); + } + + public function setOwner(?string $user): void { + throw new \Exception('stub'); + } } class Jail extends Wrapper { @@ -879,6 +887,9 @@ namespace OCA\Files_Trashbin\Trash { public function getTitle(): string {} public function getCreationTime(): int {} public function getUploadTime(): int {} + public function getParentId(): int {} + public function getDeletedBy(): ?IUser {} + public function getMetadata(): array {} } } From c00bac75346f9d7ca3d4266db20f57e7b132d011 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 19 Mar 2025 10:37:23 +0100 Subject: [PATCH 15/15] fix(psalm): getCache can have IStorage as 2nd param Signed-off-by: Max --- lib/Mount/CollectiveStorage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Mount/CollectiveStorage.php b/lib/Mount/CollectiveStorage.php index 9d40ebc5a..ac4aeaf33 100644 --- a/lib/Mount/CollectiveStorage.php +++ b/lib/Mount/CollectiveStorage.php @@ -46,7 +46,7 @@ public function getOwner($path): string|false { /** * @param string $path - * @param null $storage + * @param IStorage|null $storage */ public function getCache($path = '', $storage = null): RootEntryCache { if ($this->cache) {