From d2e57f47c379d0f24d2166e261b5e33a012354dc Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Tue, 4 Aug 2026 07:10:51 +0200 Subject: [PATCH] ci(quality): let an app declare the Playwright front-controller preflight URL The preflight probes /apps// and treats HTTP 404 as proof the php -S front controller is not routing pretty URLs. That inference only holds for an app that actually serves a main page. nldesign does not. Its routes.php declares only /api/* and /settings/*, and info.xml declares with no - it is an admin-settings-only theming app. /apps/nldesign/ is therefore a CORRECT 404, and the preflight reported it as a broken front controller and exited 1 before a single spec ran. Add playwright-preflight-path so such an app can name a URL it really serves. The default is empty and falls back to /apps//, so every existing caller probes exactly what it probed before - this cannot change behaviour for any repo that does not set it. Also point the failure message at the new input. The OCS entry-point check below is untouched and remains the load-bearing proof that the router itself works. --- .github/workflows/quality.yml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 2a41bfb..af95ece 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -137,6 +137,11 @@ on: required: false type: string default: "" + playwright-preflight-path: + description: "Pretty URL the Playwright job probes to prove the php -S front controller is routing, before any spec runs. Defaults to /apps//, which is right for every app that serves a main page. Set it for apps that legitimately have NO main route — e.g. an admin-settings-only app like nldesign, whose routes.php declares only /api/* and /settings/* and whose /apps/nldesign/ therefore correctly 404s. Without an override the preflight reports that correct 404 as a broken front controller and fails the job before a single spec runs." + required: false + type: string + default: "" enable-playwright-coverage: description: "Collect V8 code coverage during Playwright tests and enforce threshold" required: false @@ -2012,10 +2017,24 @@ jobs: # Prove the front controller is actually routing before any spec runs. # `/apps//` is the URL the fleet's specs use; without the router # it is a hard 404 and every one of them fails on a selector timeout. - PRETTY="$(curl -s -o /dev/null -w '%{http_code}' "http://localhost:8080/apps/${{ inputs.app-name }}/")" - echo "Front-controller check: /apps/${{ inputs.app-name }}/ -> HTTP ${PRETTY}" + # + # A 404 here means "the router is broken" ONLY for an app that + # actually serves a main page. Not every app does: an + # admin-settings-only app such as nldesign declares just /api/* and + # /settings/* in routes.php and no in info.xml, so + # /apps/nldesign/ is a CORRECT 404 — and this check read that as a + # broken front controller and killed the job before any spec ran. + # `playwright-preflight-path` lets such an app name a URL it really + # serves. Default is unchanged, so no existing caller is affected. + PREFLIGHT_PATH="${{ inputs.playwright-preflight-path }}" + if [ -z "$PREFLIGHT_PATH" ]; then + PREFLIGHT_PATH="/apps/${{ inputs.app-name }}/" + fi + PRETTY="$(curl -s -o /dev/null -w '%{http_code}' "http://localhost:8080${PREFLIGHT_PATH}")" + echo "Front-controller check: ${PREFLIGHT_PATH} -> HTTP ${PRETTY}" if [ "$PRETTY" = "404" ]; then - echo "::error::The php -S front-controller router is not routing pretty URLs — /apps/${{ inputs.app-name }}/ returned 404. Every spec using a pretty Nextcloud URL will fail on a selector timeout." + echo "::error::The php -S front-controller router is not routing pretty URLs — ${PREFLIGHT_PATH} returned 404. Every spec using a pretty Nextcloud URL will fail on a selector timeout." + echo "::error::If this app legitimately serves no page at that path (an admin-settings-only app, for instance), set the 'playwright-preflight-path' input to a URL it does serve." exit 1 fi # And prove the OTHER Nextcloud PHP entry points still reach