Compare commits

...

5 Commits

Author SHA1 Message Date
Ferdinand Thiessen
f4151eb052 fix(dav): AddExtraHeadersPlugin should not be handled on error
When a request failed (failed upload) the file is not created,
thus this will spam the log with "cannot set extra headers" error.
To reproduce use e.g. files_antivirus with eicar test files.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-03-31 12:29:38 +02:00
Joas Schilling
5acf3878f3 Merge pull request #59318 from nextcloud/jtr/ci-perf-lint-php-cs-changes-bypass
ci: stop running `lint` in `lint-php-cs` unconditionally even if no changes
2026-03-31 11:56:26 +02:00
Joas Schilling
810d8b4c98 Merge pull request #59319 from nextcloud/jtr/ci-perf-static-code-analysis-changes-check
ci: add path filtering to static-code-analysis workflow
2026-03-31 11:55:19 +02:00
Josh
330ae40ecf ci: add path filtering to static-code-analysis workflow
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-03-30 12:56:55 -04:00
Josh
b400f1b93b ci: stop running lint in lint-php-cs unconditionally even if no changes
Signed-off-by: Josh <josh.t.richards@gmail.com>
2026-03-30 12:31:49 -04:00
3 changed files with 67 additions and 5 deletions

View File

@@ -44,6 +44,9 @@ jobs:
lint:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.src != 'false'
name: php-cs
steps:

View File

@@ -21,10 +21,35 @@ concurrency:
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest-low
outputs:
src: ${{ steps.changes.outputs.src }}
steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
continue-on-error: true
with:
filters: |
src:
- '.github/workflows/**'
- '3rdparty/**'
- '**/appinfo/**'
- '**/lib/**'
- '**/templates/**'
- 'vendor/**'
- 'vendor-bin/**'
- 'composer.json'
- 'composer.lock'
- '**.php'
static-code-analysis:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'push' && github.repository_owner != 'nextcloud-gmbh' }}
needs: changes
if: ${{ needs.changes.outputs.src != 'false' && github.event_name != 'push' && github.repository_owner != 'nextcloud-gmbh' }}
steps:
- name: Checkout
@@ -56,7 +81,8 @@ jobs:
static-code-analysis-security:
runs-on: ubuntu-latest
if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
needs: changes
if: ${{ needs.changes.outputs.src != 'false' && github.repository_owner != 'nextcloud-gmbh' }}
permissions:
security-events: write
@@ -95,7 +121,8 @@ jobs:
static-code-analysis-ocp:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'push' && github.repository_owner != 'nextcloud-gmbh' }}
needs: changes
if: ${{ needs.changes.outputs.src != 'false' && github.event_name != 'push' && github.repository_owner != 'nextcloud-gmbh' }}
steps:
- name: Checkout
@@ -127,7 +154,8 @@ jobs:
static-code-analysis-ncu:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'push' && github.repository_owner != 'nextcloud-gmbh' }}
needs: changes
if: ${{ needs.changes.outputs.src != 'false' && github.event_name != 'push' && github.repository_owner != 'nextcloud-gmbh' }}
steps:
- name: Checkout
@@ -155,7 +183,8 @@ jobs:
static-code-analysis-strict:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'push' && github.repository_owner != 'nextcloud-gmbh' }}
needs: changes
if: ${{ needs.changes.outputs.src != 'false' && github.event_name != 'push' && github.repository_owner != 'nextcloud-gmbh' }}
steps:
- name: Checkout
@@ -178,3 +207,28 @@ jobs:
- name: Psalm
run: composer run psalm:strict -- --threads=1 --monochrome --no-progress --output-format=github
summary:
permissions:
contents: none
runs-on: ubuntu-latest-low
needs: [changes, static-code-analysis, static-code-analysis-security, static-code-analysis-ocp, static-code-analysis-ncu, static-code-analysis-strict]
if: always()
name: static-code-analysis-summary
steps:
- name: Summary status
run: |
if ${{ needs.changes.outputs.src != 'false' && (
needs.static-code-analysis-security.result != 'success' ||
(github.event_name != 'push' && (
needs.static-code-analysis.result != 'success' ||
needs.static-code-analysis-ocp.result != 'success' ||
needs.static-code-analysis-ncu.result != 'success' ||
needs.static-code-analysis-strict.result != 'success'
))
) }}; then
exit 1
fi

View File

@@ -40,6 +40,11 @@ class AddExtraHeadersPlugin extends \Sabre\DAV\ServerPlugin {
return;
}
// skip setting the headers if the PUT request failed
if ($response->getStatus() >= 400) {
return;
}
$node = null;
try {
$node = $this->server->tree->getNodeForPath($request->getPath());