mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
+72
-22
@@ -38,6 +38,7 @@ jobs:
|
||||
outputs:
|
||||
code: ${{ steps.filter.outputs.code }}
|
||||
landing: ${{ steps.filter.outputs.landing }}
|
||||
docs: ${{ steps.filter.outputs.docs }}
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- id: filter
|
||||
@@ -53,10 +54,12 @@ jobs:
|
||||
base="$PUSH_BEFORE_SHA"
|
||||
fi
|
||||
# `code`: anything outside the docs/landing surfaces changed (gates the
|
||||
# main pipeline). `landing`: the landing's own surface changed (gates the
|
||||
# landing e2e job). Both fail open to true when the base is unknown.
|
||||
# main pipeline). `landing` and `docs`: that surface's own files changed
|
||||
# (gates its e2e job). All three fail open to true when the base is
|
||||
# unknown.
|
||||
code=true
|
||||
landing=true
|
||||
docs=true
|
||||
if [ -n "$base" ] && [ "$base" != "0000000000000000000000000000000000000000" ]; then
|
||||
if git fetch --no-tags --depth=1 origin "$base" && git cat-file -e "$base" 2>/dev/null; then
|
||||
changed=$(git diff --name-only "$base" HEAD)
|
||||
@@ -75,6 +78,12 @@ jobs:
|
||||
apps/landing/*|tests/e2e-landing/*|playwright.landing.config.ts|packages/shared/*) landing=true; break ;;
|
||||
esac
|
||||
done
|
||||
docs=false
|
||||
for f in $changed; do
|
||||
case "$f" in
|
||||
apps/docs/*|tests/e2e-docs/*|playwright.docs.config.ts) docs=true; break ;;
|
||||
esac
|
||||
done
|
||||
else
|
||||
echo "Base commit unavailable; running the full pipeline"
|
||||
fi
|
||||
@@ -83,6 +92,7 @@ jobs:
|
||||
fi
|
||||
echo "code=$code" >> "$GITHUB_OUTPUT"
|
||||
echo "landing=$landing" >> "$GITHUB_OUTPUT"
|
||||
echo "docs=$docs" >> "$GITHUB_OUTPUT"
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
@@ -95,6 +105,8 @@ jobs:
|
||||
- run: pnpm lint
|
||||
- name: License boundary check (D15)
|
||||
run: pnpm check:license-boundary
|
||||
- name: Production Node dependency license and notices check
|
||||
run: pnpm check:production-node-licenses
|
||||
|
||||
typecheck:
|
||||
name: Typecheck
|
||||
@@ -371,6 +383,44 @@ jobs:
|
||||
path: playwright-report/
|
||||
retention-days: 7
|
||||
|
||||
test-e2e-docs:
|
||||
name: E2E Docs (Chromium)
|
||||
runs-on: ubuntu-latest
|
||||
# vitepress build renders ~3,800 pages and then runs Pagefind over them,
|
||||
# which the config allows up to 10 minutes for on a loaded machine.
|
||||
timeout-minutes: 30
|
||||
needs: changes
|
||||
if: needs.changes.outputs.docs == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- 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 docs e2e suite
|
||||
# Static VitePress site with no database, so no Postgres/Redis services.
|
||||
# The suite's webServer builds the site and serves the preview itself.
|
||||
# This job is path-filtered like the landing one, so a docs-only PR gets
|
||||
# a real check instead of the nothing it used to get, and a code-only PR
|
||||
# still reports a conclusion via the skip.
|
||||
run: pnpm test:e2e:docs
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Upload report on failure
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
if: failure()
|
||||
with:
|
||||
name: e2e-docs-report
|
||||
path: playwright-report/
|
||||
retention-days: 7
|
||||
|
||||
pip-audit:
|
||||
name: Python Dependency Audit
|
||||
runs-on: ubuntu-latest
|
||||
@@ -385,31 +435,31 @@ jobs:
|
||||
|
||||
- run: pip install "pip-audit==2.10.0"
|
||||
- name: Run pip-audit (ignoring CVEs blocked by dependency constraints)
|
||||
# CVE-2025-3000: torch 2.12.0, no fixed release available as of 2026-06-11
|
||||
# Three entries, each one live against the current lock. 19 others were
|
||||
# dropped after a re-audit showed the pins had moved past them: five
|
||||
# Pillow (all fixed at or below 12.2.0, lock pins 12.3.0), twelve torch
|
||||
# (all last_affected at or below 2.10.0, resolves to 2.13.0), joblib
|
||||
# (not in the closure), markdown (last_affected 3.8, resolves 3.10.2).
|
||||
# PYSEC-2025-194 was a duplicate of CVE-2025-3000, which is itself now
|
||||
# dead. Re-check the three below whenever requirements.txt moves.
|
||||
#
|
||||
# CVE-2024-27763: basicsr, no fixed release exists in any channel.
|
||||
# CVE-2026-40086 + GHSA-55v6-g8pm-pw4c: rembg 2.0.69. The fix is
|
||||
# rembg 2.0.75, held back by the numpy 1.26.4 pin (see the rationale
|
||||
# in packages/ai/python/requirements.txt).
|
||||
run: >-
|
||||
pip-audit -r packages/ai/python/requirements.txt
|
||||
--ignore-vuln CVE-2024-27763
|
||||
--ignore-vuln CVE-2025-3000
|
||||
--ignore-vuln CVE-2026-40086
|
||||
--ignore-vuln CVE-2026-25990
|
||||
--ignore-vuln CVE-2026-40192
|
||||
--ignore-vuln GHSA-55v6-g8pm-pw4c
|
||||
--ignore-vuln CVE-2026-42308
|
||||
--ignore-vuln CVE-2026-42310
|
||||
--ignore-vuln CVE-2026-42311
|
||||
--ignore-vuln PYSEC-2025-189
|
||||
--ignore-vuln PYSEC-2025-190
|
||||
--ignore-vuln PYSEC-2025-191
|
||||
--ignore-vuln PYSEC-2025-192
|
||||
--ignore-vuln PYSEC-2025-193
|
||||
--ignore-vuln PYSEC-2025-194
|
||||
--ignore-vuln PYSEC-2025-195
|
||||
--ignore-vuln PYSEC-2025-196
|
||||
--ignore-vuln PYSEC-2025-197
|
||||
--ignore-vuln PYSEC-2025-210
|
||||
--ignore-vuln PYSEC-2026-139
|
||||
--ignore-vuln PYSEC-2024-277
|
||||
--ignore-vuln PYSEC-2026-89
|
||||
|
||||
- name: Audit exact OCR runtime dependency locks
|
||||
run: |
|
||||
for requirements in \
|
||||
docker/ocr-runtime-requirements-amd64.txt \
|
||||
docker/ocr-runtime-requirements-arm64.txt; do
|
||||
pip-audit -r "${requirements}" --no-deps --disable-pip --aliases
|
||||
done
|
||||
|
||||
build:
|
||||
name: Build
|
||||
|
||||
Reference in New Issue
Block a user