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
+105 -6
View File
@@ -52,7 +52,10 @@ jobs:
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install system dependencies
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends $SYSTEM_DEPS
run: |
read -r -a system_deps <<< "$SYSTEM_DEPS"
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends "${system_deps[@]}"
- uses: ./.github/actions/setup
- name: Get Playwright version
id: pw-version
@@ -106,7 +109,10 @@ jobs:
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install system dependencies
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends $SYSTEM_DEPS
run: |
read -r -a system_deps <<< "$SYSTEM_DEPS"
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends "${system_deps[@]}"
- uses: ./.github/actions/setup
- name: Get Playwright version
id: pw-version
@@ -120,6 +126,11 @@ jobs:
run: pnpm playwright install --with-deps chromium
- name: Run serial bucket (global-state specs)
run: pnpm playwright test --project=chromium-serial --workers=1
# chromium-widths owns the exact CSS boundary and wide-screen assertions.
# It is five plain functional specs with no screenshot baselines, so it
# runs here rather than needing the platform-suffixed visual machinery.
- name: Run viewport-width bucket
run: pnpm playwright test --project=chromium-widths --workers=1
- name: Upload report on failure
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: failure()
@@ -128,6 +139,81 @@ jobs:
path: playwright-report/
retention-days: 7
# The editor, the analytics opt-out flow and the AUTH_ENABLED=false mode each
# have their own Playwright config and, until now, no workflow at all: 174 + 9
# + 5 tests that collected and passed locally but gated nothing. All three need
# Postgres and Redis and build the web app themselves, so they share a runner.
e2e-surfaces:
name: E2E Editor + Analytics Opt-Out + No-Auth
runs-on: ubuntu-latest
# The editor suite is 174 tests pinned to workers: 1 by its own config and
# took 23.4 minutes on a loaded dev machine, so leave real headroom for it
# plus the apt install, the browser download and the two smaller suites.
timeout-minutes: 60
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_USER: snapotter
POSTGRES_PASSWORD: snapotter
POSTGRES_DB: snapotter
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U snapotter"
--health-interval 5s
--health-timeout 3s
--health-retries 10
redis:
image: redis:8-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install system dependencies
run: |
read -r -a system_deps <<< "$SYSTEM_DEPS"
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends "${system_deps[@]}"
- uses: ./.github/actions/setup
- name: Get Playwright version
id: pw-version
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.pw-version.outputs.version }}
- name: Install Playwright Chromium
run: pnpm playwright install --with-deps chromium
- name: Run editor suite
run: pnpm playwright test --config playwright.editor.config.ts
env:
PW_WORKERS: "2"
- name: Run analytics opt-out suite
# The in-repo docker/feature-manifest.json makes the API believe it is
# inside a container and mkdir /data; this config does not pin DATA_DIR
# itself, so pin it here the way playwright.config.ts does.
run: pnpm test:e2e:analytics
env:
DATA_DIR: ${{ runner.temp }}/analytics-local-data
- name: Run no-auth mode suite
# AUTH_ENABLED=false injects a synthetic anonymous admin. Nothing else in
# CI exercises that path, so a regression only surfaced on a user's box.
run: pnpm test:e2e:noauth
- name: Upload report on failure
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: failure()
with:
name: e2e-surfaces-report
path: playwright-report/
retention-days: 7
e2e-cross-browser:
name: E2E Cross-Browser (Firefox + WebKit)
runs-on: ubuntu-latest
@@ -210,7 +296,10 @@ jobs:
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install system dependencies
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends $SYSTEM_DEPS
run: |
read -r -a system_deps <<< "$SYSTEM_DEPS"
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends "${system_deps[@]}"
- uses: ./.github/actions/setup
- name: Get Playwright version
id: pw-version
@@ -266,7 +355,10 @@ jobs:
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install system dependencies
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends $SYSTEM_DEPS
run: |
read -r -a system_deps <<< "$SYSTEM_DEPS"
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends "${system_deps[@]}"
- name: Allow ImageMagick to read EPS/PS via Ghostscript delegate
run: |
POLICY_FILE=$(find /etc/ImageMagick* -name policy.xml 2>/dev/null | head -1)
@@ -292,6 +384,7 @@ jobs:
FULL_MATRIX: "1"
FUZZ: "1"
FUZZ_RUNS: "50"
REQUIRE_AI_FEATURES: "1"
# Full-matrix tests iterate every format x tool; with 4 forks the heavy
# media conversions starve and hit the 30s default. Fewer forks (more
# CPU each) plus a generous timeout keeps them from flaking.
@@ -329,7 +422,10 @@ jobs:
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install system dependencies
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends $SYSTEM_DEPS
run: |
read -r -a system_deps <<< "$SYSTEM_DEPS"
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends "${system_deps[@]}"
- uses: ./.github/actions/setup
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
@@ -392,7 +488,10 @@ jobs:
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install system dependencies
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends $SYSTEM_DEPS
run: |
read -r -a system_deps <<< "$SYSTEM_DEPS"
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends "${system_deps[@]}"
- name: Allow ImageMagick to read EPS/PS via Ghostscript delegate
run: |
POLICY_FILE=$(find /etc/ImageMagick* -name policy.xml 2>/dev/null | head -1)