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

Merged
jared merged 1 commits from ci-standard into development 2026-11-29 16:25:59 -05:00
Owner

Part of #136: brings Tinker's CI up to the shared CI standard, which is modelled on Pulse and Thor. It builds on #120 (UI tests) and #137 (the symfony/http-client bump), both merged; this PR has been rebased onto them.

What changes

ci.yml replaces lint.yml and security.yml. Deploys now wait for every check; before, they waited for lint only.

Job What it checks Before
Lint php -l on every file under PHP 8.4; check_requirements.php; phpcs 4.0.4 (pinned, SHA-256 checked); eslint 8.57.1 from a lockfile, with --max-warnings=66 (today's count, so warnings can only go down) phpcs from the abandoned squizlabs URL (unpinned); npm install eslint@8; PHP from whatever the image had
Security composer validate --strict; composer audit --locked --abandoned=fail; npm audit (high) and npm audit signatures for the test tooling nothing
Scan gitleaks over the full history (#134); actionlint; shellcheck; zizmor; semgrep with p/javascript, p/secrets and p/security-audit added to p/php + p/owasp-top-ten semgrep only (unpinned)
API and MCP Fresh MariaDB, migrations, seed and fixtures, then: MCP tools (30 checks: comment edit and delete permissions, hidden tickets, nested replies, links) and the Bearer API contract (132 checks: dedup by key and title, escalation, the reopen window under all three Workflow Designer setups, recurrence chains, concurrent creates, ?dedup_key= lookup, the source filter, the link API) nothing; these were local checks in #121, #124 and #131
UI (playwright) and UI screenshots as in #120
PHP warnings gate (API and UI jobs) fails if the server log has any PHP warning, notice or deprecation. #130's warnings were logged while every page still rendered nothing
Notify Matrix alert on any failure on main/development or in the weekly run, and on every deploy lint failures only

Also:

  • every job has a timeout;
  • runs are grouped per ref, and superseded PR runs are cancelled;
  • deploys queue and are never cancelled mid-way;
  • the weekly run re-audits and re-scans;
  • ${{ }} values reach scripts only through env, as zizmor wants.

What the new checks found

  • composer audit:
    • six advisories in symfony/http-client 7.4.19. Fixed by #137 (merged).
    • mcp/sdk 0.8.1, GHSA-f4rf-6ghj-mhr6 (low): only the SDK's /token and /register OAuth proxy endpoints are affected, and Tinker uses neither. It's ignored in composer.json with that reason, and the 0.9 upgrade (breaking auth API) is #138.
  • gitleaks, 527 commits, all branches: 5 findings, all the literal Bearer YOUR_API_KEY placeholder on the API keys help page. That's allowlisted in .gitleaks.toml for that file only. No real secret was ever committed.
  • semgrep with the extra packs, phpcs 4.0.4, zizmor and actionlint: clean.

Not in this PR

  • The em/en dash check is the standard's house-style rule, but 457 dashes in 75 files remain until #118. I'll add it with #118.
  • A verified deploy:
    • signed {ref, sha, ts};
    • a server-side script that deploys exactly that sha and rolls back;
    • a /health endpoint reporting the sha, which CI waits for.
    • That needs changes on CT 132, so it's a follow-up under #136.

⚠ Before the next development → main release: branch protection

main has required status checks named after the old jobs, e.g. Lint / PHP (phpcs PSR-12) (pull_request). Those never report after this, so a release PR would wait forever. Change them to:

  • CI / Lint (PHP 8.4, phpcs, eslint) (pull_request)
  • CI / Security (composer and npm audit) (pull_request)
  • CI / Scan (secrets, workflows, shell, patterns) (pull_request)
  • CI / API and MCP (PHP 8.4, MariaDB) (pull_request)
  • CI / UI (playwright) (pull_request)

Verified

  • First real CI run (before the rebase): every job green. The API job log shows MCP 30/30, API 132/132 under all three workflow setups, and "No PHP warnings" on PHP 8.4.
  • Locally, each check with its pinned version:
    • gitleaks 8.30.1 (clean with the allowlist);
    • actionlint 1.7.12 and zizmor 1.32.0 (clean);
    • semgrep 1.184.0 (0 findings);
    • phpcs 4.0.4 (clean);
    • eslint (0 errors, 66 warnings);
    • composer validate --strict and composer audit (pass);
    • shellcheck (clean).
  • The warnings gate catches all 6 lines in a server log from before #130's fix, and nothing in clean logs.

🤖 Generated with Claude Code

Part of #136: brings Tinker's CI up to the shared [CI standard](https://wiki.lotusguild.org/Infrastructure/ci-standard), which is modelled on Pulse and Thor. It builds on #120 (UI tests) and #137 (the symfony/http-client bump), both merged; this PR has been rebased onto them. ## What changes `ci.yml` replaces `lint.yml` and `security.yml`. **Deploys now wait for every check**; before, they waited for lint only. | Job | What it checks | Before | |---|---|---| | **Lint** | `php -l` on every file under **PHP 8.4**; `check_requirements.php`; phpcs 4.0.4 (pinned, SHA-256 checked); eslint 8.57.1 from a lockfile, with `--max-warnings=66` (today's count, so warnings can only go down) | phpcs from the abandoned squizlabs URL (unpinned); `npm install eslint@8`; PHP from whatever the image had | | **Security** | `composer validate --strict`; `composer audit --locked --abandoned=fail`; npm audit (high) and `npm audit signatures` for the test tooling | nothing | | **Scan** | gitleaks over the **full history** (#134); actionlint; shellcheck; zizmor; semgrep with `p/javascript`, `p/secrets` and `p/security-audit` added to `p/php` + `p/owasp-top-ten` | semgrep only (unpinned) | | **API and MCP** | Fresh MariaDB, migrations, seed and fixtures, then: **MCP tools** (30 checks: comment edit and delete permissions, hidden tickets, nested replies, links) and the **Bearer API contract** (132 checks: dedup by key and title, escalation, the reopen window under all three Workflow Designer setups, recurrence chains, concurrent creates, `?dedup_key=` lookup, the source filter, the link API) | nothing; these were local checks in #121, #124 and #131 | | **UI (playwright)** and **UI screenshots** | as in #120 | | | **PHP warnings gate** (API and UI jobs) | fails if the server log has any PHP warning, notice or deprecation. #130's warnings were logged while every page still rendered | nothing | | **Notify** | Matrix alert on any failure on `main`/`development` or in the weekly run, and on every deploy | lint failures only | Also: - every job has a timeout; - runs are grouped per ref, and superseded PR runs are cancelled; - deploys queue and are never cancelled mid-way; - the weekly run re-audits and re-scans; - `${{ }}` values reach scripts only through `env`, as zizmor wants. ## What the new checks found - **`composer audit`:** - six advisories in `symfony/http-client` 7.4.19. Fixed by **#137** (merged). - `mcp/sdk` 0.8.1, GHSA-f4rf-6ghj-mhr6 (low): only the SDK's `/token` and `/register` OAuth proxy endpoints are affected, and Tinker uses neither. It's ignored in `composer.json` with that reason, and the 0.9 upgrade (breaking auth API) is **#138**. - **gitleaks, 527 commits, all branches:** 5 findings, all the literal `Bearer YOUR_API_KEY` placeholder on the API keys help page. That's allowlisted in `.gitleaks.toml` for that file only. **No real secret was ever committed.** - **semgrep with the extra packs, phpcs 4.0.4, zizmor and actionlint:** clean. ## Not in this PR - **The em/en dash check** is the standard's house-style rule, but 457 dashes in 75 files remain until **#118**. I'll add it with #118. - **A verified deploy:** - signed `{ref, sha, ts}`; - a server-side script that deploys exactly that sha and rolls back; - a `/health` endpoint reporting the sha, which CI waits for. - That needs changes on CT 132, so it's a follow-up under #136. ## ⚠ Before the next `development` → `main` release: branch protection `main` has required status checks named after the old jobs, e.g. `Lint / PHP (phpcs PSR-12) (pull_request)`. Those never report after this, so a release PR would wait forever. Change them to: - `CI / Lint (PHP 8.4, phpcs, eslint) (pull_request)` - `CI / Security (composer and npm audit) (pull_request)` - `CI / Scan (secrets, workflows, shell, patterns) (pull_request)` - `CI / API and MCP (PHP 8.4, MariaDB) (pull_request)` - `CI / UI (playwright) (pull_request)` ## Verified - **First real CI run (before the rebase): every job green.** The API job log shows MCP 30/30, API 132/132 under all three workflow setups, and "No PHP warnings" on PHP 8.4. - **Locally, each check with its pinned version:** - gitleaks 8.30.1 (clean with the allowlist); - actionlint 1.7.12 and zizmor 1.32.0 (clean); - semgrep 1.184.0 (0 findings); - phpcs 4.0.4 (clean); - eslint (0 errors, 66 warnings); - `composer validate --strict` and `composer audit` (pass); - shellcheck (clean). - **The warnings gate** catches all 6 lines in a server log from before #130's fix, and nothing in clean logs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jared added 1 commit 2026-11-29 14:39:35 -05:00
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 1m13s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Successful in 1m48s
CI / API and MCP (PHP 8.4, MariaDB) (pull_request) Successful in 1m55s
CI / UI (playwright) (pull_request) Successful in 1m44s
CI / UI screenshots (before/after) (pull_request) Successful in 7s
CI / Security (composer and npm audit) (pull_request) Successful in 17m28s
CI / Deploy (pull_request) Skipped
CI / Notify (pull_request) Skipped
e758cc74d8
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]>
jared force-pushed ci-standard from 8e57233f92 to e758cc74d8 2026-11-29 14:39:35 -05:00 Compare
jared scheduled this pull request to auto merge when all checks succeed 2026-11-29 16:11:14 -05:00
jared merged commit 0f7ec06234 into development 2026-11-29 16:25:59 -05:00
jared deleted branch ci-standard 2026-11-29 16:26:06 -05:00
Sign in to join this conversation.