CI: one pipeline to the CI standard: PHP 8.4 lint, audits, scans, API and MCP tests (#136) #139

Open
jared wants to merge 3 commits from ci-standard into development
pull from: ci-standard
3 Commits
Author SHA1 Message Date
jaredandClaude Opus 5.5 8e57233f92 CI: one pipeline to the CI standard: PHP 8.4 lint, audits, scans, API and MCP tests (#136)
CI / Lint (PHP 8.4, phpcs, eslint) (pull_request) Successful in 1m17s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Successful in 1m58s
CI / API and MCP (PHP 8.4, MariaDB) (pull_request) Successful in 1m56s
CI / UI (playwright) (pull_request) Successful in 2m10s
CI / Security (composer and npm audit) (pull_request) Successful in 1m42s
CI / Deploy (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 5m3s
Replaces lint.yml and security.yml with .gitea/workflows/ci.yml, following
the shared CI standard (wiki: Infrastructure/ci-standard, modelled on
Pulse and Thor). Deploys now wait for every check.

Jobs:
- Lint: php -l on every file and scripts/check_requirements.php under
  PHP 8.4 (node:22-trixie, Debian 13's packages, as on CT 132); phpcs
  4.0.4 pinned with SHA-256 (was the abandoned squizlabs build, unpinned);
  eslint 8.57.1 from tests/lint/ (lockfile, was `npm install eslint@8`)
  with --max-warnings=66, today's count, so warnings can only go down.
- Security: composer validate --strict, composer audit --locked
  --abandoned=fail, npm audit (high) and audit signatures for the test
  tooling. The audit found symfony/http-client advisories (fixed by the
  lock bump, #137) and mcp/sdk GHSA-f4rf-6ghj-mhr6, ignored with its
  reason in composer.json until #138 (Tinker uses neither affected
  middleware).
- Scan: gitleaks over the full history (#134; the five findings in 527
  commits were the YOUR_API_KEY placeholder on the API keys page,
  allowlisted for that file only in .gitleaks.toml), actionlint,
  shellcheck, zizmor, and semgrep with p/javascript, p/secrets and
  p/security-audit added to the existing packs (no new findings).
- API and MCP: fresh MariaDB, migrations, seed, fixtures; then
  tests/api/mcp_test.php (MCP comment and link tools, 30 checks) and
  tests/api/test_api.py (the Bearer API contract automated reporters
  rely on, 132 checks: dedup by key and title, escalation, the reopen
  window under three Workflow Designer setups, recurrence chains,
  concurrent creates, lookup by dedup_key, source filter, link API).
  These were the local checks of #124/#131 and #121/#124.
- UI and UI screenshots as before (#120).
- API and UI fail on any PHP warning, notice or deprecation in the
  server log (tests/ci/php-warnings.sh): #130's warnings logged while
  every page still rendered.
- Every job has a timeout; runs are grouped per ref; deploys queue and
  are never cancelled; the weekly run re-audits and re-scans.
- Notify: Matrix alert on any failure on a deploy branch or in the
  weekly run, and on every deploy (was: lint failures only).

tests/ui/setup.sh moves to tests/ci/setup.sh (the lint, audit and API
jobs use it too) and takes WITH_DB=0 and EXTRA_PKGS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-29 00:20:16 -05:00
jaredandClaude Opus 5.5 fd7d3f9d22 deps: symfony/http-client 7.4.19 -> 7.4.25 (six advisories)
composer audit reports six advisories against symfony/http-client
7.4.19, fixed in 7.4.23/7.4.24: CVE-2026-121971, CVE-2026-123119,
CVE-2026-133750, CVE-2026-133757, CVE-2026-133758, CVE-2026-134792
(credentials sent to other origins, cached responses shared between
users, DNS rebinding past NoPrivateNetworkHttpClient, proxy chosen by a
request header). The MCP endpoint uses the client to fetch Authelia's
OIDC discovery and JWKS.

`composer update symfony/http-client --with-dependencies` (platform PHP
8.2, as composer.json sets): http-client 7.4.25, http-client-contracts,
service-contracts and deprecation-contracts 3.8.1, polyfill-php83 1.43.0.
composer.json is unchanged (^7.3 already allows it); deploys run
composer install from the lock.

Found by the composer audit step being added to CI (#136).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-29 00:17:25 -05:00
jaredandClaude Opus 5.5 006b7ef7bc Add Playwright UI tests and before/after screenshots to CI
Lint / UI screenshots (before/after) (push) Skipped
Lint / JS (eslint) (push) Successful in 16s
Lint / PHP (phpcs PSR-12) (push) Successful in 40s
Lint / PHP requirements (version + extensions) (push) Successful in 50s
Security / PHP Security (semgrep) (push) Successful in 2m43s
Lint / UI (playwright) (push) Successful in 3m41s
Lint / Deploy (push) Skipped
Lint / Notify on failure (push) Skipped
Lint / PHP (phpcs PSR-12) (pull_request) Successful in 42s
Lint / JS (eslint) (pull_request) Successful in 29s
Lint / PHP requirements (version + extensions) (pull_request) Successful in 1m29s
Lint / UI (playwright) (pull_request) Successful in 3m45s
Lint / Deploy (pull_request) Skipped
Lint / Notify on failure (pull_request) Skipped
Security / PHP Security (semgrep) (pull_request) Successful in 1m57s
Lint / UI screenshots (before/after) (pull_request) Successful in 5m28s
New UI (playwright) job: PHP and MariaDB inside the Playwright image, a
seeded instance (tests/ui/stack.sh, synthetic data only) and 21 tests:
every main page loads with no page errors, console errors or failed
requests, description and comment markdown render safely (#114), and
pages fit a phone screen. Deploys now wait for it.

New UI screenshots (before/after) job: for PRs that change assets/ or
views/, runs the base branch and the PR side by side with the same data
and uploads one side-by-side PNG per page and view (dark, light, phone).
Modelled on Pulse's ui and ui-screenshots jobs.

Fixes found while building it:
- migrate.php split statements on semicolons inside -- comments, so 001
  and 003 failed on a fresh database.
- API endpoints applied rate limiting before loading config, so
  RATE_LIMIT_DEFAULT/RATE_LIMIT_API from .env and TRUSTED_PROXIES were
  ignored there: every user behind the proxy shared one per-IP bucket.
  The limiter now loads config itself; the per-IP limits are configurable
  (RATE_LIMIT_IP, RATE_LIMIT_IP_API) with unchanged defaults.
- The avatar error fallback was registered in the footer, after the
  header avatar, so a fast 404 left a broken image instead of initials.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-29 00:05:00 -05:00