Commit Graph
34 Commits
Author SHA1 Message Date
Lucas Berger 2d329a97b2 ci(260613-dmw): exclude .gitea/** from heavy-job paths-filter (treat CI edits like docs)
Workflow-only edits shouldn't pay for the multi-minute MariaDB/integration/harness
suite. A negation '- !.gitea/**' (ordered after the yml/yaml globs) makes CI-config-
only PRs resolve code=false so api/harness skip like docs. fast-checks (format:check
still validates the workflow YAML) + gate continue to gate them. PRs that also touch
app code or lockfile still resolve code=true and run the full suite.
2026-06-13 09:51:41 -04:00
Lucas Berger 8154ba6f35 style(16): apply prettier formatting to satisfy CI format:check
CI / changes (pull_request) Successful in 2s
CI / fast-checks (pull_request) Successful in 1m23s
CI / api (pull_request) Successful in 1m0s
CI / harness (pull_request) Successful in 3m54s
CI / security (pull_request) Successful in 40s
CI / gate (pull_request) Successful in 1s
2026-06-13 09:29:02 -04:00
Lucas Berger 3daa351d70 fix(16): WR-02/WR-05 robust boot-smoke and active .dockerignore checks
WR-02: capture docker run exit directly (not the piped head exit) so a
chatty booting image can't SIGPIPE to 141 and false-PASS; require the
FATAL guard marker in output as a positive assertion.
WR-05: strip comment lines and use anchored fixed-string (grep -qF)
matching so a commented-out rule can't satisfy the hygiene check and
patterns aren't treated as regexes.
2026-06-13 08:43:16 -04:00
Lucas Berger 26a6b2e53f fix(16): WR-01/WR-03 bind PR context via env; symmetric HEAD_SHA fallback
Bind github.base_ref/base.sha/head.sha through env: and reference quoted
shell vars (no inline ${{ }} in run:) to close the script-injection vector.
Add a HEAD_SHA rev-parse fallback mirroring BASE_SHA and echo the final
${BASE_SHA}..${HEAD_SHA} range before gitleaks.
2026-06-13 08:42:40 -04:00
Lucas Berger 27046dbf92 ci(16-06): add static image-hygiene assertion + boot-smoke before push
- Static assertions step: verifies .dockerignore exists, covers all forbidden
  patterns (.env, node_modules, apps/api/scripts, .git, .planning, apps/api/tests,
  apps/pwa/e2e), and --target production is still pinned in publish.yml (T-16-19)
- Boot-smoke step: runs freshly-built sha_tag image with NODE_ENV=production +
  DEV_AUTH_BYPASS=true; fails if image starts (EXIT==0) or times out (EXIT==124),
  passes on any other non-zero exit — proves D-08 guard fires in shipped image (T-16-18)
- Both steps ordered after build and before push; a hygiene failure blocks publish (T-16-20)
2026-06-13 08:27:13 -04:00
Lucas Berger bc00f3e815 ci(16-06): split publish build and push into separate steps
- Separate 'Build and push' into 'Build production image' (build only) and 'Push image' steps
- Creates insertion point between build and push for hygiene assertions (Task 2)
- Preserves --target production, Dockerfile path, both tags, and root context
- WR-04 immutable-tag-first push ordering preserved in push step
2026-06-13 08:26:32 -04:00
Lucas Berger f0f7d8a9f4 ci(16-05): wire security job into gate aggregator
- gate needs: expanded to include security
- individual needs.security.result check added (requires success, not success-or-skipped)
- security not folded into api/harness for loop — gitleaks always runs so it cannot be skipped
- follows Gitea #31007 individual needs.X.result pattern
2026-06-13 08:23:20 -04:00
Lucas Berger 61b758648f ci(16-05): add security job (gitleaks always; audit/outdated code-gated)
- New security job parallel to fast-checks, needs: [changes], if: pull_request
- actions/checkout@v4 with fetch-depth: 0 (Pitfall 3 — base.sha must be local)
- Probe PR base/head SHA step with git merge-base fallback (A2 / OQ-1)
- Install gitleaks v8.30.1 from GitHub releases (pinned, no actions/cache)
- Secret scan step (no if:) — blocking, uses .gitleaks.toml + baseline
- setup-node/pnpm/audit/outdated steps each gated by needs.changes.outputs.code
2026-06-13 08:22:52 -04:00
Lucas Berger da623ac234 docs(15-03): update publish.yml safety-gate comment to name new required checks
- Replace "three required checks (CI / fast-checks, CI / api, CI / harness)"
  with the new gating surface: CI / fast-checks + CI / gate
- Note that CI / api and CI / harness are conditionally skipped on doc-only PRs
  and gated via the always-running CI / gate aggregate
- Comment-only change; no job/step/env/trigger modified
2026-06-12 10:56:03 -04:00
Lucas Berger 547b12ca4a feat(15-02): add always-running gate aggregate job (Gitea-safe per-job result checks)
- gate job needs [fast-checks, changes, api, harness] with if: always()
- gate fails (exit 1) when fast-checks != success
- gate accepts success OR skipped for api and harness, fails on any other result
- uses individual needs.X.result checks (not wildcard) — Gitea 1.26.2 bug #31007
- once merged, emits CI / gate commit-status required by Plan 03 branch-protection update
2026-06-12 10:52:18 -04:00
Lucas Berger 72604385bc feat(15-02): add changes job and gate api/harness on code output
- insert changes job (dorny/paths-filter@v4) before fast-checks
- changes job: permissions pull-requests:read, outputs code, no checkout
- code filter lists positive patterns: **/*.ts, apps/**, pnpm-lock.yaml, Dockerfile, etc.
- api job: needs [changes] + if combined with needs.changes.outputs.code == 'true'
- harness job: same needs/if pattern as api
- services, env, and step bodies unchanged in both heavy jobs
2026-06-12 10:51:20 -04:00
Lucas Berger 46bea03757 feat(15-01): fix 13 markdown violations + wire md:lint to fast-checks CI step
- Fix MD040 (11 bare fences): add language tags (text/bash) across 7 files
- Fix MD031 (2 violations): add blank lines around fence in GETTING-STARTED.md
- Wire 'Markdown lint' step to fast-checks job (after Format check, before Typecheck)
- Reformat .markdownlint-cli2.jsonc per Prettier (trailing commas in JSONC)
- pnpm md:lint exits 0; pnpm format:check exits 0; gate can fail on bare fence (verified)
2026-06-12 10:46:01 -04:00
Lucas Berger bfc49d199d chore(14-01): update spec headers + README for desktop profile, cosmetic CI step rename
- Updated calendar.spec.ts header to list all three profiles (iphone/pixel/desktop)
- Updated lists.spec.ts header to list all three profiles (iphone/pixel/desktop)
- Updated e2e/README.md preamble to add 'Desktop Chrome (1280x720)'
- Added --project=desktop example to README run-commands block
- Updated README full-suite command comment to name all three profiles
- Cosmetic: ci.yml step-name and comment updated to mention desktop (no plumbing change)
- Full suite verified: 85 passed, 5 skipped (3 desktop geometry + 2 parity guards), 0 failed
2026-06-12 08:23:10 -04:00
Lucas Berger fc5b06d343 Merge remote-tracking branch 'origin/main' into gsd/phase-13-real-lint-gate-eslint
CI / fast-checks (pull_request) Failing after 1m47s
CI / api (pull_request) Successful in 1m0s
CI / harness (pull_request) Successful in 3m30s
# Conflicts:
#	.planning/ROADMAP.md
2026-06-11 21:25:14 -04:00
Lucas Berger 0422406c42 feat(13-03): add Format check CI step; remove stale no-op lint comment
- Insert 'Format check: pnpm format:check' after Lint in fast-checks job
- Remove the 3-line comment that said lint was a no-op (no longer true)
- Step order: Install → Lint → Format check → Typecheck → PWA unit tests
- Branch-protection contexts (name:CI, fast-checks, api, harness) unchanged
2026-06-11 20:35:44 -04:00
Lucas Berger 4001cd5b90 fix(08-fix): WR-04 push immutable sha tag before :latest with strict shell 2026-06-11 19:27:07 -04:00
Lucas Berger 58861d99a8 fix(08-fix): WR-05 bind REGISTRY_PAT via env: and pipe with printf for docker login 2026-06-11 19:27:03 -04:00
Lucas Berger 6bcf867e6c fix(08-fix): WR-03 fail closed on empty GITHUB_SHA when computing image tags 2026-06-11 19:26:53 -04:00
Lucas Berger 44a9c307e2 fix(08-fix): WR-02 upload Playwright HTML report on harness failure 2026-06-11 19:26:28 -04:00
Lucas Berger bb331fd110 chore(260611-ozt): split publish job into standalone publish.yml
- Create .gitea/workflows/publish.yml (push-to-main only, name=Publish)
- Strip publish job, push trigger, and MILESTONE env from ci.yml
- Eliminates orphaned CI / publish (pull_request) status on PRs
- Preserves all three required PR status contexts unchanged
2026-06-11 18:06:46 -04:00
Lucas Berger 73eecf7559 fix(08-04): reference secrets.REGISTRY_PAT — Gitea reserves the GITEA_ prefix
CI / fast-checks (pull_request) Successful in 49s
CI / api (pull_request) Successful in 57s
CI / harness (pull_request) Successful in 3m30s
CI / publish (pull_request) Has been skipped
The registry PAT secret had to be named REGISTRY_PAT (Gitea forbids the GITEA_
prefix for secret names). Point the publish docker-login at secrets.REGISTRY_PAT.
2026-06-11 16:05:54 -04:00
Lucas Berger dcf42423a5 chore(08): remove throwaway runner-probe workflow before merge to main
CI / fast-checks (pull_request) Successful in 50s
CI / api (pull_request) Successful in 56s
CI / harness (pull_request) Successful in 3m27s
CI / publish (pull_request) Has been skipped
Probe answers are recorded in 08-01-SUMMARY; the probe is no longer needed and
should not live on main (it was workflow_dispatch-only/inert anyway).
2026-06-11 15:57:49 -04:00
Lucas Berger ebcc38d810 feat(08-04): publish job — build + push API image on merge to main
- Add publish job gated on push to refs/heads/main (never pull_request)
- docker login via --password-stdin with secrets.GITEA_REGISTRY_PAT (Pitfall 13)
- docker build --target production -f apps/api/Dockerfile . (repo-root context, T-08-10)
- Push :latest and :${MILESTONE}-${SHORT_SHA} tags per D-04
- docker logout in always() step to drop credential after push
- No dev-bypass flag in publish job (T-08-09 boundary)
2026-06-11 15:56:37 -04:00
Lucas Berger 03e8088238 fix(08-03): call pwa test:e2e directly so --reporter forwards cleanly
CI / fast-checks (pull_request) Successful in 49s
CI / api (pull_request) Successful in 1m0s
CI / harness (pull_request) Successful in 3m26s
Run #10 cleared global-setup but playwright errored 'No tests found':
`pnpm test:e2e -- --reporter=list,html` routes through two pnpm script layers
(root→pwa) and the `--` survives into `playwright test -- --reporter=list,html`,
where playwright treats --reporter as a test-file filter. Call the pwa script
directly and append the flag without `--` (validated: 58 specs list vs 0).
2026-06-11 15:43:09 -04:00
Lucas Berger e486c6be9f fix(08-03): seed dev user id=1 — global-setup assumes it exists
CI / fast-checks (pull_request) Successful in 48s
CI / api (pull_request) Successful in 56s
CI / harness (pull_request) Failing after 2m0s
global-setup.ts seeds calendars/lists/events for user_id=1 but never creates
the user (DEV_AUTH_BYPASS injects DEV_USER in-memory only). On a fresh CI DB the
calendars INSERT IGNORE is silently skipped on the users FK → calendar 10 missing
→ calendar_events insert fails FK. Add an idempotent users(id=1) seed after
migrate (validated locally: full insert chain passes). No harness files changed.
2026-06-11 15:36:52 -04:00
Lucas Berger 73897407c7 fix(08-03): harness uses 127.0.0.1 + ipv4first — Vite is IPv4-only
CI / fast-checks (pull_request) Successful in 50s
CI / api (pull_request) Successful in 56s
CI / harness (pull_request) Failing after 1m49s
global-setup polls baseURL/health via Node fetch; the runner resolves localhost
to ::1 first, but Vite binds IPv4-only (127.0.0.1:5173), so localhost→::1:5173
→ ECONNREFUSED → health poll never returns 200. (curl passed for :3000 because
curl falls back IPv4↔IPv6 and the API is dual-stack; Node fetch does not.)
Proven: [::1]:5173 ECONNREFUSED vs 127.0.0.1:5173 200. Point PLAYWRIGHT_BASE_URL
at 127.0.0.1 and add --dns-result-order=ipv4first. No harness files changed.
2026-06-11 15:20:24 -04:00
Lucas Berger 53a989c3fb fix(08-03): keep API alive during harness — start API + run e2e in one step
CI / fast-checks (pull_request) Successful in 49s
CI / api (pull_request) Successful in 56s
CI / harness (pull_request) Failing after 2m50s
Run #7 harness failed: global-setup polled :5173/health (Vite proxy → :3000)
and never got 200. The API connected to the DB and :3000/health was green
during the separate 'Wait for API' step, but the bare-backgrounded node
process was reaped at the step boundary and was dead by the time the e2e step
ran (after the multi-minute browser install). Confirmed locally the API does
not self-crash (alive + healthy for 75s in-shell).

Install browsers first, then start the API and run Playwright in a SINGLE step
so the API stays a child of the test shell for the whole run; capture the test
exit code and kill the API after. No harness files touched.
2026-06-11 15:05:04 -04:00
Lucas Berger 71c89093b1 feat(08-03): add Playwright install + harness run (both profiles) + artifact upload
CI / fast-checks (pull_request) Successful in 48s
CI / api (pull_request) Successful in 56s
CI / harness (pull_request) Failing after 2m53s
- npx playwright install --with-deps webkit chromium from apps/pwa/ (D-PROBE-05)
- pnpm test:e2e -- --reporter=list,html overrides github reporter (Pitfall 5; Gitea ignores annotations)
- Both iphone (WebKit) + pixel (Chromium) profiles run (D-05; no --project filter)
- Step env: CI=true, PLAYWRIGHT_BASE_URL=http://localhost:5173, DEV_AUTH_BYPASS=true, NODE_ENV=development, DB_*
- On failure: upload apps/pwa/test-results/ via ChristopherHX/gitea-upload-artifact@v4 (D-06/D-PROBE-06)
- Always: kill API background process via /tmp/api.pid
- No edits to playwright.config.ts / global-setup.ts / vite.config.ts / specs (phase boundary)
2026-06-11 14:45:52 -04:00
Lucas Berger d55e347a09 feat(08-03): add harness job — DB + migrate + API background + :3000 readiness
- Add harness job to ci.yml (ubuntu-latest, pull_request, parallel with fast-checks + api)
- MariaDB 11 service container with healthcheck.sh readiness (same pattern as api job)
- mysql2 readiness poll (no mysql CLI in runner image, D-PROBE-03)
- db:migrate via drizzle-kit (never db:push, T-08-07)
- pnpm --filter @familysync/api build before starting (Pitfall 4)
- API background: DEV_AUTH_BYPASS=true inline on node line (Pitfall 8), NODE_ENV=development
- curl retry loop on localhost:3000/health, 60s deadline, kill+exit on timeout (D-02/T-08-08)
2026-06-11 14:45:07 -04:00
Lucas Berger 0b148b96f8 chore(08-01): probe to manual-only (workflow_dispatch)
CI / fast-checks (pull_request) Successful in 48s
CI / api (pull_request) Successful in 57s
Stops the throwaway probe re-running on every push and contending with
ci.yml on the single runner. Fork answers already captured in 08-01-SUMMARY.
2026-06-11 14:29:38 -04:00
Lucas Berger 3343f36e97 feat(08-02): ci.yml api job with mariadb service
runner-probe / runner-probe (push) Successful in 1m47s
CI / fast-checks (pull_request) Failing after 22s
CI / api (pull_request) Failing after 26s
- api job: runs-on ubuntu-latest, if pull_request, parallel with fast-checks (no needs:)
- services: mariadb:11 with healthcheck.sh --connect --innodb_initialized options
  (--health-start-period=30s for MariaDB 11 InnoDB cold-start, --health-retries=10)
- DB_HOST: mariadb (Docker-executor confirmed by D-PROBE-02)
- Throwaway creds: familysync/testpass scoped to ephemeral service container (T-08-03)
- No actions/cache (D-PROBE-04)
- Node mysql2 readiness poll via --input-type=commonjs inline script, 90s deadline
  (no mysql CLI in runner image per D-PROBE-03; Pitfall 11 belt-and-suspenders)
- db:migrate (drizzle-kit migrate); drizzle push never used (T-08-04, MariaDB unsafe)
- pnpm --filter @familysync/api test: full DB-backed API test suite
2026-06-11 10:22:45 -04:00
Lucas Berger 667f01702c feat(08-02): ci.yml fast-checks job
- on: pull_request + push branches:[main]; workflow env MILESTONE: v1.1
- fast-checks job: runs-on ubuntu-latest, if pull_request
- Node 22 via actions/setup-node@v4 + corepack enable pnpm
- No actions/cache (D-PROBE-04: times out on this runner)
- pnpm install --frozen-lockfile, lint (no-op), typecheck, PWA unit tests
- DB-backed pnpm test intentionally absent from this job
2026-06-11 10:21:17 -04:00
Lucas Berger 134d4db08a fix(08-01): probe runs-on ubuntu-latest — runner has no self-hosted label
runner-probe / runner-probe (push) Successful in 5m33s
The act_runner advertises ubuntu-latest/ubuntu-24.04/ubuntu-22.04; runs-on:
self-hosted matched no runner and the probe job stayed queued. Switch the
probe (and the plan key-link) to ubuntu-latest. ci.yml (Plans 02-04) must
use the same label.
2026-06-11 10:04:41 -04:00
Lucas Berger b333d7b7ea feat(08-01): add runner-probe workflow
- Probe-only workflow triggering on gsd/phase-08-gitea-ci branch only
- Answers P-01..P-11 + P-13: Node version, pnpm, runner mode (critical
  fork Docker vs host), Docker socket, MariaDB service container spawn
  and reachability on both hostnames, actions/cache, Playwright WebKit
  deps, gitea-upload-artifact fork, and GITHUB_SHA short-SHA expression
- Uses healthcheck.sh --connect --innodb_initialized for MariaDB (never
  the binary removed from mariadb:11 — Pitfall 11)
- Uses ChristopherHX/gitea-upload-artifact@v4 (not the official action
  which aborts on Gitea with GHES detection — Pitfall 6 / T-08-SC)
- P-12 (docker login) deferred to Plan 04 — probe never references any
  secret (T-08-01 compliant)
- All steps that may fail use continue-on-error: true so probe reports
  findings instead of red-failing on expected unknowns
2026-06-11 09:53:13 -04:00