fix: release QA hardening across processing, media, security, and CI gates (#649)

A release-readiness QA pass over the whole product. The commits split into
defects a user would hit and gates that were reporting green while measuring
nothing.

## Fixes that change behaviour

Rate limiting was bypassable on every install: TRUST_PROXY defaulted to true, so
request.ip came from a client-set header and a forged X-Forwarded-For got past
the login limiter. The default is now a private-network trust list.

A transient Postgres outage stranded in-flight jobs, leaving finished output on
disk with no row pointing at it. A reconciler now resolves those rows and adopts
the bytes rather than dropping the work.

A Redis connection that moved to a new address wedged every read-blocked
consumer, so completions stopped signalling while health still answered 200.
Socket timeouts plus subscriber pings recover it.

Installing more than one AI bundle left the shared venv multi-versioned and
silently broke three tools. The installer now reconciles distributions to one
version each.

Converting an image to JXL at quality 1 through 4 returned a 500, because
libjxl 0.7 rejects the distance those values compute. The quality is floored at
what the encoder honours. A missing ffmpeg was also reported to the user as a
corrupt upload; it now says the engine is unavailable.

RAW uploads reached an unpatched LibRaw on arm64, so it is built from source at
0.22.2, and the release scan was split so it can fail on an unfixed critical
instead of hiding it behind ignore-unfixed.

## Gates that could not fail

Two mutation lanes ran zero mutants because Stryker crawled the gitignored docs
build; coverage discarded its whole report on any failing test; the lint gate
skipped root tests, scripts, and two workspaces; and several generated matrices
counted a host missing ffmpeg as a passing tool. Each now measures what it
claims.

Full evidence and the outstanding release items are tracked locally and are not
part of this branch.
This commit is contained in:
SnapOtter
2026-07-27 15:37:30 +08:00
committed by GitHub
parent bc32f86a07
commit d10d0f544f
855 changed files with 54564 additions and 13092 deletions
+12 -24
View File
@@ -20,10 +20,16 @@ export async function login(page: Page, username = "admin", password = "admin")
// ---------------------------------------------------------------------------
let _testImagePath: string | null = null;
export function getE2eRunRoot(): string {
const runRoot = process.env.PLAYWRIGHT_RUN_ROOT;
if (!runRoot) throw new Error("PLAYWRIGHT_RUN_ROOT was not initialized by playwright.config.ts");
return runRoot;
}
export function getTestImagePath(): string {
if (_testImagePath && fs.existsSync(_testImagePath)) return _testImagePath;
const dir = path.join(process.cwd(), "test-results");
const dir = getE2eRunRoot();
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
_testImagePath = path.join(dir, "test-image.png");
@@ -226,25 +232,10 @@ export async function changePasswordViaApi(
export const test = base.extend<{ loggedInPage: Page }>({
loggedInPage: async ({ page }, use) => {
// storageState is already loaded by the project config, just navigate
// storageState is already loaded by the project config. Each Playwright
// invocation owns a fresh database, so this fixture must not mutate shared
// system settings before every test.
await page.goto("/");
// Self-heal global server settings a crashed predecessor may have left
// mutated. defaultToolView=fullscreen would redirect "/"; a stale locale
// would translate the whole UI. loginAttemptLimit is the important one:
// saving System Settings persists it at the UI default ("5"), which
// overrides the env LOGIN_ATTEMPT_LIMIT=100000 and 429s every later admin
// login, cascading into "create user 401" failures across the serial run.
const healed = await putSettings(page, {
defaultToolView: "sidebar",
defaultLocale: "en",
loginAttemptLimit: "100000",
});
if (!healed.ok) {
console.warn(`loggedInPage settings heal failed with status ${healed.status}`);
}
if (page.url().includes("/fullscreen")) {
await page.goto("/");
}
await use(page);
},
});
@@ -278,13 +269,10 @@ export async function openSettings(page: Page): Promise<void> {
const width = page.viewportSize()?.width ?? 1280;
if (width < 768) {
// Mobile: Settings lives in the fixed bottom nav.
await page
.getByRole("button", { name: /settings/i })
.first()
.click();
await page.getByTestId("open-settings").click();
} else {
await page.getByTestId("user-menu").click();
await page.getByRole("button", { name: "Settings", exact: true }).click();
await page.getByTestId("open-settings").click();
}
await page.getByRole("dialog").waitFor({ state: "visible", timeout: 5000 });
}