3.1 KiB
3.1 KiB
Flight Simulator — Workflow Rules
Change process (mandatory)
- Small, incremental changes — work is done one change at a time, in smaller parts; each part must be tested thoroughly with unit and e2e tests covering it before moving on.
- Feature branch + PR — every change lands on a feature branch off
master(no direct pushes to master). The branch carries the commits below; open a pull request tomaster. - Changelog entry — every such change is listed in
CHANGELOG.mdwith date, time and version (format:## v<version> — YYYY-MM-DD HH:MM, then bullet points of what changed). - Version bump — the version is updated in
package.json. - CI must pass — enforced by branch protection on
master(required status checkCI / build + unit + e2e (pull request)): the PR cannot be merged until CI is green. Merge via auto-merge (POST /repos/{owner}/{repo}/pulls/{n}/mergewith body{"do":"merge","merge_style":"merge","merge_when_checks_succeed":true}) so it merges automatically once CI passes. CI never deploys to production; its e2e runs against an isolated stack inside dind. - Tag + manual deploy after merge — once merged, tag the version on
master(e.g.v0.13.0). Production (https://flight.dev.kkhost.pl) is updated manually afterwards:docker compose up -d --buildon the host.
E2E tests (mandatory)
- Docker compose instance is the app under test — e2e always runs against a docker-compose build, never a local
next devon :3000 (dev builds don't render for non-loopback clients, and a second instance splits state). Locally that means the Traefik-routed instance athttps://flight.dev.kkhost.pl; in CI it is an isolated stack inside dind (docker-compose.ci.yml) — CI never deploys to or modifies production. - Update before testing (local) — deploy current code first:
docker compose up -d --build, then run the suite with plainnpx playwright test. The config's webServer block is off by default; setE2E_DEPLOY_CMDto have Playwright itself run a deploy command and wait for readiness. - Remote browsers — local runs drive browsers through the shared Playwright server at
192.168.1.4:3000(Docker image tag must match this repo's @playwright/test version, pinned in devDependencies). SetPW_REMOTE_BROWSER=0to run local chromium instead — CI does, because the remote server cannot reach a stack inside dind. - CI env vars (
playwright.config.ts, all optional; defaults preserve the local flow) —E2E_BASE_URL(app under test),E2E_DEPLOY_CMD(webServer deploy command),PW_REMOTE_BROWSER=0(local browsers);e2e/state.spec.tsreadsE2E_COMPOSE_ARGSfor its mid-run container restart.
API
- Live base URL —
https://flight.dev.kkhost.pl(the docker-compose build behind Traefik). - Machine-readable spec — OpenAPI 3.x at
https://flight.dev.kkhost.pl/api/openapi; current app version at/api/version. - Spec lives in code — generated from
lib/openapi.ts, served byapp/api/openapi/route.ts; must be updated whenever an endpoint changes.
Other
- For longer terminal tasks you should use pty_* tools.