2.3 KiB
2.3 KiB
MeshBot — 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 tests covering it before moving on. Connected issues/tasks that reference the same part of code MAY be done together on one branch/PR with a single version bump (e.g. two tweaks to the same codec function).
- Feature branch + PR — every change lands on a feature branch off
main(no direct pushes to main). The branch carries the commits below; open a pull request tomain. - 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. - Verification must pass — there is no CI pipeline yet; before opening a PR both local checks must be green:
npm run buildandnpm test(vitest unit suite). - Tag + manual deploy after merge — once merged, tag the version on
main(e.g.v0.1.0). The service (http://bot.dev.kkhost.pl) is updated manually afterwards:docker compose up -d --buildon the host.
Verification
- Local checks —
npm run build(nest build) andnpm test(vitest; no e2e suite yet). Both must pass before a PR is opened. - Docker —
docker compose build, then afterdocker compose up -d:curl -s -H "Host: bot.dev.kkhost.pl" http://localhost/statusreturns JSON ({ connected, myNodeNum, host, port })."connected":falseis normal while the bridge/device is down — the service retries every 5 s.
API
- Live base URL —
http://bot.dev.kkhost.pl(Traefik → docker-compose stack on this host; container port 3000 via external network dev_net, no published ports). - Endpoints —
GET /status({ connected, myNodeNum, host, port }) andPOST /send(body{ "text": "...", "to"?: <node number | "!b" | "broadcast"> }, returns{ id }). No machine-readable spec yet; keep this list in sync with the controller.
Other
- For longer terminal tasks you should use pty_* tools.
- Host npm (10.9.4) has an arborist crash bug ("edgesOut") — if plain
npmmisbehaves on installs, usenpx npm@latest .... The lockfile must stay in sync with package.json: the Docker build runsnpm ci.