Skip to content

Commit 8b36b04

Browse files
Merge pull request #372 from nextcloud/backport/370/stable31
[stable31] fix(report): Make the last_report lazy so we don't load it on each request
2 parents 3cbeaa8 + cf95f79 commit 8b36b04

File tree

13 files changed

+139
-99
lines changed

13 files changed

+139
-99
lines changed

.github/workflows/block-merge-freeze.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,29 @@ jobs:
2929

3030
steps:
3131
- name: Register server reference to fallback to master branch
32-
run: |
33-
server_ref="$(if [ '${{ github.base_ref }}' = 'main' ]; then echo -n 'master'; else echo -n '${{ github.base_ref }}'; fi)"
34-
echo "server_ref=$server_ref" >> $GITHUB_ENV
32+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
33+
with:
34+
github-token: ${{secrets.GITHUB_TOKEN}}
35+
script: |
36+
const baseRef = context.payload.pull_request.base.ref
37+
if (baseRef === 'main' || baseRef === 'master') {
38+
core.exportVariable('server_ref', 'master');
39+
console.log('Setting server_ref to master');
40+
} else {
41+
const regex = /^stable(\d+)$/
42+
const match = baseRef.match(regex)
43+
if (match) {
44+
core.exportVariable('server_ref', match[0]);
45+
console.log('Setting server_ref to ' + match[0]);
46+
} else {
47+
console.log('Not based on master/main/stable*, so skipping freeze check');
48+
}
49+
}
50+
3551
- name: Download version.php from ${{ env.server_ref }}
52+
if: ${{ env.server_ref != '' }}
3653
run: curl 'https://raw.githubusercontent.com/nextcloud/server/${{ env.server_ref }}/version.php' --output version.php
3754

3855
- name: Run check
56+
if: ${{ env.server_ref != '' }}
3957
run: cat version.php | grep 'OC_VersionString' | grep -i -v 'RC'

.github/workflows/dependabot-approve-merge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
name: Dependabot
1010

1111
on:
12-
pull_request_target:
12+
pull_request_target: # zizmor: ignore[dangerous-triggers]
1313
branches:
1414
- main
1515
- master
@@ -24,7 +24,7 @@ concurrency:
2424

2525
jobs:
2626
auto-approve-merge:
27-
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
27+
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]'
2828
runs-on: ubuntu-latest-low
2929
permissions:
3030
# for hmarr/auto-approve-action to approve PRs

.github/workflows/lint-info-xml.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ jobs:
2424
name: info.xml lint
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
2830

2931
- name: Download schema
30-
run: wget https://raw.githubusercontent.com/nextcloud/server/master/resources/app-info-shipped.xsd
32+
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
3133

3234
- name: Lint info.xml
3335
uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2
3436
with:
3537
xml-file: ./appinfo/info.xml
36-
xml-schema-file: ./app-info-shipped.xsd
38+
xml-schema-file: ./info.xsd

.github/workflows/lint-php-cs.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,28 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: false
2931

3032
- name: Get php version
3133
id: versions
3234
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
3335

34-
- name: Set up php${{ steps.versions.outputs.php-available }}
35-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
36+
- name: Set up php${{ steps.versions.outputs.php-min }}
37+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
3638
with:
37-
php-version: ${{ steps.versions.outputs.php-available }}
39+
php-version: ${{ steps.versions.outputs.php-min }}
3840
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
3941
coverage: none
4042
ini-file: development
4143
env:
4244
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4345

4446
- name: Install dependencies
45-
run: composer i
47+
run: |
48+
composer remove nextcloud/ocp --dev --no-scripts
49+
composer i
4650
4751
- name: Lint
4852
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

.github/workflows/lint-php.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ jobs:
2424
php-versions: ${{ steps.versions.outputs.php-versions }}
2525
steps:
2626
- name: Checkout app
27-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
30+
2831
- name: Get version matrix
2932
id: versions
3033
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
@@ -40,10 +43,12 @@ jobs:
4043

4144
steps:
4245
- name: Checkout
43-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
with:
48+
persist-credentials: false
4449

4550
- name: Set up php ${{ matrix.php-versions }}
46-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
51+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
4752
with:
4853
php-version: ${{ matrix.php-versions }}
4954
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite

.github/workflows/phpunit-sqlite.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
server-max: ${{ steps.versions.outputs.branches-max-list }}
2626
steps:
2727
- name: Checkout app
28-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: false
2931

3032
- name: Get version matrix
3133
id: versions
@@ -73,30 +75,35 @@ jobs:
7375

7476
steps:
7577
- name: Set app env
78+
if: ${{ env.APP_NAME == '' }}
7679
run: |
7780
# Split and keep last
7881
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
7982
8083
- name: Checkout server
81-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
84+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8285
with:
86+
persist-credentials: false
8387
submodules: true
8488
repository: nextcloud/server
8589
ref: ${{ matrix.server-versions }}
8690

8791
- name: Checkout app
88-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
92+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8993
with:
94+
persist-credentials: false
9095
path: apps/${{ env.APP_NAME }}
9196

9297
- name: Set up php ${{ matrix.php-versions }}
93-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
98+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
9499
with:
95100
php-version: ${{ matrix.php-versions }}
96101
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
97102
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
98103
coverage: none
99104
ini-file: development
105+
# Temporary workaround for missing pcntl_* in PHP 8.3
106+
ini-values: disable_functions=
100107
env:
101108
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102109

@@ -110,7 +117,9 @@ jobs:
110117
# Only run if phpunit config file exists
111118
if: steps.check_composer.outputs.files_exists == 'true'
112119
working-directory: apps/${{ env.APP_NAME }}
113-
run: composer i
120+
run: |
121+
composer remove nextcloud/ocp --dev --no-scripts
122+
composer i
114123
115124
- name: Set up Nextcloud
116125
env:

.github/workflows/pr-feedback.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ on:
1515
schedule:
1616
- cron: '30 1 * * *'
1717

18+
permissions:
19+
contents: read
20+
pull-requests: write
21+
1822
jobs:
1923
pr-feedback:
24+
if: ${{ github.repository_owner == 'nextcloud' }}
2025
runs-on: ubuntu-latest
2126
steps:
2227
- name: The get-github-handles-from-website action
23-
uses: marcelklehr/get-github-handles-from-website-action@a739600f6b91da4957f51db0792697afbb2f143c # v1.0.0
28+
uses: marcelklehr/get-github-handles-from-website-action@06b2239db0a48fe1484ba0bfd966a3ab81a08308 # v1.0.1
2429
id: scrape
2530
with:
2631
website: 'https://nextcloud.com/team/'
@@ -31,7 +36,7 @@ jobs:
3136
blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -)
3237
echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT"
3338
34-
- uses: marcelklehr/pr-feedback-action@1883b38a033fb16f576875e0cf45f98b857655c4
39+
- uses: nextcloud/pr-feedback-action@f0cab224dea8e1f282f9451de322f323c78fc7a5 # main
3540
with:
3641
feedback-message: |
3742
Hello there,
@@ -45,6 +50,6 @@ jobs:
4550
4651
(If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).)
4752
days-before-feedback: 14
48-
start-date: '2024-04-30'
53+
start-date: '2025-06-12'
4954
exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}'
5055
exempt-bots: true

.github/workflows/psalm.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,46 @@ concurrency:
1414
group: psalm-${{ github.head_ref || github.run_id }}
1515
cancel-in-progress: true
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
static-analysis:
1922
runs-on: ubuntu-latest
2023

2124
name: static-psalm-analysis
2225
steps:
2326
- name: Checkout
24-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
2530

2631
- name: Get php version
2732
id: versions
2833
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
2934

35+
- name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml
36+
run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml
37+
3038
- name: Set up php${{ steps.versions.outputs.php-available }}
31-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
39+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
3240
with:
3341
php-version: ${{ steps.versions.outputs.php-available }}
3442
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
3543
coverage: none
3644
ini-file: development
45+
# Temporary workaround for missing pcntl_* in PHP 8.3
46+
ini-values: disable_functions=
3747
env:
3848
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3949

4050
- name: Install dependencies
41-
run: composer i
51+
run: |
52+
composer remove nextcloud/ocp --dev --no-scripts
53+
composer i
54+
55+
- name: Install nextcloud/ocp
56+
run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} --ignore-platform-reqs --with-dependencies
4257

4358
- name: Run coding standards check
44-
run: composer run psalm
59+
run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github

.github/workflows/reuse.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ name: REUSE Compliance Check
1111

1212
on: [pull_request]
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
reuse-compliance-check:
16-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-latest-low
1720
steps:
1821
- name: Checkout
19-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
2025

2126
- name: REUSE Compliance Check
22-
uses: fsfe/reuse-action@3ae3c6bdf1257ab19397fab11fd3312144692083 # v4.0.0
27+
uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5.0.0

.github/workflows/update-nextcloud-ocp.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,33 @@ on:
1313
schedule:
1414
- cron: "5 2 * * 0"
1515

16+
permissions:
17+
contents: read
18+
issues: write
19+
1620
jobs:
1721
update-nextcloud-ocp:
1822
runs-on: ubuntu-latest
1923

2024
strategy:
2125
fail-fast: false
2226
matrix:
23-
branches: ['main', 'master', 'stable30', 'stable29', 'stable28']
27+
branches: ['main', 'master', 'stable31', 'stable30']
2428

2529
name: update-nextcloud-ocp-${{ matrix.branches }}
2630

2731
steps:
2832
- id: checkout
29-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
33+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3034
with:
35+
persist-credentials: false
3136
ref: ${{ matrix.branches }}
3237
submodules: true
3338
continue-on-error: true
3439

3540
- name: Set up php8.2
3641
if: steps.checkout.outcome == 'success'
37-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
42+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
3843
with:
3944
php-version: 8.2
4045
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
@@ -103,7 +108,7 @@ jobs:
103108

104109
- name: Create Pull Request
105110
if: steps.checkout.outcome == 'success'
106-
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
111+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
107112
with:
108113
token: ${{ secrets.COMMAND_BOT_PAT }}
109114
commit-message: 'chore(dev-deps): Bump nextcloud/ocp package'

0 commit comments

Comments
 (0)