From 0a300f3c4bc0d6f155da5c8b01f4d916725485e6 Mon Sep 17 00:00:00 2001 From: Thom Lamb Date: Thu, 3 Sep 2026 16:34:25 -0500 Subject: [PATCH] fix(ci): give the end-to-end backend a REMBG_URL so its controls render (#287) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit main went red on 86095cb with "Playwright: 157 passed, 3 failed" while every other step in the job passed. The three are the background-removal cases from #281, and they fail for the most boring reason available: REMBG_URL appears nowhere in .gitea/workflows, so isRembgConfigured() is false, both endpoints report backgroundRemoval as false, and neither the submitter's checkbox nor the review queue's per-photo button is rendered for the tests to find. The application is right and the tests are right; the environment they run in was missing one variable. Deliberately a URL that does not resolve. Nothing in the suite reaches the sidecar — the worker only cuts a background out after a draft is written, and drafting needs an ANTHROPIC_API_KEY this job does not have. Standing up a real rembg in CI would cost a 4.24 GB image and about forty seconds of startup to prove that a control is on screen. How it got in is worth recording, because the missing line is the symptom. #281 added the variable to scripts/start-local.ps1 and stopped there, and its three end-to-end tests were merged unrun — verified locally against a stack that did have the variable, then handed over as outstanding rather than run before the merge. A test that has never been run is not evidence of anything, and two of the three would have failed on the first honest execution. The deeper gap is that a variable which changes rendered behaviour now lives in two places nothing compares. composeEnvironment.test.ts exists for exactly this failure and caught it twice before, in #107 and #118, but it guards the deploying compose files rather than the CI workflow. Whether it should reach into .gitea/workflows is a decision rather than another hand-added line, and #287 leaves it open. Co-Authored-By: Claude Opus 5 --- .gitea/workflows/sonarqube.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitea/workflows/sonarqube.yml b/.gitea/workflows/sonarqube.yml index 252637f..ff19f66 100755 --- a/.gitea/workflows/sonarqube.yml +++ b/.gitea/workflows/sonarqube.yml @@ -56,6 +56,17 @@ jobs: PORT: 3000 DEMO_MODE: 'true' UPLOADS_DIR: /tmp/redefined-uploads + # Set so the background-removal controls render at all: both the + # submission page's checkbox and the review queue's per-photo button are + # hidden unless the server reports the feature as configured, and three + # end-to-end tests assert they are there (#287). + # + # Deliberately a URL that does not resolve. Nothing in the suite reaches + # the sidecar — the worker only cuts a background out after a draft is + # written, and drafting needs an ANTHROPIC_API_KEY this job does not have. + # A real rembg here would mean a 4.24 GB image and forty seconds of + # startup to prove a control is on screen. + REMBG_URL: http://127.0.0.1:7000 # NODE_ENV is deliberately unset: `npm install` omits devDependencies when # NODE_ENV=production, which strips tsc/vite/@playwright/test and breaks the # build. It would also flip the session cookie to Secure, which the e2e run